[Samba] NSS_BUFLEN_PASSWD on FreeBSD
Andrew Bartlett
abartlet at samba.org
Tue Jun 30 19:06:30 UTC 2020
On Tue, 2020-06-30 at 19:50 +0200, Peter Eriksson via samba wrote:
> Compilation fails on FreeBSD due to NSS_BUFLEN_PASSWD not being
> defined. This simple patch “fixes” that:
>
> --- samba-4.11.10/lib/util/util_paths.c.ORIG 2020-06-30
> 19:33:05.577758000 +0200
> +++ samba-4.11.10/lib/util/util_paths.c 2020-06-30 19:33:29.561225000
> +0200
> @@ -64,6 +64,10 @@
> return get_dyn_SHLIBEXT();
> }
>
> +#ifndef NSS_BUFLEN_PASSWD
> +#define NSS_BUFLEN_PASSWD 2048
> +#endif
> +
> static char *get_user_home_dir(TALLOC_CTX *mem_ctx)
> {
> struct passwd pwd = {0};
>
>
> One might wanna change the code to use a dynamically allocated ‘buf’
> and have a loop around getpwnam_r() that checks for ERANGE and retry
> with a bigger ‘buf’ though.
> (Same basically goes for all the get{pw,gr}xx_r() functions - not
> 100% important for getpw unless you have extremely long path’s or
> silly long full names but the getgrxx() calls might need it for
> groups with huge membership lists…)
See https://bugzilla.samba.org/show_bug.cgi?id=14415
Andrew Bartlett
--
Andrew Bartlett https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Developer, Catalyst IT
https://catalyst.net.nz/services/samba
More information about the samba
mailing list