util: extend virGetUserID and virGetGroupID to support names and IDs
util: extend virGetUserID and virGetGroupID to support names and IDs

This patch updates virGetUserID and virGetGroupID to be able to parse a
user or group name in a similar way to coreutils' chown. This means that
a numeric value with a leading plus sign is always parsed as an ID,
otherwise the functions try to parse the input first as a user or group
name and if this fails they try to parse it as an ID.

This patch includes Peter Krempa's changes to correctly handle errors
returned by getpwnam_r and getgrnam_r.

siboulet/libvirt-openvz,crobinso/libvirt,shugaoye/libvirt,emaste/libvirt,iam-TJ/libvirt,taget/libvirt,siboulet/libvirt-openvz,trainstack/libvirt,jardasgit/libvirt,jardasgit/libvirt,cbosdo/libvirt,zhlcindy/libvirt-1.1.4-maintain,jeckersb/libvirt,andreabolognani/libvirt,olafhering/libvirt,jfehlig/libvirt,trainstack/libvirt,VenkatDatta/libvirt,eskultety/libvirt,cbosdo/libvirt,VenkatDatta/libvirt,trainstack/libvirt,datto/libvirt,zhlcindy/libvirt-1.1.4-maintain,bjzhang/libvirt,VenkatDatta/libvirt,agx/libvirt,jfehlig/libvirt,datto/libvirt,nertpinx/libvirt,emaste/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,zhlcindy/libvirt-1.1.4-maintain,agx/libvirt,olafhering/libvirt,novel/fbsd-libvirt,agx/libvirt,iam-TJ/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,elmarco/libvirt,novel/fbsd-libvirt,crobinso/libvirt,fabianfreyer/libvirt,rlaager/libvirt,nertpinx/libvirt,trainstack/libvirt,shugaoye/libvirt,taget/libvirt,novel/fbsd-libvirt,cbosdo/libvirt,jfehlig/libvirt,eskultety/libvirt,datto/libvirt,taget/libvirt,iam-TJ/libvirt,siboulet/libvirt-openvz,zippy2/libvirt,jeckersb/libvirt,andreabolognani/libvirt,siboulet/libvirt-openvz,jardasgit/libvirt,jardasgit/libvirt,shugaoye/libvirt,eskultety/libvirt,iam-TJ/libvirt,jeckersb/libvirt,shugaoye/libvirt,emaste/libvirt,novel/fbsd-libvirt,elmarco/libvirt,cbosdo/libvirt,cbosdo/libvirt,elmarco/libvirt,trainstack/libvirt,emaste/libvirt,rlaager/libvirt,zippy2/libvirt,novel/fbsd-libvirt,jeckersb/libvirt,libvirt/libvirt,iam-TJ/libvirt,libvirt/libvirt,datto/libvirt,libvirt/libvirt,olafhering/libvirt,bjzhang/libvirt,novel/fbsd-libvirt,emaste/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,novel/fbsd-libvirt,elmarco/libvirt,emaste/libvirt,iam-TJ/libvirt,zippy2/libvirt,fabianfreyer/libvirt,emaste/libvirt,rlaager/libvirt,zhlcindy/libvirt-1.1.4-maintain,zippy2/libvirt,fabianfreyer/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,VenkatDatta/libvirt,rlaager/libvirt,elmarco/libvirt,bjzhang/libvirt,taget/libvirt,nertpinx/libvirt,nertpinx/libvirt,andreabolognani/libvirt,trainstack/libvirt,eskultety/libvirt,novel/fbsd-libvirt,agx/libvirt,datto/libvirt,trainstack/libvirt,eskultety/libvirt,taget/libvirt,rlaager/libvirt,jeckersb/libvirt,olafhering/libvirt,siboulet/libvirt-openvz,jfehlig/libvirt,crobinso/libvirt,jeckersb/libvirt,crobinso/libvirt,libvirt/libvirt,bjzhang/libvirt,bjzhang/libvirt,zhlcindy/libvirt-1.1.4-maintain,jeckersb/libvirt,shugaoye/libvirt,andreabolognani/libvirt,agx/libvirt