[libvirt] [PATCH] Allow sticky bit to be read and set.

Eric Blake eblake at redhat.com
Tue Aug 14 23:18:03 UTC 2012


On 08/10/2012 07:19 AM, Ján Tomko wrote:

Commit message is sparse, give one or two sentences why this might be
useful.

> ---
>  src/conf/storage_conf.c       |    8 +++++---
>  src/storage/storage_backend.c |    2 +-
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> index 3132aae..017648d 100644
> --- a/src/conf/storage_conf.c
> +++ b/src/conf/storage_conf.c
> @@ -667,7 +667,8 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt,
>      } else {
>          int tmp;
>  
> -        if (virStrToLong_i(mode, NULL, 8, &tmp) < 0 || (tmp & ~0777)) {
> +        if (virStrToLong_i(mode, NULL, 8, &tmp) < 0 ||
> +            (tmp & ~(S_ISVTX | S_IRWXUGO))) {

POSIX requires S_ISVTX to be a constant value, so it's also okay to
write this 01777, but I like the symbolic naming as evidence of what
we're doing.

ACK once you provide a commit message.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120814/c442a2e6/attachment-0001.sig>


More information about the libvir-list mailing list