From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzLPB-0003kF-LW for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzLP6-0005t5-Jr for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:49:09 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:52167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzLP6-0005sq-CQ for qemu-devel@nongnu.org; Mon, 01 Jun 2015 04:49:04 -0400 Message-ID: <556C1C7F.40203@msgid.tls.msk.ru> Date: Mon, 01 Jun 2015 11:49:03 +0300 From: Michael Tokarev MIME-Version: 1.0 References: <1433142369-14266-1-git-send-email-mrezanin@redhat.com> <87iob7lv1p.fsf@blackfin.pond.sub.org> <556C1C0B.6030209@redhat.com> In-Reply-To: <556C1C0B.6030209@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] net: fix insecure temporary file creation in SLiRP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Markus Armbruster , mrezanin@redhat.com Cc: pmatouse@redhat.com, qemu-devel@nongnu.org, P J P 01.06.2015 11:47, Paolo Bonzini =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 >=20 > On 01/06/2015 09:58, Markus Armbruster wrote: >>>> - snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d"= , >>>> - (long)getpid(), instance++); >>>> - if (mkdir(s->smb_dir, 0700) < 0) { >>>> - error_report("could not create samba server dir '%s'", s->s= mb_dir); >>>> + if (!(tmpdir =3D mkdtemp(smb_dir))) { >=20 > mkdtemp is unfortunately missing on Windows, and g_mkdtemp requires gli= b > 2.30. This code is within #ifndef WIN32 block. /mjt