diff options
author | Peter Krempa <pkrempa@redhat.com> | 2015-06-08 09:32:24 +0200 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2015-06-08 09:32:24 +0200 |
commit | 679576cf8cc51fa71c04b9b36ce4760c0008e4cb (patch) | |
tree | cdf6f3b65e7c6d079c34ad32d84e9f7bfb58d424 | |
parent | 568aba88111541447e7d7163f7683f0daf2a684a (diff) | |
download | libvirt-679576cf8cc51fa71c04b9b36ce4760c0008e4cb.tar.gz |
util: Properly return error from virGetUserID and virGetGroupID stubs
The stubs for the two functions that are compiled on platforms that
don't have HAVE_GETPWUID_R and friends defined do not return error but
report an error message. The calling code then assumes that the @uid or
@gid arguments were filled, which is not the case in the stubs.
-rw-r--r-- | src/util/virutil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/virutil.c b/src/util/virutil.c index e479cce9be..cddc78a700 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1316,7 +1316,7 @@ int virGetUserID(const char *name ATTRIBUTE_UNUSED, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("virGetUserID is not available")); - return 0; + return -1; } @@ -1326,7 +1326,7 @@ int virGetGroupID(const char *name ATTRIBUTE_UNUSED, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("virGetGroupID is not available")); - return 0; + return -1; } int |