summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/prompt.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/prompt.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/prompt.c')
-rw-r--r--usr.sbin/ppp/prompt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c
index 631fe89..5e39f00 100644
--- a/usr.sbin/ppp/prompt.c
+++ b/usr.sbin/ppp/prompt.c
@@ -173,6 +173,7 @@ static void
prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
{
struct prompt *p = descriptor2prompt(d);
+ struct prompt *op;
int n;
char ch;
char linebuff[LINE_LEN];
@@ -186,8 +187,12 @@ prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
linebuff[n] = '\0';
p->nonewline = 1; /* Maybe command_Decode does a prompt */
prompt_Required(p);
- if (n)
+ if (n) {
+ if ((op = log_PromptContext) == NULL)
+ log_PromptContext = p;
command_Decode(bundle, linebuff, n, p, p->src.from);
+ log_PromptContext = op;
+ }
} else if (n <= 0) {
log_Printf(LogPHASE, "%s: Client connection closed.\n", p->src.from);
if (!p->owner)
OpenPOWER on IntegriCloud