summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorKarel Zak2015-12-15 12:25:56 +0100
committerKarel Zak2015-12-15 12:33:34 +0100
commitf7ac9e71b18fa7314151f2ab65ee0bdd2ea89c07 (patch)
treed089c7b2317441444ab356d17fb200286aa0a550 /include/c.h
parentMerge branch 'test-fixes' of https://github.com/rudimeier/util-linux (diff)
downloadkernel-qcow2-util-linux-f7ac9e71b18fa7314151f2ab65ee0bdd2ea89c07.tar.gz
kernel-qcow2-util-linux-f7ac9e71b18fa7314151f2ab65ee0bdd2ea89c07.tar.xz
kernel-qcow2-util-linux-f7ac9e71b18fa7314151f2ab65ee0bdd2ea89c07.zip
login, mount: fix __SC_GETPW_R_SIZE_MAX usage
sysconf(_SC_GETPW_R_SIZE_MAX) returns initial suggested size for pwd buffer (see getpwnam_r man page or POSIX). This is not large enough in some cases. Yes, this sysconf option is misnamed (should be _SC_GETPW_R_SIZE_MIN). Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index 2a317eb52..ca028baee 100644
--- a/include/c.h
+++ b/include/c.h
@@ -346,4 +346,13 @@ static inline int xusleep(useconds_t usec)
# define UL_ASAN_BLACKLIST /* nothing */
#endif
+
+
+/*
+ * Note that sysconf(_SC_GETPW_R_SIZE_MAX) returns *initial* suggested size for
+ * pwd buffer and in some cases it is not large enough. See POSIX and
+ * getpwnam_r man page for more details.
+ */
+#define UL_GETPW_BUFSIZ (16 * 1024)
+
#endif /* UTIL_LINUX_C_H */