summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak2011-01-23 22:37:22 +0100
committerKarel Zak2011-01-23 22:37:22 +0100
commit282a58fd663547d75189734bc0943d6334cf6b7f (patch)
tree00352b10e1532973c0bc79ee49386dee3612cbff /shlibs/mount/src/utils.c
parentremaining util-linux-ng to util-linux (diff)
downloadkernel-qcow2-util-linux-282a58fd663547d75189734bc0943d6334cf6b7f.tar.gz
kernel-qcow2-util-linux-282a58fd663547d75189734bc0943d6334cf6b7f.tar.xz
kernel-qcow2-util-linux-282a58fd663547d75189734bc0943d6334cf6b7f.zip
libmount: _SC_GETPW_R_SIZE_MAX portability issue
Addresses: https://bugs.gentoo.org/show_bug.cgi?id=350340 Reported-by: Alan Hourihane <alanh@fairlite.co.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/utils.c')
-rw-r--r--shlibs/mount/src/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/shlibs/mount/src/utils.c b/shlibs/mount/src/utils.c
index c9e171cc9..35d43452e 100644
--- a/shlibs/mount/src/utils.c
+++ b/shlibs/mount/src/utils.c
@@ -372,7 +372,11 @@ char *mnt_get_username(const uid_t uid)
{
struct passwd pwd;
struct passwd *res;
+#ifdef _SC_GETPW_R_SIZE_MAX
size_t sz = sysconf(_SC_GETPW_R_SIZE_MAX);
+#else
+ size_t sz = 0;
+#endif
char *buf, *username = NULL;
if (sz <= 0)