From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38803 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfvhj-000599-MV for qemu-devel@nongnu.org; Thu, 20 Jan 2011 09:41:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfvhi-0004zJ-CR for qemu-devel@nongnu.org; Thu, 20 Jan 2011 09:41:39 -0500 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:56021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfvhh-0004yd-Kq for qemu-devel@nongnu.org; Thu, 20 Jan 2011 09:41:38 -0500 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp09.in.ibm.com (8.14.4/8.13.1) with ESMTP id p0KDuevf004435 for ; Thu, 20 Jan 2011 19:26:40 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0KEfSUh2400300 for ; Thu, 20 Jan 2011 20:11:28 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0KEfSJW003451 for ; Fri, 21 Jan 2011 01:41:28 +1100 From: "M. Mohan Kumar" Subject: Re: [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation changes to none security model Date: Thu, 20 Jan 2011 20:11:27 +0530 References: <1295331799-23856-1-git-send-email-mohan@in.ibm.com> <1295339056-25396-1-git-send-email-mohan@in.ibm.com> <20110120085954.GB24021@stefanha-thinkpad.localdomain> In-Reply-To: <20110120085954.GB24021@stefanha-thinkpad.localdomain> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201101202011.28037.mohan@in.ibm.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org On Thursday 20 January 2011 2:29:54 pm Stefan Hajnoczi wrote: > On Tue, Jan 18, 2011 at 01:54:16PM +0530, M. Mohan Kumar wrote: > > - if (lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid) < 0)= { > > - /* > > - * If we fail to change ownership and if we are > > - * using security model none. Ignore the error > > - */ > > - if (fs_ctx->fs_sm !=3D SM_NONE) { > > - return -1; > > - } > > - } > > + retval =3D lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gi= d); > >=20 > > return 0; > > =20 > > } >=20 > retval is unused. >=20 That was used to disable the warning message "error: ignoring return value = of=20 =E2=80=98lchown=E2=80=99, declared with attribute warn_unused_result" Otherwise I have to use if (lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid)) { ; } > Can multiple virtio-9p requests execute at a time? chmod() and lchown() > after creation is a race condition if other requests can execute > concurrently. >=20 We can't implement file creation with requested user credentials and permis= sion=20 bits in the none security model atomically. Its expected behaviour only =2D--- M. Mohan Kumar