[libvirt] [PATCH] storage: Inherit permissions of parent pool if they are not specified

Eric Blake eblake at redhat.com
Tue Sep 20 19:27:19 UTC 2011

On 09/20/2011 11:05 AM, Laine Stump wrote:
> On 09/20/2011 04:38 AM, Osier Yang wrote:
>> If permissions (mode, uid, gid) are not specified, a new created vol
>> will get the permissions like:
>> mode = 0600
>> uid = -1
>> gid = -1
>> This will be a bit surprised if the user define the pool with a
>> non-root uid/gid, but the new created vol is still defined as
>> root/root.
>> This patch changes the behaviour so that the new created vol will
>> inherit the permissions of parent pool if permission are not
>> specified.
> Should this behavior maybe be changed later on when the definition is
> used, rather than during parsing? I tend to not like modifying the
> incoming data as part of a parse (although I know we're already doing
> that in some other places).
> (Of course other people may have a different opinion, or there may be a
> reason why my suggestion isn't feasible...)

I actually like the idea of keeping the user's data intact as long as 
possible, so I agree with Laine on refactoring the patch to delay the 
inheritance to the point of use when uid is still -1 (rather than 
reassigning uid at the time of parse).

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

More information about the libvir-list mailing list