util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD
authorMartin Schwenke <martin@meltin.net>
Fri, 5 Jun 2020 11:52:23 +0000 (21:52 +1000)
committerKarolin Seeger <kseeger@samba.org>
Mon, 6 Jul 2020 13:57:23 +0000 (13:57 +0000)
commit581b581700c967d38bcbb8d81767a7dfdfe68147
treef1aa342b616d2be07f19978fb531aa8f0eab386b
parentcf319e099c1dc6683864486bd86b44750b0e0b3e
util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD

NSS_BUFLEN_PASSWD is not defined on FreeBSD.  Use
sysconf(_SC_GETPW_R_SIZE_MAX) instead, as per POSIX.

Use a dynamically allocated buffer instead of trying to cram all of
the logic into the declarations.  This will come in useful later
anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Bjoern Jacke <bjacke@samba.org>
(cherry picked from commit 847208cd8ac68c4c7d1dae63767820db1c69292b)
lib/util/util_paths.c