summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/exec.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-12-20 20:30:02 +0000
committerbrian <brian@FreeBSD.org>1999-12-20 20:30:02 +0000
commit4145fb0c1be9e8321d6d4e6f465453c2cc0aed50 (patch)
treefce823325831d2a7126e8d74c67c40f44d69b13c /usr.sbin/ppp/exec.c
parentff8174b1b3e9f7d40f556d9af0d8168f7b81cefa (diff)
downloadFreeBSD-src-4145fb0c1be9e8321d6d4e6f465453c2cc0aed50.zip
FreeBSD-src-4145fb0c1be9e8321d6d4e6f465453c2cc0aed50.tar.gz
Notice and warn about unterminated quoted strings in commands.
The entire command is ignored if the syntax is invalid...
Diffstat (limited to 'usr.sbin/ppp/exec.c')
-rw-r--r--usr.sbin/ppp/exec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ppp/exec.c b/usr.sbin/ppp/exec.c
index d1f3f64..0ded3cb 100644
--- a/usr.sbin/ppp/exec.c
+++ b/usr.sbin/ppp/exec.c
@@ -141,15 +141,20 @@ exec_Create(struct physical *p)
log_Printf(LogDEBUG, "Exec'ing ``%s''\n", p->name.base);
+ if ((argc = MakeArgs(p->name.base, argv, VECSIZE(argv))) < 0) {
+ log_Printf(LogWARN, "Syntax error in exec command\n");
+ _exit(127);
+ }
+
+ command_Expand(argv, argc, (char const *const *)argv,
+ p->dl->bundle, 0, realpid);
+
dup2(fids[1], STDIN_FILENO);
dup2(fids[1], STDOUT_FILENO);
dup2(fids[1], STDERR_FILENO);
for (i = getdtablesize(); i > STDERR_FILENO; i--)
fcntl(i, F_SETFD, 1);
- argc = MakeArgs(p->name.base, argv, VECSIZE(argv));
- command_Expand(argv, argc, (char const *const *)argv,
- p->dl->bundle, 0, realpid);
execvp(*argv, argv);
printf("execvp failed: %s: %s\r\n", *argv, strerror(errno));
_exit(127);
OpenPOWER on IntegriCloud