From 77173d35e90ac60aee419ebaf57022dbef2f524b Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 12 Aug 2005 22:28:17 +0000 Subject: [PATCH] Replace PW_GECOS/PASSWD macros --- build/openldap.m4 | 64 +----- configure | 302 ++++++++++++++++++----------- configure.in | 14 +- include/portable.hin | 12 +- libraries/liblutil/passwd.c | 8 +- libraries/librewrite/xmap.c | 4 +- servers/slapd/back-passwd/search.c | 4 +- 7 files changed, 221 insertions(+), 187 deletions(-) diff --git a/build/openldap.m4 b/build/openldap.m4 index 128e6bad05..f549252fd6 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -63,32 +63,6 @@ AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1 dnl AC_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1]) # end --with-$1 ])dnl -dnl -dnl ==================================================================== -dnl check if hard links are supported. -dnl -AC_DEFUN([OL_PROG_LN_H], [# test for ln hardlink support -AC_MSG_CHECKING(whether ln works) -AC_CACHE_VAL(ol_cv_prog_LN_H, -[rm -f conftest.src conftest.dst -echo "conftest" > conftest.src -if ln conftest.src conftest.dst 2>/dev/null -then - ol_cv_prog_LN_H="ln" -else - ol_cv_prog_LN_H="cp" -fi -rm -f conftest.src conftest.dst -])dnl -LN_H="$ol_cv_prog_LN_H" -if test "$ol_cv_prog_LN_H" = "ln"; then - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi -AC_SUBST(LN_H)dnl -])dnl -dnl dnl ==================================================================== dnl Check for dependency generation flag AC_DEFUN([OL_MKDEPEND], [# test for make depend flag @@ -188,32 +162,6 @@ ac_cv_header_stdc=disable ]) dnl dnl ==================================================================== -dnl Check if struct passwd has pw_gecos -AC_DEFUN([OL_STRUCT_PASSWD_PW_GECOS], [# test for pw_gecos in struct passwd -AC_CACHE_CHECK([struct passwd for pw_gecos],ol_cv_struct_passwd_pw_gecos,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - struct passwd pwd; - pwd.pw_gecos = pwd.pw_name; -]])],[ol_cv_struct_passwd_pw_gecos=yes],[ol_cv_struct_passwd_pw_gecos=no])]) -if test $ol_cv_struct_passwd_pw_gecos = yes ; then - AC_DEFINE(HAVE_PW_GECOS,1, [define if struct passwd has pw_gecos]) -fi -]) -dnl -dnl -------------------------------------------------------------------- -dnl Check if struct passwd has pw_passwd -AC_DEFUN([OL_STRUCT_PASSWD_PW_PASSWD], [# test for pw_passwd in struct passwd -AC_CACHE_CHECK([struct passwd for pw_passwd],ol_cv_struct_passwd_pw_passwd,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - struct passwd pwd; - pwd.pw_passwd = pwd.pw_name; -]])],[ol_cv_struct_passwd_pw_passwd=yes],[ol_cv_struct_passwd_pw_passwd=no])]) -if test $ol_cv_struct_passwd_pw_passwd = yes ; then - AC_DEFINE(HAVE_PW_PASSWD,1, [define if struct passwd has pw_passwd]) -fi -]) -dnl -dnl ==================================================================== dnl DNS resolver macros AC_DEFUN([OL_RESOLVER_TRY], [if test $ol_cv_lib_resolver = no ; then @@ -1316,8 +1264,10 @@ dnl ==================================================================== dnl check for msg_accrights in msghdr AC_DEFUN([OL_MSGHDR_MSG_ACCRIGHTS], [AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct msghdr m; m.msg_accrightslen=0]])],[ol_cv_msghdr_msg_accrights=yes],[ol_cv_msghdr_msg_accrights=no]) - ]) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[struct msghdr m; m.msg_accrightslen=0]])], + [ol_cv_msghdr_msg_accrights=yes], + [ol_cv_msghdr_msg_accrights=no])]) if test $ol_cv_msghdr_msg_accrights = "yes" ; then AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1, [define if struct msghdr has msg_accrights]) @@ -1327,8 +1277,10 @@ dnl ==================================================================== dnl check for cmsghdr AC_DEFUN([OL_MSGHDR_MSG_CONTROL], [AC_CACHE_CHECK(for msg_control in msghdr, ol_cv_msghdr_msg_control, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct msghdr m; m.msg_control=(struct cmsghdr *)0]])],[ol_cv_msghdr_msg_control=yes],[ol_cv_msghdr_msg_control=no]) - ]) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[struct msghdr m; m.msg_control=(struct cmsghdr *)0]])], + [ol_cv_msghdr_msg_control=yes], + [ol_cv_msghdr_msg_control=no])]) if test $ol_cv_msghdr_msg_control = "yes" ; then AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1, [define if struct msghdr has msg_control]) diff --git a/configure b/configure index ddcc604075..41de26283c 100755 --- a/configure +++ b/configure @@ -47483,7 +47483,6 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ol_cv_type_socklen_t+set}" = set; then @@ -47552,9 +47551,9 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 -if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then +echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 +echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6 +if test "${ol_cv_type_sig_atomic_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47563,13 +47562,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include int main () { -static struct stat ac_aggr; -if (ac_aggr.st_blksize) -return 0; +sig_atomic_t atomic; ; return 0; } @@ -47596,23 +47593,45 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_member_struct_stat_st_blksize=yes + ol_cv_type_sig_atomic_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF +ol_cv_type_sig_atomic_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ol_cv_type_sig_atomic_t" >&5 +echo "${ECHO_T}$ol_cv_type_sig_atomic_t" >&6 + if test $ol_cv_type_sig_atomic_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define sig_atomic_t int +_ACEOF + + fi + + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include +#include + int main () { -static struct stat ac_aggr; -if (sizeof ac_aggr.st_blksize) +if ((struct tm *) 0) return 0; ; return 0; @@ -47640,31 +47659,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_member_struct_stat_st_blksize=yes + ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_member_struct_stat_st_blksize=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 -if test $ac_cv_member_struct_stat_st_blksize = yes; then +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 _ACEOF - fi -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+set}" = set; then +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47674,14 +47690,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #include int main () { -if ((struct tm *) 0) -return 0; +struct tm *tp; tp->tm_sec; ; return 0; } @@ -47708,28 +47722,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_header_time=yes + ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no +ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 +#define TM_IN_SYS_TIME 1 _ACEOF fi -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 -if test "${ac_cv_struct_tm+set}" = set; then +echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 +if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47738,13 +47752,57 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_blksize) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_stat_st_blksize=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default int main () { -struct tm *tp; tp->tm_sec; +static struct stat ac_aggr; +if (sizeof ac_aggr.st_blksize) +return 0; ; return 0; } @@ -47771,28 +47829,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_struct_tm=time.h + ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tm=sys/time.h +ac_cv_member_struct_stat_st_blksize=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 -if test $ac_cv_struct_tm = sys/time.h; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 +if test $ac_cv_member_struct_stat_st_blksize = yes; then -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 _ACEOF + fi -echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 -echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6 -if test "${ol_cv_type_sig_atomic_t+set}" = set; then +echo "$as_me:$LINENO: checking for struct passwd.pw_gecos" >&5 +echo $ECHO_N "checking for struct passwd.pw_gecos... $ECHO_C" >&6 +if test "${ac_cv_member_struct_passwd_pw_gecos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47801,11 +47862,13 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +$ac_includes_default int main () { -sig_atomic_t atomic; +static struct passwd ac_aggr; +if (ac_aggr.pw_gecos) +return 0; ; return 0; } @@ -47832,48 +47895,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ol_cv_type_sig_atomic_t=yes + ac_cv_member_struct_passwd_pw_gecos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ol_cv_type_sig_atomic_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ol_cv_type_sig_atomic_t" >&5 -echo "${ECHO_T}$ol_cv_type_sig_atomic_t" >&6 - if test $ol_cv_type_sig_atomic_t = no; then - -cat >>confdefs.h <<\_ACEOF -#define sig_atomic_t int -_ACEOF - - fi - - - -# test for pw_gecos in struct passwd -echo "$as_me:$LINENO: checking struct passwd for pw_gecos" >&5 -echo $ECHO_N "checking struct passwd for pw_gecos... $ECHO_C" >&6 -if test "${ol_cv_struct_passwd_pw_gecos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +$ac_includes_default int main () { - - struct passwd pwd; - pwd.pw_gecos = pwd.pw_name; - +static struct passwd ac_aggr; +if (sizeof ac_aggr.pw_gecos) +return 0; ; return 0; } @@ -47900,46 +47939,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ol_cv_struct_passwd_pw_gecos=yes + ac_cv_member_struct_passwd_pw_gecos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ol_cv_struct_passwd_pw_gecos=no +ac_cv_member_struct_passwd_pw_gecos=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ol_cv_struct_passwd_pw_gecos" >&5 -echo "${ECHO_T}$ol_cv_struct_passwd_pw_gecos" >&6 -if test $ol_cv_struct_passwd_pw_gecos = yes ; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_passwd_pw_gecos" >&5 +echo "${ECHO_T}$ac_cv_member_struct_passwd_pw_gecos" >&6 +if test $ac_cv_member_struct_passwd_pw_gecos = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PW_GECOS 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PASSWD_PW_GECOS 1 _ACEOF + fi -# test for pw_passwd in struct passwd -echo "$as_me:$LINENO: checking struct passwd for pw_passwd" >&5 -echo $ECHO_N "checking struct passwd for pw_passwd... $ECHO_C" >&6 -if test "${ol_cv_struct_passwd_pw_passwd+set}" = set; then +echo "$as_me:$LINENO: checking for struct passwd.pw_passwd" >&5 +echo $ECHO_N "checking for struct passwd.pw_passwd... $ECHO_C" >&6 +if test "${ac_cv_member_struct_passwd_pw_passwd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +$ac_includes_default int main () { +static struct passwd ac_aggr; +if (ac_aggr.pw_passwd) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_passwd_pw_passwd=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - struct passwd pwd; - pwd.pw_passwd = pwd.pw_name; - +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static struct passwd ac_aggr; +if (sizeof ac_aggr.pw_passwd) +return 0; ; return 0; } @@ -47966,23 +48049,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ol_cv_struct_passwd_pw_passwd=yes + ac_cv_member_struct_passwd_pw_passwd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ol_cv_struct_passwd_pw_passwd=no +ac_cv_member_struct_passwd_pw_passwd=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ol_cv_struct_passwd_pw_passwd" >&5 -echo "${ECHO_T}$ol_cv_struct_passwd_pw_passwd" >&6 -if test $ol_cv_struct_passwd_pw_passwd = yes ; then +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_passwd_pw_passwd" >&5 +echo "${ECHO_T}$ac_cv_member_struct_passwd_pw_passwd" >&6 +if test $ac_cv_member_struct_passwd_pw_passwd = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PW_PASSWD 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PASSWD_PW_PASSWD 1 _ACEOF + fi @@ -51479,7 +51565,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ol_cv_msghdr_msg_accrights=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi echo "$as_me:$LINENO: result: $ol_cv_msghdr_msg_accrights" >&5 echo "${ECHO_T}$ol_cv_msghdr_msg_accrights" >&6 @@ -51542,7 +51627,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ol_cv_msghdr_msg_control=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi echo "$as_me:$LINENO: result: $ol_cv_msghdr_msg_control" >&5 echo "${ECHO_T}$ol_cv_msghdr_msg_control" >&6 diff --git a/configure.in b/configure.in index d716b848e8..4d187fbb40 100644 --- a/configure.in +++ b/configure.in @@ -2430,17 +2430,15 @@ AC_CHECK_TYPES([ptrdiff_t]) AC_TYPE_SIGNAL AC_TYPE_UID_T - +dnl AC_TYPE_GETGROUPS OL_TYPE_SOCKLEN_T -AC_CHECK_MEMBERS([struct stat.st_blksize]) -AC_HEADER_TIME -AC_STRUCT_TM OL_TYPE_SIG_ATOMIC_T -dnl AC_TYPE_GETGROUPS - -OL_STRUCT_PASSWD_PW_GECOS -OL_STRUCT_PASSWD_PW_PASSWD +AC_HEADER_TIME +AC_STRUCT_TM +AC_CHECK_MEMBERS([struct stat.st_blksize]) +AC_CHECK_MEMBERS([struct passwd.pw_gecos]) +AC_CHECK_MEMBERS([struct passwd.pw_passwd]) OL_C_UPPER_LOWER AC_C_CONST diff --git a/include/portable.hin b/include/portable.hin index a3145dee42..ffd76b92b0 100644 --- a/include/portable.hin +++ b/include/portable.hin @@ -496,12 +496,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H -/* define if struct passwd has pw_gecos */ -#undef HAVE_PW_GECOS - -/* define if struct passwd has pw_passwd */ -#undef HAVE_PW_PASSWD - /* Define to 1 if you have the `read' function. */ #undef HAVE_READ @@ -664,6 +658,12 @@ /* Define to 1 if you have the `strtouq' function. */ #undef HAVE_STRTOUQ +/* Define to 1 if `pw_gecos' is member of `struct passwd'. */ +#undef HAVE_STRUCT_PASSWD_PW_GECOS + +/* Define to 1 if `pw_passwd' is member of `struct passwd'. */ +#undef HAVE_STRUCT_PASSWD_PW_PASSWD + /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index 4d12404e66..940eafd88b 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -42,7 +42,7 @@ #ifdef SLAPD_CRYPT # include -# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) +# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD ) # ifdef HAVE_SHADOW_H # include # endif @@ -110,7 +110,7 @@ static LUTIL_PASSWD_HASH_FUNC hash_lanman; static LUTIL_PASSWD_CHK_FUNC chk_crypt; static LUTIL_PASSWD_HASH_FUNC hash_crypt; -#if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) +#if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD ) static LUTIL_PASSWD_CHK_FUNC chk_unix; #endif #endif @@ -140,7 +140,7 @@ static const struct pw_scheme pw_schemes_default[] = #ifdef SLAPD_CRYPT { BER_BVC("{CRYPT}"), chk_crypt, hash_crypt }, -# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) +# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD ) { BER_BVC("{UNIX}"), chk_unix, NULL }, # endif #endif @@ -810,7 +810,7 @@ static int chk_crypt( return lutil_cryptptr( cred->bv_val, passwd->bv_val, NULL ); } -# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) +# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD ) static int chk_unix( const struct berval *sc, const struct berval * passwd, diff --git a/libraries/librewrite/xmap.c b/libraries/librewrite/xmap.c index bc36edd044..b2ea0cfe08 100644 --- a/libraries/librewrite/xmap.c +++ b/libraries/librewrite/xmap.c @@ -263,7 +263,7 @@ rewrite_xmap_apply( break; } -#ifdef HAVE_PW_GECOS +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS if ( pwd->pw_gecos != NULL && pwd->pw_gecos[0] != '\0' ) { int l = strlen( pwd->pw_gecos ); @@ -279,7 +279,7 @@ rewrite_xmap_apply( } val->bv_len = l; } else -#endif /* HAVE_PW_GECOS */ +#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */ { val->bv_val = strdup( key->bv_val ); val->bv_len = key->bv_len; diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index e32e8b9b6d..76386d756b 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -312,7 +312,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL ); /* required by person */ attr_merge_normalize_one( e, ad_sn, &val, NULL ); /* required by person */ -#ifdef HAVE_PW_GECOS +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS /* * if gecos is present, add it as a cn. first process it * according to standard BSD usage. If the processed cn has @@ -352,7 +352,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e ) attr_merge_normalize_one( e, ad_sn, &val, NULL ); } } -#endif /* HAVE_PW_GECOS */ +#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */ return( 0 ); } -- 2.39.5