Received: from [140.186.70.92] (port=45015 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSYkj-0008O3-JA for qemu-devel@nongnu.org; Tue, 14 Dec 2010 12:33:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSYki-0000ER-CU for qemu-devel@nongnu.org; Tue, 14 Dec 2010 12:33:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSYki-0000EL-2E for qemu-devel@nongnu.org; Tue, 14 Dec 2010 12:33:28 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p References: <20101130095248.8514.75180.stgit@sancgarg.in.ibm.com> <4CF68D82.7070507@linux.vnet.ibm.com> Date: Tue, 14 Dec 2010 18:33:14 +0100 In-Reply-To: (Stefan Hajnoczi's message of "Wed, 1 Dec 2010 21:17:26 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Sanchit Garg , "Venkateswararao Jujjuri (JV)" , qemu-devel@nongnu.org Stefan Hajnoczi writes: > On Wed, Dec 1, 2010 at 6:01 PM, Venkateswararao Jujjuri (JV) > wrote: >> On 12/1/2010 1:35 AM, Stefan Hajnoczi wrote: >>> On Tue, Nov 30, 2010 at 9:52 AM, Sanchit Garg >>> wrote: >>>> @@ -3707,19 +3708,19 @@ VirtIODevice *virtio_9p_init(DeviceState *dev,= V9fsConf *conf) >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->ctx.fs_sm =3D SM_NONE; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->ctx.xops =3D none_xattr_ops; >>>> =C2=A0 =C2=A0 } else { >>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf(stderr, "Default to security_mode= l=3Dnone. You may want" >>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0error_report("Default to security_model= =3Dnone. You may want" >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " enable advan= ced security model using " >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "security opti= on:\n\t security_model=3Dpassthrough \n\t " >>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"security_mod= el=3Dmapped\n"); >>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"security_mod= el=3Dmapped"); >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->ctx.fs_sm =3D SM_NONE; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->ctx.xops =3D none_xattr_ops; >>>> =C2=A0 =C2=A0 } >>> >>> It would be safer to avoid embedded \n\t. =C2=A0Although I can't find >>> anything prohibiting it in the source, no other place does this. >>> Program output is easier to handle when constrained to one message per >>> line. =C2=A0Security issues arise when unfiltered inputs are logged *an= d* >>> linebreaks are allowed because malicious input can inject fake log >>> lines. =C2=A0Let's avoid getting into the habit. >> >> Embedded breaks were introduced to give more readable and formatted outp= ut. >> Stafan do you suggest to print the entire message in one line? > > Yes, exactly. If you respin anyway, please fix the subject: s/error_request/error_report/