From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIKlL-00077A-Mk for qemu-devel@nongnu.org; Fri, 15 Aug 2014 12:54:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIKlC-0003wm-L1 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 12:53:59 -0400 Sender: Richard Henderson Message-ID: <53EE3AFF.8020005@twiddle.net> Date: Fri, 15 Aug 2014 06:53:19 -1000 From: Richard Henderson MIME-Version: 1.0 References: <1408001361-13580-1-git-send-email-zhang.zhanghailiang@huawei.com> <1408001361-13580-10-git-send-email-zhang.zhanghailiang@huawei.com> <20140814103350.GH31346@redhat.com> <53EE212A.60405@msgid.tls.msk.ru> In-Reply-To: <53EE212A.60405@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v6 09/10] tcg: check return value of fopen() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , "Michael S. Tsirkin" , zhanghailiang Cc: kwolf@redhat.com, lkurusa@redhat.com, qemu-trivial@nongnu.org, jan.kiszka@siemens.com, riku.voipio@iki.fi, luonengjun@huawei.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, stefanha@redhat.com, Li Liu , pbonzini@redhat.com, peter.huangpeng@huawei.com, alex.bennee@linaro.org On 08/15/2014 05:03 AM, Michael Tokarev wrote: >>> f = fopen("/tmp/op.log", "w"); > > Gosh. So why are we still use fixed filenames in /tmp????? > Every such use is a potential security holw... :( Ughm. > > Can't we get rid of this somehow, by requiring a filename > parameter for example? It's in code that isn't compiled in by default. Better than taking a parameter, or doing something else one-off, I think it'd be best to dump this to the normal log file. I.e. use qemu_log instead of fprintf. r~