From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjnp5-0006Ku-Du for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:14:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tjnp2-0002Sg-Nu for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:14:19 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:51509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjnp2-0002ST-Fv for qemu-devel@nongnu.org; Sat, 15 Dec 2012 04:14:16 -0500 Date: Sat, 15 Dec 2012 04:14:14 -0500 (EST) From: Paolo Bonzini Message-ID: <945049786.24997408.1355562854731.JavaMail.root@redhat.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] qtest: Enable creation of multiple qemu instances List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: kwolf@redhat.com, Jason Baron , aliguori@us.ibm.com, qemu-devel@nongnu.org, quintela@redhat.com > > +#define QTEST_FILE_TEMP "/tmp/qtest-%d.sock" > > +#define QTEST_QMP_FILE_TEMP "/tmp/qtest-%d.qmp" > > +#define QTEST_PID_FILE_TEMP "/tmp/qtest-%d.pid" > > These filenames are too predictable from security point of view, This need not be secure as long as the file is created with 0600 permissions. In fact, inspecting the pid file from the shell can be useful. However, using mkstemp() on a prefix that includes the parent pid can indeed be the best of both worlds. Paolo