From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
Cc: Sanchit Garg <sancgarg@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p
Date: Wed, 1 Dec 2010 21:17:26 +0000 [thread overview]
Message-ID: <AANLkTimWMRmMCHj9qFwhkFjHBGcAHwuAhiAFYECT7dJH@mail.gmail.com> (raw)
In-Reply-To: <4CF68D82.7070507@linux.vnet.ibm.com>
On Wed, Dec 1, 2010 at 6:01 PM, Venkateswararao Jujjuri (JV)
<jvrao@linux.vnet.ibm.com> wrote:
> On 12/1/2010 1:35 AM, Stefan Hajnoczi wrote:
>> On Tue, Nov 30, 2010 at 9:52 AM, Sanchit Garg
>> <sancgarg@linux.vnet.ibm.com> wrote:
>>> @@ -3707,19 +3708,19 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
>>> s->ctx.fs_sm = SM_NONE;
>>> s->ctx.xops = none_xattr_ops;
>>> } else {
>>> - fprintf(stderr, "Default to security_model=none. You may want"
>>> + error_report("Default to security_model=none. You may want"
>>> " enable advanced security model using "
>>> "security option:\n\t security_model=passthrough \n\t "
>>> - "security_model=mapped\n");
>>> + "security_model=mapped");
>>> s->ctx.fs_sm = SM_NONE;
>>> s->ctx.xops = none_xattr_ops;
>>> }
>>
>> It would be safer to avoid embedded \n\t. Although 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. Security issues arise when unfiltered inputs are logged *and*
>> linebreaks are allowed because malicious input can inject fake log
>> lines. Let's avoid getting into the habit.
>
> Embedded breaks were introduced to give more readable and formatted output.
> Stafan do you suggest to print the entire message in one line?
Yes, exactly.
Stefan
next prev parent reply other threads:[~2010-12-01 21:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-30 9:52 [Qemu-devel] [PATCH] Convert fprintf() to error_request(): virtio-9p Sanchit Garg
2010-12-01 9:35 ` Stefan Hajnoczi
2010-12-01 18:01 ` Venkateswararao Jujjuri (JV)
2010-12-01 21:17 ` Stefan Hajnoczi [this message]
2010-12-14 17:33 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimWMRmMCHj9qFwhkFjHBGcAHwuAhiAFYECT7dJH@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=jvrao@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=sancgarg@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).