qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]