mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
Fix for Solaris nscd issue pointed out by Mike Gerdts
<Michael.Gerdts@alcatel.com>. The struct passwd in Solaris contains some extra fields which must be initialised otherwise nscd crashes. (This used to be commit a67323d07177ebc8e46dc14476efaf7e95944504)
This commit is contained in:
parent
6d893c61cd
commit
fc26f277ca
@ -189,6 +189,8 @@
|
||||
#undef STAT_ST_BLOCKSIZE
|
||||
#undef HAVE_DEVICE_MAJOR_FN
|
||||
#undef HAVE_DEVICE_MINOR_FN
|
||||
#undef HAVE_PASSWD_PW_COMMENT
|
||||
#undef HAVE_PASSWD_PW_AGE
|
||||
/*
|
||||
* Add these definitions to allow VFS modules to
|
||||
* see the CPPFLAGS defines.
|
||||
|
@ -2813,6 +2813,33 @@ AC_SUBST(WINBIND_PAM_TARGETS)
|
||||
AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
|
||||
AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
|
||||
|
||||
# Solaris has some extra fields in struct passwd that need to be
|
||||
# initialised otherwise nscd crashes. Unfortunately autoconf < 2.50
|
||||
# doesn't have the AC_CHECK_MEMBER macro which would be handy for checking
|
||||
# this.
|
||||
|
||||
#AC_CHECK_MEMBER(struct passwd.pw_comment,
|
||||
# AC_DEFINE(HAVE_PASSWD_PW_COMMENT, 1, [Defined if struct passwd has pw_comment field]),
|
||||
# [#include <pwd.h>])
|
||||
|
||||
AC_CACHE_CHECK([whether struct passwd has pw_comment],samba_cv_passwd_pw_comment, [
|
||||
AC_TRY_COMPILE([#include <pwd.h>],[struct passwd p; p.pw_comment;],
|
||||
samba_cv_passwd_pw_comment=yes,samba_cv_passwd_pw_comment=no)])
|
||||
if test x"$samba_cv_passwd_pw_comment" = x"yes"; then
|
||||
AC_DEFINE(HAVE_PASSWD_PW_COMMENT)
|
||||
fi
|
||||
|
||||
#AC_CHECK_MEMBER(struct passwd.pw_age,
|
||||
# AC_DEFINE(HAVE_PASSWD_PW_AGE, 1, [Defined if struct passwd has pw_age field]),
|
||||
# [#include <pwd.h>])
|
||||
|
||||
AC_CACHE_CHECK([whether struct passwd has pw_age],samba_cv_passwd_pw_age, [
|
||||
AC_TRY_COMPILE([#include <pwd.h>],[struct passwd p; p.pw_age;],
|
||||
samba_cv_passwd_pw_age=yes,samba_cv_passwd_pw_age=no)])
|
||||
if test x"$samba_cv_passwd_pw_age" = x"yes"; then
|
||||
AC_DEFINE(HAVE_PASSWD_PW_AGE)
|
||||
fi
|
||||
|
||||
#################################################
|
||||
# Check to see if we should use the included popt
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@ -255,6 +255,8 @@
|
||||
#undef STAT_ST_BLOCKSIZE
|
||||
#undef HAVE_DEVICE_MAJOR_FN
|
||||
#undef HAVE_DEVICE_MINOR_FN
|
||||
#undef HAVE_PASSWD_PW_COMMENT
|
||||
#undef HAVE_PASSWD_PW_AGE
|
||||
/*
|
||||
* Add these definitions to allow VFS modules to
|
||||
* see the CPPFLAGS defines.
|
||||
|
@ -659,6 +659,17 @@ static NSS_STATUS fill_pwent(struct passwd *result,
|
||||
|
||||
strcpy(result->pw_shell, pw->pw_shell);
|
||||
|
||||
/* The struct passwd for Solaris has some extra fields which must
|
||||
be initialised or nscd crashes. */
|
||||
|
||||
#if HAVE_PASSWD_PW_COMMENT
|
||||
result->pw_comment = "";
|
||||
#endif
|
||||
|
||||
#if HAVE_PASSWD_PW_AGE
|
||||
result->pw_age = "";
|
||||
#endif
|
||||
|
||||
return NSS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user