diff options
author | brian <brian@FreeBSD.org> | 1999-12-20 20:30:02 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-12-20 20:30:02 +0000 |
commit | 4145fb0c1be9e8321d6d4e6f465453c2cc0aed50 (patch) | |
tree | fce823325831d2a7126e8d74c67c40f44d69b13c /usr.sbin/ppp/chap.c | |
parent | ff8174b1b3e9f7d40f556d9af0d8168f7b81cefa (diff) | |
download | FreeBSD-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/chap.c')
-rw-r--r-- | usr.sbin/ppp/chap.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c index e28c509..8101413 100644 --- a/usr.sbin/ppp/chap.c +++ b/usr.sbin/ppp/chap.c @@ -230,6 +230,15 @@ chap_StartChild(struct chap *chap, char *prog, const char *name) case 0: timer_TermService(); + + if ((argc = command_Interpret(prog, strlen(prog), argv)) <= 0) { + if (argc < 0) { + log_Printf(LogWARN, "CHAP: Invalid command syntax\n"); + _exit(255); + } + _exit(0); + } + close(in[1]); close(out[0]); if (out[1] == STDIN_FILENO) @@ -245,7 +254,6 @@ chap_StartChild(struct chap *chap, char *prog, const char *name) for (fd = getdtablesize(); fd > STDERR_FILENO; fd--) fcntl(fd, F_SETFD, 1); setuid(geteuid()); - argc = command_Interpret(prog, strlen(prog), argv); command_Expand(nargv, argc, (char const *const *)argv, chap->auth.physical->dl->bundle, 0, pid); execvp(nargv[0], nargv); |