[libvirt] [PATCH] util: Improve error reporting from getgrnam_r and friends

Eric Blake eblake at redhat.com
Mon Oct 8 17:16:09 UTC 2012


On 10/08/2012 06:54 AM, Peter Krempa wrote:
> Error reporting for getgrnam_r() isn't that broken as in getgrnam().
> 
> This patch enhances virGetUserIDByName() and virGetGroupIDByName() so
> that they error out if retrieval of the information failed but just log
> a debug message if the entry was not found.

I agree that this is needed.

> 
>>From the man page for getgrnam_r():
> 
> RETURN VALUE
>   ...
>   On success, getgrnam_r() and getgrgid_r() return zero, and set *result
>   to grp.  If no matching group record was found, these functions return
>   0 and store NULL in *result.  In case of error, an error number is
>   returned, and NULL is stored in *result.
> ---
> This patch has to be applied on top of:
> http://www.redhat.com/archives/libvir-list/2012-October/msg00190.html

However, this is a bit worrisome, since I had review comments on that
series.  Can we get these patches merged together into a single series,
to make sure that the final version going in is clean?

-- 
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: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121008/178658a1/attachment-0001.sig>


More information about the libvir-list mailing list