From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52439 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNu3M-0002E0-H8 for qemu-devel@nongnu.org; Wed, 01 Dec 2010 16:17:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNu3L-0003tO-A8 for qemu-devel@nongnu.org; Wed, 01 Dec 2010 16:17:28 -0500 Received: from mail-qy0-f195.google.com ([209.85.216.195]:43559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNu3L-0003tK-57 for qemu-devel@nongnu.org; Wed, 01 Dec 2010 16:17:27 -0500 Received: by qyk2 with SMTP id 2so2171224qyk.10 for ; Wed, 01 Dec 2010 13:17:26 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4CF68D82.7070507@linux.vnet.ibm.com> References: <20101130095248.8514.75180.stgit@sancgarg.in.ibm.com> <4CF68D82.7070507@linux.vnet.ibm.com> Date: Wed, 1 Dec 2010 21:17:26 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Venkateswararao Jujjuri (JV)" Cc: Sanchit Garg , qemu-devel@nongnu.org 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) >>> =A0 =A0 =A0 =A0 s->ctx.fs_sm =3D SM_NONE; >>> =A0 =A0 =A0 =A0 s->ctx.xops =3D none_xattr_ops; >>> =A0 =A0 } else { >>> - =A0 =A0 =A0 =A0fprintf(stderr, "Default to security_model=3Dnone. You= may want" >>> + =A0 =A0 =A0 =A0error_report("Default to security_model=3Dnone. You ma= y want" >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " enable advanced security model using = " >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "security option:\n\t security_model=3D= passthrough \n\t " >>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"security_model=3Dmapped\n"); >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"security_model=3Dmapped"); >>> =A0 =A0 =A0 =A0 s->ctx.fs_sm =3D SM_NONE; >>> =A0 =A0 =A0 =A0 s->ctx.xops =3D none_xattr_ops; >>> =A0 =A0 } >> >> It would be safer to avoid embedded \n\t. =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. =A0Security issues arise when unfiltered inputs are logged *and* >> linebreaks are allowed because malicious input can inject fake log >> lines. =A0Let's avoid getting into the habit. > > Embedded breaks were introduced to give more readable and formatted outpu= t. > Stafan do you suggest to print the entire message in one line? Yes, exactly. Stefan