From 093eaec219c13b191968271a4d366669621b4f5f Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 19 Jul 2016 22:10:52 +0200 Subject: kernel: dont pprint() into 9p channels when fd 2 (stderr) points to a mount channel, dont cause protocol confusion by dumping error strings into it. --- sys/src/9/port/devcons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/9/port') diff --git a/sys/src/9/port/devcons.c b/sys/src/9/port/devcons.c index 039108540..808683451 100644 --- a/sys/src/9/port/devcons.c +++ b/sys/src/9/port/devcons.c @@ -302,7 +302,7 @@ pprint(char *fmt, ...) return 0; c = up->fgrp->fd[2]; - if(c==nil || (c->mode!=OWRITE && c->mode!=ORDWR)) + if(c==nil || (c->flag&CMSG)!=0 || (c->mode!=OWRITE && c->mode!=ORDWR)) return 0; n = snprint(buf, sizeof buf, "%s %lud: ", up->text, up->pid); va_start(arg, fmt); -- cgit v1.2.3