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/systems.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/systems.c')
-rw-r--r-- | usr.sbin/ppp/systems.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c index db29092..5c8216d 100644 --- a/usr.sbin/ppp/systems.c +++ b/usr.sbin/ppp/systems.c @@ -340,19 +340,22 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file, } len = strlen(cp); - argc = command_Interpret(cp, len, argv); - allowcmd = argc > 0 && !strcasecmp(argv[0], "allow"); - if ((!(how == SYSTEM_EXEC) && allowcmd) || - ((how == SYSTEM_EXEC) && !allowcmd)) { - /* - * Disable any context so that warnings are given to everyone, - * including syslog. - */ - op = log_PromptContext; - log_PromptContext = NULL; - command_Run(bundle, argc, (char const *const *)argv, prompt, - name, cx); - log_PromptContext = op; + if ((argc = command_Interpret(cp, len, argv)) < 0) + log_Printf(LogWARN, "%s: %d: Syntax error\n", filename, linenum); + else { + allowcmd = argc > 0 && !strcasecmp(argv[0], "allow"); + if ((!(how == SYSTEM_EXEC) && allowcmd) || + ((how == SYSTEM_EXEC) && !allowcmd)) { + /* + * Disable any context so that warnings are given to everyone, + * including syslog. + */ + op = log_PromptContext; + log_PromptContext = NULL; + command_Run(bundle, argc, (char const *const *)argv, prompt, + name, cx); + log_PromptContext = op; + } } } |