From 1a77c3372ee73695efb75693292dbb4fb7df1625 Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 6 Sep 1999 08:16:33 +0000 Subject: 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. --- usr.sbin/ppp/systems.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ppp/systems.c') 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 */ -- cgit v1.1