[libvirt] [v0.9.12-maint 7/9] Include process start time when doing polkit checks

Eric Blake eblake at redhat.com
Thu Sep 19 15:08:02 UTC 2013


On 09/19/2013 06:22 AM, Guido Günther wrote:
> On Wed, Sep 18, 2013 at 09:14:23PM -0600, Eric Blake wrote:
>> From: "Daniel P. Berrange" <berrange at redhat.com>
>>
>> Since PIDs can be reused, polkit prefers to be given
>> a (PID,start time) pair. If given a PID on its own,
>> it will attempt to lookup the start time in /proc/pid/stat,
>> though this is subject to races.
>>
>> It is safer if the client app resolves the PID start
>> time itself, because as long as the app has the client
>> socket open, the client PID won't be reused.
>>
>> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
>> (cherry picked from commit 979e9c56a7aadf2dcfbddd1abfbad594b78b4468)
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>>

>> +
>> +
>> +size_t virStringListLength(char **strings)
>> +{
>> +    size_t i = 0;
>> +
>> +    while (strings && strings[i])
>> +        i++;
>> +
>> +    return i;
>> +}
> 
> This looks a bit as if it could go into a separate commit since it adds
> a new utility function, but that's minor. Otherwise ACK to the whole
> series.

That utility function really was added during upstream commit 979e9c56
(yeah, we probably should have split that into two commits back in April
at the time of the upstream commit), but this backport is faithfully
reproducing what the original did.

Thanks for the review; I'll push the series shortly.

-- 
Eric Blake   eblake 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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130919/5320acbd/attachment-0001.sig>


More information about the libvir-list mailing list