diff options
author | brian <brian@FreeBSD.org> | 1999-06-09 08:47:36 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-06-09 08:47:36 +0000 |
commit | fb0eee157d1c0f7de57d40fbf76e6c7f01de31df (patch) | |
tree | d47399688c47f8f9c41c12296a3cce9ba775f886 /usr.sbin/ppp/exec.c | |
parent | f6ef6875616b27561cbd9f7f0e44643ea8c07154 (diff) | |
download | FreeBSD-src-fb0eee157d1c0f7de57d40fbf76e6c7f01de31df.zip FreeBSD-src-fb0eee157d1c0f7de57d40fbf76e6c7f01de31df.tar.gz |
Use the correct pid when substituting PROCESSID.
Problem reported by: Amedeo Beck Peccoz <gea@gressoney.it>
Diffstat (limited to 'usr.sbin/ppp/exec.c')
-rw-r--r-- | usr.sbin/ppp/exec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ppp/exec.c b/usr.sbin/ppp/exec.c index 28c03e0..7f2ce7a 100644 --- a/usr.sbin/ppp/exec.c +++ b/usr.sbin/ppp/exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exec.c,v 1.4 1999/06/01 19:08:57 brian Exp $ + * $Id: exec.c,v 1.5 1999/06/05 21:35:50 brian Exp $ */ #include <sys/param.h> @@ -118,7 +118,7 @@ exec_Create(struct physical *p) strerror(errno)); else { int stat, argc; - pid_t pid; + pid_t pid, realpid; char *argv[MAXARGS]; stat = fcntl(fids[0], F_GETFL, 0); @@ -126,6 +126,7 @@ exec_Create(struct physical *p) stat |= O_NONBLOCK; fcntl(fids[0], F_SETFL, stat); } + realpid = getpid(); switch ((pid = fork())) { case -1: log_Printf(LogPHASE, "Unable to create pipe for line exec: %s\n", @@ -156,7 +157,7 @@ exec_Create(struct physical *p) log_Printf(LogDEBUG, "Exec'ing ``%s''\n", p->name.base); argc = MakeArgs(p->name.base, argv, VECSIZE(argv)); command_Expand(argv, argc, (char const *const *)argv, - p->dl->bundle, 0); + p->dl->bundle, 0, realpid); execvp(*argv, argv); fprintf(stderr, "execvp failed: %s: %s\r\n", *argv, strerror(errno)); _exit(127); |