[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation chang
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 |
User-agent: |
KMail/1.13.5 (Linux/2.6.35.10-74.fc14.i686.PAE; KDE/4.5.4; i686; ; ) |
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 != SM_NONE) {
> > - return -1;
> > - }
> > - }
> > + retval = lchown(rpath(fs_ctx, path), credp->fc_uid, credp->fc_gid);
> >
> > return 0;
> >
> > }
>
> retval is unused.
>
That was used to disable the warning message "error: ignoring return value of
‘lchown’, 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.
>
We can't implement file creation with requested user credentials and permission
bits in the none security model atomically. Its expected behaviour only
----
M. Mohan Kumar
- [Qemu-devel] [V3 PATCH 3/8] virtio-9p: Add client side interfaces for chroot environment, (continued)
- [Qemu-devel] [V3 PATCH 3/8] virtio-9p: Add client side interfaces for chroot environment, M. Mohan Kumar, 2011/01/18
- [Qemu-devel] [V3 PATCH 4/8] virtio-9p: Add support to open a file in chroot environment, M. Mohan Kumar, 2011/01/18
- [Qemu-devel] [V3 PATCH 5/8] virtio-9p: Create support in chroot environment, M. Mohan Kumar, 2011/01/18
- [Qemu-devel] [V3 PATCH 6/8] virtio-9p: Support for creating special files, M. Mohan Kumar, 2011/01/18
- [Qemu-devel] [V3 PATCH 8/8] virtio-9p: Chroot environment for other functions, M. Mohan Kumar, 2011/01/18
- [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation changes to none security model, M. Mohan Kumar, 2011/01/18
- Re: [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation changes to none security model, Venkateswararao Jujjuri (JV), 2011/01/20
- Re: [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation changes to none security model, Stefan Hajnoczi, 2011/01/20
- Re: [Qemu-devel] [V3 PATCH 7/8] virtio-9p: Move file post creation changes to none security model, Venkateswararao Jujjuri (JV), 2011/01/21