summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/systems.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-09-06 08:16:33 +0000
committerbrian <brian@FreeBSD.org>1999-09-06 08:16:33 +0000
commit1a77c3372ee73695efb75693292dbb4fb7df1625 (patch)
tree680d9565a2e1e5acb4d08b76f16ec446096caa0d /usr.sbin/ppp/systems.c
parent389c23d61791710d0d3af997c3eebb6d16582308 (diff)
downloadFreeBSD-src-1a77c3372ee73695efb75693292dbb4fb7df1625.zip
FreeBSD-src-1a77c3372ee73695efb75693292dbb4fb7df1625.tar.gz
When logging warning messages, there are now three scenarios:
o If a prompt is executing the command, only display the warning to that prompt o If a prompt is executing a ``load'' command, display the warning to all prompts *and* syslog o Otherwise, display the warning to all prompts *and* syslog.
Diffstat (limited to 'usr.sbin/ppp/systems.c')
-rw-r--r--usr.sbin/ppp/systems.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index 5e160f6..db29092 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -267,6 +267,7 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
int allowcmd;
int indent;
char arg[LINE_LEN];
+ struct prompt *op;
if (*file == '/')
snprintf(filename, sizeof filename, "%s", file);
@@ -342,9 +343,17 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file,
argc = command_Interpret(cp, len, argv);
allowcmd = argc > 0 && !strcasecmp(argv[0], "allow");
if ((!(how == SYSTEM_EXEC) && allowcmd) ||
- ((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;
+ }
}
fclose(fp); /* everything read - get out */
OpenPOWER on IntegriCloud