qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] virtfs-proxy-helper: check retur


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] virtfs-proxy-helper: check return code of setfsgid/setfsuid
Date: Wed, 10 Oct 2012 18:17:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

Il 10/10/2012 18:14, Stefan Weil ha scritto:
>>
>>
>> diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
>> index f9a8270..b34a84a 100644
>> --- a/fsdev/virtfs-proxy-helper.c
>> +++ b/fsdev/virtfs-proxy-helper.c
>> @@ -290,8 +290,12 @@ static int setfsugid(int uid, int gid)
>>           CAP_DAC_OVERRIDE,
>>       };
>>   -    setfsgid(gid);
>> -    setfsuid(uid);
>> +    if (setfsgid(gid) != 0) {
>> +        return -1;
>> +    }
> 
> Wouldn't setfsgid(gid) == gid be also ok?

Of course, it should be < 0.  I have no idea how to test this thing...

Paolo



reply via email to

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