libvirt/src/util
Christophe Fergeau a33f4eae83 util: Don't fail virGetGroupIDByName when group not found
virGetGroupIDByName is documented as returning 1 if the groupname
cannot be found. getgrnam_r is documented as returning:
« 0 or ENOENT or ESRCH or EBADF or EPERM or ...  The given name
or gid was not found. »
 and that:
« The formulation given above under "RETURN VALUE" is from POSIX.1-2001.
It  does  not  call  "not  found"  an error, hence does not specify what
value errno might have in this situation.  But that makes it impossible to
recognize errors.  One might argue that according to POSIX errno should be
left unchanged if an entry is not found.  Experiments on various UNIX-like
systems shows that lots of different values occur in this situation: 0,
ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM and probably others. »

virGetGroupIDByName returns an error when the return value of getgrnam_r
is non-0. However on my RHEL system, getgrnam_r returns ENOENT when the
requested user cannot be found, which then causes virGetGroupID not
to behave as documented (it returns an error instead of falling back
to parsing the passed-in value as an gid).

This commit makes virGetGroupIDByName only report an error when errno
is set to one of the values in the posix description of getgrnam_r
(which are the same as the ones described in the manpage on my system).
2012-12-06 17:21:54 +01:00
..
bitmap.c bitmap: fix typo to use UL type of integer constant in virBitmapIsAllSet 2012-11-28 18:30:28 +08:00
bitmap.h bitmap: add virBitmapCountBits 2012-10-25 11:19:23 -06:00
buf.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
buf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
cgroup.c Turn some dual-state int parameters into booleans 2012-11-29 16:14:43 +00:00
cgroup.h Turn some dual-state int parameters into booleans 2012-11-29 16:14:43 +00:00
command.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
command.h Move virProcess{Kill,Abort,TranslateStatus} into virprocess.{c,h} 2012-09-26 10:09:57 +01:00
conf.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
conf.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
dnsmasq.c dnsmasq: Fix parsing of the version number 2012-12-06 13:48:11 +01:00
dnsmasq.h util: capabilities detection for dnsmasq 2012-11-29 15:02:39 -05:00
ebtables.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
ebtables.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
event_poll.c Skip deleted timers when calculting next timeout 2012-11-23 10:11:55 +00:00
event_poll.h Fix indentions 2012-12-03 09:58:57 +08:00
event.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
event.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
hooks.c hooks: let virCommand do the error reporting 2012-10-09 08:41:53 -06:00
hooks.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
hostusb.c qemu: Add option to treat missing USB devices as success 2012-10-11 15:11:41 +02:00
hostusb.h qemu: Add option to treat missing USB devices as success 2012-10-11 15:11:41 +02:00
iohelper.c iohelper: Don't report errors on special FDs 2012-11-05 16:55:42 +01:00
iptables.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
iptables.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
json.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
json.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
keymaps.csv Rsync keymaps.csv file with GTK-VNC 2012-01-12 20:44:55 +00:00
logging.c Use helper functions to format the journal iov array 2012-11-14 20:20:02 -07:00
logging.h Add metadata to virLogOutputFunc 2012-11-14 19:14:07 -07:00
memory.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
memory.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
pci.c pci: Fix building of 32bit PCI command array 2012-12-05 14:04:54 +01:00
pci.h util: Slightly refactor PCI list functions 2012-12-05 13:45:34 +01:00
processinfo.c util: fix virBitmap allocation in virProcessInfoGetAffinity 2012-11-29 10:10:08 -07:00
processinfo.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
sexpr.c Convert (nearly) all files in src/util/ to use virReportError() 2012-07-18 16:31:35 +01:00
sexpr.h build: fix PROBE() usage of intptr_t 2012-08-09 15:40:42 -06:00
stats_linux.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
stats_linux.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_file.c qemu: Stop recursive detection of image chains when an image is missing 2012-11-22 16:04:17 +01:00
storage_file.h storage: let format probing work on root-squash NFS 2012-10-22 09:04:57 -06:00
sysinfo.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
sysinfo.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threadpool.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threadpool.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads-pthread.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads-pthread.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads-win32.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads-win32.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
threads.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
util.c util: Don't fail virGetGroupIDByName when group not found 2012-12-06 17:21:54 +01:00
util.h Add systemd journal support 2012-09-28 16:02:56 +01:00
uuid.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
uuid.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
viratomic.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
viratomic.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
viraudit.c Add a metadata parameter to virLog{, V}Message 2012-11-14 19:08:31 -07:00
viraudit.h Change logging category parameter into an enum 2012-09-28 10:39:28 +01:00
virauth.c Fix crash accessing a NULL URI when looking up auth credentials 2012-09-21 10:13:53 +01:00
virauth.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virauthconfig.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virauthconfig.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virdbus.c virdbus: Add virDBusGetSessionBus helper 2012-11-27 19:37:00 +00:00
virdbus.h virdbus: Add virDBusGetSessionBus helper 2012-11-27 19:37:00 +00:00
virfile.c util: check for NULL parameter in virFileWrapperFdCatchError 2012-11-29 00:00:39 +08:00
virfile.h qemu: Report errors from iohelper 2012-10-29 17:04:26 +01:00
virhash.c Fix some typos in messages, docs and comments. 2012-08-22 15:34:07 -06:00
virhash.h Implement virHashRemoveAll function 2012-04-19 10:21:43 -04:00
virhashcode.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virhashcode.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virinitctl.c Add APIs for talking to init via /dev/initctl 2012-11-30 19:17:30 +00:00
virinitctl.h Add APIs for talking to init via /dev/initctl 2012-11-30 19:17:30 +00:00
virkeycode-mapgen.py Fix keymap used to talk with QEMU 2011-08-26 14:18:57 +01:00
virkeycode.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virkeycode.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virkeyfile.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virkeyfile.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virlockspace.c util: fix index when building lock owners array 2012-11-14 12:43:49 -05:00
virlockspace.h Add JSON serialization of virLockSpacePtr objects for process re-exec() 2012-10-16 15:45:55 +01:00
virmacaddr.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virmacaddr.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdev.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdev.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevbandwidth.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevbandwidth.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevbridge.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevbridge.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevmacvlan.c Specify name of target interface with macvlan error 2012-11-27 17:02:22 +00:00
virnetdevmacvlan.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevopenvswitch.c openvswitch: Add utility functions for getting and setting Open vSwitch per-port data 2012-10-23 15:26:04 -04:00
virnetdevopenvswitch.h openvswitch: Add utility functions for getting and setting Open vSwitch per-port data 2012-10-23 15:26:04 -04:00
virnetdevtap.c network: fix dnsmasq/radvd binding to IPv6 on recent kernels 2012-09-27 11:17:52 -06:00
virnetdevtap.h network: fix dnsmasq/radvd binding to IPv6 on recent kernels 2012-09-27 11:17:52 -06:00
virnetdevveth.c Fix error reporting in virNetDevVethDelete 2012-11-27 17:59:28 +00:00
virnetdevveth.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevvlan.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevvlan.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetdevvportprofile.c Correct checking of virStrcpyStatic() return value 2012-10-03 21:17:13 -04:00
virnetdevvportprofile.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetlink.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnetlink.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnodesuspend.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virnodesuspend.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virobject.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virobject.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virpidfile.c Don't assume pid_t is the same size as an int 2012-11-01 09:16:04 +00:00
virpidfile.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virprocess.c Don't assume pid_t is the same size as an int 2012-11-01 09:16:04 +00:00
virprocess.h Move most of qemuProcessKill into virProcessKillPainfully 2012-09-27 10:11:44 +01:00
virrandom.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virrandom.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsocketaddr.c util: new virSocketAddrIsPrivate function 2012-11-29 15:02:39 -05:00
virsocketaddr.h util: new virSocketAddrIsPrivate function 2012-11-29 15:02:39 -05:00
virstring.c Introduce APIs for splitting/joining strings 2012-11-30 20:05:43 +00:00
virstring.h Introduce APIs for splitting/joining strings 2012-11-30 20:05:43 +00:00
virterror_internal.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virterror.c Add APIs for talking to init via /dev/initctl 2012-11-30 19:17:30 +00:00
virtime.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
virtime.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virtypedparam.c maint: Misc whitespace cleanups 2012-12-03 15:13:32 +01:00
virtypedparam.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
viruri.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
viruri.h Fix crash accessing a NULL URI when looking up auth credentials 2012-09-21 10:13:53 +01:00
xml.c Remove spurious whitespace between function name & open brackets 2012-11-02 13:36:49 +00:00
xml.h xml: print uuids in the warning 2012-10-29 14:38:43 +01:00