From 70f372b8ceae7da7c703d43743f2f4325ca36481 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 20 Sep 2000 21:31:48 +0000 Subject: [PATCH] Imported from devel + Fixed clients printf/usage bugs (ITS#749) + Fixed slapd spasswd support (ITS#751) + Fixed --enable-spasswd (ITS#751) + Fixed ldif(5) file:/// bug (ITS#750) --- CHANGES | 8 +- clients/tools/ldapdelete.c | 2 +- clients/tools/ldapmodify.c | 2 +- clients/tools/ldapmodrdn.c | 2 +- clients/tools/ldappasswd.c | 2 +- clients/tools/ldapsearch.c | 2 +- configure | 280 +++++++++++++++++---------------- configure.in | 6 +- doc/man/man5/ldif.5 | 2 +- libraries/libldbm/ldbm.c | 2 +- servers/slapd/back-ldbm/bind.c | 6 +- servers/slapd/backend.c | 19 ++- servers/slapd/daemon.c | 23 ++- servers/slapd/init.c | 8 +- servers/slapd/passwd.c | 39 +++-- servers/slapd/proto-slap.h | 8 +- servers/slapd/sasl.c | 7 - 17 files changed, 220 insertions(+), 198 deletions(-) diff --git a/CHANGES b/CHANGES index feafd9375f..b633b7a579 100644 --- a/CHANGES +++ b/CHANGES @@ -1,14 +1,18 @@ OpenLDAP 2.0 Change Log OpenLDAP 2.0.x Engineering - Fixed clients printf bugs + Fixed clients printf/usage bugs (ITS#749) Fixed -lldap SASL interoperability bug Fixed -lldap PF_LOCAL declaration/call bugs + Fixed slapd spasswd support (ITS#751) Updated slurpd SASL support Added slurpd TLS support Removed lint + Build Environment + Fixed --enable-spasswd (ITS#751) Documentation - updated ldap_schema(3) + Fixed ldif(5) file:/// bug (ITS#750) + Updated ldap_schema(3) OpenLDAP 2.0.3 Release Fixed -lldap KBIND typo (ITS#717) diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 0c8673723c..660ba44c28 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -458,7 +458,7 @@ main( int argc, char **argv ) #endif break; default: - fprintf( stderr, "%s: unrecongized option -%c\n", + fprintf( stderr, "%s: unrecognized option -%c\n", prog, optopt ); usage( prog ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index e1629c55f0..59f2ce0911 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -518,7 +518,7 @@ main( int argc, char **argv ) #endif break; default: - fprintf( stderr, "%s: unrecongized option -%c\n", + fprintf( stderr, "%s: unrecognized option -%c\n", prog, optopt ); usage( prog ); } diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index a90a3d3e18..fe225d9af4 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -480,7 +480,7 @@ main(int argc, char **argv) #endif break; default: - fprintf( stderr, "%s: unrecongized option -%c\n", + fprintf( stderr, "%s: unrecognized option -%c\n", prog, optopt ); usage( argv[0] ); return( EXIT_FAILURE ); diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 365db634e8..2c9f5e868a 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -481,7 +481,7 @@ main( int argc, char *argv[] ) default: - fprintf( stderr, "%s: unrecongized option -%c\n", + fprintf( stderr, "%s: unrecognized option -%c\n", prog, optopt ); usage (argv[0]); } diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index b07fedbc95..0b31d500cf 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -586,7 +586,7 @@ main( int argc, char **argv ) #endif break; default: - fprintf( stderr, "%s: unrecongized option -%c\n", + fprintf( stderr, "%s: unrecognized option -%c\n", prog, optopt ); usage( argv[0] ); } diff --git a/configure b/configure index c8b4ad89e5..8562d44ca2 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # $OpenLDAP$ -# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.15 2000/09/13 00:42:32 kurt Exp +# from OpenLDAP # Copyright 1998-2000 The OpenLDAP Foundation. All Rights Reserved. # @@ -2273,7 +2273,7 @@ if test $ol_enable_spasswd = yes ; then if test $ol_with_cyrus_sasl = no ; then { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; } fi - ol_link_spasswd=yes + ol_with_cyrus_sasl=yes fi echo "$ac_t""done" 1>&6 @@ -13277,7 +13277,11 @@ EOF echo "configure: warning: Strong authentication not supported!" 1>&2 fi fi + + elif test $ol_enable_spasswd != no ; then + ol_link_spasswd=yes fi + else echo "configure: warning: SASL authentication not supported!" 1>&2 if test $ol_link_tls = no ; then @@ -13312,13 +13316,13 @@ if test $ol_with_fetch != no ; then ol_LIBS=$LIBS LIBS="-lfetch -lcom_err $LIBS" echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6 -echo "configure:13316: checking fetch(3) library" >&5 +echo "configure:13320: checking fetch(3) library" >&5 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -13328,7 +13332,7 @@ int main() { struct url *u = fetchParseURL("file:///"); ; return 0; } EOF -if { (eval echo configure:13332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_lib_fetch=yes else @@ -13366,17 +13370,17 @@ if test $ol_with_readline != no ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13370: checking for $ac_hdr" >&5 +echo "configure:13374: checking for $ac_hdr" >&5 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13407,7 +13411,7 @@ done save_LIBS="$LIBS" LIBS="$TERMCAP_LIBS $LIBS" echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:13411: checking for readline in -lreadline" >&5 +echo "configure:13415: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13415,7 +13419,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13468,12 +13472,12 @@ fi if test $ol_enable_crypt != no ; then echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:13472: checking for crypt" >&5 +echo "configure:13476: checking for crypt" >&5 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -13516,7 +13520,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:13520: checking for crypt in -lcrypt" >&5 +echo "configure:13524: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13524,7 +13528,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13578,12 +13582,12 @@ fi if test $ol_enable_proctitle != no ; then echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 -echo "configure:13582: checking for setproctitle" >&5 +echo "configure:13586: checking for setproctitle" >&5 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_setproctitle=yes" else @@ -13626,7 +13630,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:13630: checking for setproctitle in -lutil" >&5 +echo "configure:13634: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13634,7 +13638,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13681,12 +13685,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:13685: checking for ANSI C header files" >&5 +echo "configure:13689: checking for ANSI C header files" >&5 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -13694,7 +13698,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13711,7 +13715,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -13729,7 +13733,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -13750,7 +13754,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #if ((' ' & 0x0FF) == 0x020) @@ -13768,7 +13772,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:13772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:13776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -13792,12 +13796,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:13796: checking for mode_t" >&5 +echo "configure:13800: checking for mode_t" >&5 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -13828,12 +13832,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:13832: checking for off_t" >&5 +echo "configure:13836: checking for off_t" >&5 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -13864,12 +13868,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:13868: checking for pid_t" >&5 +echo "configure:13872: checking for pid_t" >&5 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -13900,19 +13904,19 @@ EOF fi echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:13904: checking for ptrdiff_t" >&5 +echo "configure:13908: checking for ptrdiff_t" >&5 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { ptrdiff_t p ; return 0; } EOF -if { (eval echo configure:13916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_type_ptrdiff_t=yes else @@ -13933,12 +13937,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:13937: checking return type of signal handlers" >&5 +echo "configure:13941: checking return type of signal handlers" >&5 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -13955,7 +13959,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:13959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -13974,12 +13978,12 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:13978: checking for size_t" >&5 +echo "configure:13982: checking for size_t" >&5 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -14011,12 +14015,12 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:14015: checking for ssize_t" >&5 +echo "configure:14019: checking for ssize_t" >&5 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -14047,12 +14051,12 @@ EOF fi echo $ac_n "checking for caddr_t""... $ac_c" 1>&6 -echo "configure:14051: checking for caddr_t" >&5 +echo "configure:14055: checking for caddr_t" >&5 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -14084,12 +14088,12 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:14088: checking for socklen_t" >&5 +echo "configure:14092: checking for socklen_t" >&5 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_type_socklen_t=yes else @@ -14124,12 +14128,12 @@ EOF fi echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6 -echo "configure:14128: checking for member st_blksize in aggregate type struct stat" >&5 +echo "configure:14132: checking for member st_blksize in aggregate type struct stat" >&5 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -14137,7 +14141,7 @@ int main() { struct stat foo; foo.st_blksize; ; return 0; } EOF -if { (eval echo configure:14141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_struct_member_st_blksize=yes else @@ -14159,12 +14163,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:14163: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:14167: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"\${ac_cv_header_time+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -14173,7 +14177,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:14177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -14194,12 +14198,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:14198: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:14202: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -14207,7 +14211,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:14211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -14228,12 +14232,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:14232: checking for uid_t in sys/types.h" >&5 +echo "configure:14236: checking for uid_t in sys/types.h" >&5 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -14262,19 +14266,19 @@ EOF fi echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6 -echo "configure:14266: checking for sig_atomic_t" >&5 +echo "configure:14270: checking for sig_atomic_t" >&5 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { sig_atomic_t atomic; ; return 0; } EOF -if { (eval echo configure:14278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_type_sig_atomic_t=yes else @@ -14298,13 +14302,13 @@ EOF # test for pw_gecos in struct passwd echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6 -echo "configure:14302: checking struct passwd for pw_gecos" >&5 +echo "configure:14306: checking struct passwd for pw_gecos" >&5 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -14314,7 +14318,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_struct_passwd_pw_gecos=yes else @@ -14336,13 +14340,13 @@ fi # test for pw_passwd in struct passwd echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6 -echo "configure:14340: checking struct passwd for pw_passwd" >&5 +echo "configure:14344: checking struct passwd for pw_passwd" >&5 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -14352,7 +14356,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:14356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_struct_passwd_pw_passwd=yes else @@ -14374,7 +14378,7 @@ fi echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 -echo "configure:14378: checking if toupper() requires islower()" >&5 +echo "configure:14382: checking if toupper() requires islower()" >&5 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14383,7 +14387,7 @@ else ol_cv_c_upper_lower=safe else cat > conftest.$ac_ext < @@ -14395,7 +14399,7 @@ main() exit(1); } EOF -if { (eval echo configure:14399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ol_cv_c_upper_lower=no else @@ -14418,12 +14422,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:14422: checking for working const" >&5 +echo "configure:14426: checking for working const" >&5 if eval "test \"\${ac_cv_c_const+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -14493,12 +14497,12 @@ EOF fi echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6 -echo "configure:14497: checking if compiler understands volatile" >&5 +echo "configure:14501: checking if compiler understands volatile" >&5 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_c_volatile=yes else @@ -14537,14 +14541,14 @@ EOF else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:14541: checking whether byte ordering is bigendian" >&5 +echo "configure:14545: checking whether byte ordering is bigendian" >&5 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -14555,11 +14559,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:14559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -14570,7 +14574,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:14574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -14590,7 +14594,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -14629,13 +14633,13 @@ fi fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:14633: checking size of short" >&5 +echo "configure:14637: checking size of short" >&5 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -14645,7 +14649,7 @@ int main() { switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:14649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else @@ -14668,13 +14672,13 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:14672: checking size of int" >&5 +echo "configure:14676: checking size of int" >&5 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -14684,7 +14688,7 @@ int main() { switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:14688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else @@ -14707,13 +14711,13 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:14711: checking size of long" >&5 +echo "configure:14715: checking size of long" >&5 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < @@ -14723,7 +14727,7 @@ int main() { switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF -if { (eval echo configure:14727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else @@ -14774,7 +14778,7 @@ EOF echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:14778: checking for 8-bit clean memcmp" >&5 +echo "configure:14782: checking for 8-bit clean memcmp" >&5 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14782,7 +14786,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:14800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -14810,12 +14814,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:14814: checking for strftime" >&5 +echo "configure:14818: checking for strftime" >&5 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -14861,7 +14865,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:14865: checking for strftime in -lintl" >&5 +echo "configure:14869: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'` if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14869,7 +14873,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14908,12 +14912,12 @@ fi echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6 -echo "configure:14912: checking for inet_aton()" >&5 +echo "configure:14916: checking for inet_aton()" >&5 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_func_inet_aton=yes else @@ -14957,12 +14961,12 @@ EOF echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6 -echo "configure:14961: checking for _spawnlp" >&5 +echo "configure:14965: checking for _spawnlp" >&5 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__spawnlp=yes" else @@ -15010,12 +15014,12 @@ fi echo $ac_n "checking for _snprintf""... $ac_c" 1>&6 -echo "configure:15014: checking for _snprintf" >&5 +echo "configure:15018: checking for _snprintf" >&5 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__snprintf=yes" else @@ -15065,12 +15069,12 @@ fi echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6 -echo "configure:15069: checking for _vsnprintf" >&5 +echo "configure:15073: checking for _vsnprintf" >&5 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__vsnprintf=yes" else @@ -15120,12 +15124,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:15124: checking for vprintf" >&5 +echo "configure:15128: checking for vprintf" >&5 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -15173,12 +15177,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:15177: checking for _doprnt" >&5 +echo "configure:15181: checking for _doprnt" >&5 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -15231,12 +15235,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in vsnprintf vsprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15235: checking for $ac_func" >&5 +echo "configure:15239: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15339,12 +15343,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15343: checking for $ac_func" >&5 +echo "configure:15347: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15396,12 +15400,12 @@ done for ac_func in getopt tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15400: checking for $ac_func" >&5 +echo "configure:15404: checking for $ac_func" >&5 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15462,13 +15466,13 @@ fi # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:15466: checking declaration of sys_errlist" >&5 +echo "configure:15470: checking declaration of sys_errlist" >&5 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -15481,7 +15485,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:15485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes ol_cv_have_sys_errlist=yes @@ -15504,20 +15508,20 @@ EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:15508: checking existence of sys_errlist" >&5 +echo "configure:15512: checking existence of sys_errlist" >&5 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:15521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index ea6d5159c6..dc687f2f4a 100644 --- a/configure.in +++ b/configure.in @@ -350,7 +350,7 @@ if test $ol_enable_spasswd = yes ; then if test $ol_with_cyrus_sasl = no ; then AC_MSG_ERROR([options require --with-cyrus-sasl]) fi - ol_link_spasswd=yes + ol_with_cyrus_sasl=yes fi AC_MSG_RESULT(done) @@ -1794,7 +1794,11 @@ if test $ol_with_cyrus_sasl != no ; then AC_MSG_WARN([Strong authentication not supported!]) fi fi + + elif test $ol_enable_spasswd != no ; then + ol_link_spasswd=yes fi + else AC_MSG_WARN([SASL authentication not supported!]) if test $ol_link_tls = no ; then diff --git a/doc/man/man5/ldif.5 b/doc/man/man5/ldif.5 index c53df77cb6..62f63174a9 100644 --- a/doc/man/man5/ldif.5 +++ b/doc/man/man5/ldif.5 @@ -66,7 +66,7 @@ in the file /tmp/value would be listed like this: .LP .nf .ft tt - cn:< file://tmp/value + cn:< file:///tmp/value .ft .fi Other URI schemes (ftp,http) may be supported as well. diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index bf8f20266f..c9a829df6d 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -94,7 +94,7 @@ static void ldbm_db_errcall( const char *prefix, char *message ) { #ifdef LDAP_SYSLOG - syslog( LOG_INFO, "ldbm_db_errcall(): %s %s", prefix, message ); + syslog( LOG_INFO, "ldbm: %s %s", prefix, message ); #endif } diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 73dddc18bb..08c0d64baa 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -68,7 +68,7 @@ ldbm_back_bind( /* allow noauth binds */ rc = 1; if ( method == LDAP_AUTH_SIMPLE ) { - if ( be_isroot_pw( be, dn, cred ) ) { + if ( be_isroot_pw( be, conn, dn, cred ) ) { *edn = ch_strdup( be_root_dn( be ) ); rc = 0; /* front end will send result */ @@ -139,7 +139,7 @@ ldbm_back_bind( switch ( method ) { case LDAP_AUTH_SIMPLE: /* check for root dn/passwd */ - if ( be_isroot_pw( be, dn, cred ) ) { + if ( be_isroot_pw( be, conn, dn, cred ) ) { /* front end will send result */ if(*edn != NULL) free( *edn ); *edn = ch_strdup( be_root_dn( be ) ); @@ -165,7 +165,7 @@ ldbm_back_bind( goto return_results; } - if ( slap_passwd_check( a, cred ) != 0 ) { + if ( slap_passwd_check( conn, a, cred ) != 0 ) { send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS, NULL, NULL, NULL, NULL ); /* stop front end from sending result */ diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 309f26c2ad..20856cf7a1 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -498,7 +498,10 @@ be_root_dn( Backend *be ) } int -be_isroot_pw( Backend *be, const char *ndn, struct berval *cred ) +be_isroot_pw( Backend *be, + Connection *conn, + const char *ndn, + struct berval *cred ) { int result; @@ -510,14 +513,20 @@ be_isroot_pw( Backend *be, const char *ndn, struct berval *cred ) return 0; } -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_lock( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) + ldap_pvt_thread_mutex_lock( &passwd_mutex ); +#ifdef SLAPD_SPASSWD + lutil_passwd_sasl_conn = conn->c_sasl_context; +#endif #endif result = lutil_passwd( &be->be_root_pw, cred, NULL ); -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_unlock( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) +#ifdef SLAPD_SPASSWD + lutil_passwd_sasl_conn = NULL; +#endif + ldap_pvt_thread_mutex_unlock( &passwd_mutex ); #endif return result == 0; diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 997a1ea1bb..bca5aed17b 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -870,11 +870,21 @@ slapd_daemon_task( continue; } +#ifndef HAVE_WINSOCK + /* make sure descriptor number isn't too great */ + if ( s >= dtblsize ) { + Debug( LDAP_DEBUG_ANY, + "daemon: %ld beyond descriptor table size %ld\n", + (long) s, (long) dtblsize, 0 ); + slapd_close(s); + continue; + } +#endif + #ifdef LDAP_DEBUG ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex ); /* newly accepted stream should not be in any of the FD SETS */ - assert( !FD_ISSET( s, &slap_daemon.sd_actives) ); assert( !FD_ISSET( s, &slap_daemon.sd_readers) ); assert( !FD_ISSET( s, &slap_daemon.sd_writers) ); @@ -882,17 +892,6 @@ slapd_daemon_task( ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex ); #endif -#ifndef HAVE_WINSOCK - /* make sure descriptor number isn't too great */ - if ( s >= dtblsize ) { - Debug( LDAP_DEBUG_ANY, - "daemon: %ld beyond descriptor table size %ld\n", - (long) s, (long) dtblsize, 0 ); - slapd_close(s); - continue; - } -#endif - Debug( LDAP_DEBUG_CONNS, "daemon: new connection on %ld\n", (long) s, 0, 0 ); diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 5c41461dff..69f64d4b7a 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -40,8 +40,8 @@ char **g_argv; */ ldap_pvt_thread_pool_t connection_pool; ldap_pvt_thread_mutex_t gmtime_mutex; -#ifdef SLAPD_CRYPT -ldap_pvt_thread_mutex_t crypt_mutex; +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) +ldap_pvt_thread_mutex_t passwd_mutex; #endif int num_conns; @@ -103,8 +103,8 @@ slap_init( int mode, const char *name ) ldap_pvt_thread_mutex_init( &num_sent_mutex ); ldap_pvt_thread_mutex_init( &gmtime_mutex ); -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_init( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) + ldap_pvt_thread_mutex_init( &passwd_mutex ); #endif rc = slap_sasl_init(); diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 547fb44c22..381fb088fd 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -217,28 +217,35 @@ struct berval * slap_passwd_return( int slap_passwd_check( + Connection *conn, Attribute *a, struct berval *cred ) { int i; - for ( i = 0; a->a_vals[i] != NULL; i++ ) { - int result; + int result = 1; -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_lock( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) + ldap_pvt_thread_mutex_lock( &passwd_mutex ); +#ifdef SLAPD_SPASSWD + lutil_passwd_sasl_conn = conn->c_sasl_context; #endif - - result = lutil_passwd( a->a_vals[i], cred, NULL ); - -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_unlock( &crypt_mutex ); #endif - if( !result ) - return result; + for ( i = 0; a->a_vals[i] != NULL; i++ ) { + if( !lutil_passwd( a->a_vals[i], cred, NULL ) ) { + result = 0; + break; + } } - return( 1 ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) +#ifdef SLAPD_SPASSWD + lutil_passwd_sasl_conn = NULL; +#endif + ldap_pvt_thread_mutex_unlock( &passwd_mutex ); +#endif + + return result; } struct berval * slap_passwd_generate( void ) @@ -259,14 +266,14 @@ struct berval * slap_passwd_hash( struct berval *new; -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_lock( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) + ldap_pvt_thread_mutex_lock( &passwd_mutex ); #endif new = lutil_passwd_hash( cred , hash ); -#ifdef SLAPD_CRYPT - ldap_pvt_thread_mutex_unlock( &crypt_mutex ); +#if defined( SLAPD_CRYPT ) || defined( SLAPD_PASSWD ) + ldap_pvt_thread_mutex_unlock( &passwd_mutex ); #endif return new; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index f2ab73e626..c0abb14115 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -151,7 +151,8 @@ LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P(( const char * dn )); LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be, const char *suffix )); LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn )); -LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be, const char *ndn, struct berval *cred )); +LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be, + Connection *conn, const char *ndn, struct berval *cred )); LDAP_SLAPD_F (char *) be_root_dn LDAP_P(( Backend *be )); LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw )); #define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 ) @@ -727,6 +728,7 @@ LDAP_SLAPD_F (int) passwd_extop LDAP_P(( struct berval *** refs )); LDAP_SLAPD_F (int) slap_passwd_check( + Connection *conn, Attribute *attr, struct berval *cred ); @@ -803,8 +805,8 @@ LDAP_SLAPD_F (ldap_pvt_thread_pool_t) connection_pool; LDAP_SLAPD_F (ldap_pvt_thread_mutex_t) entry2str_mutex; LDAP_SLAPD_F (ldap_pvt_thread_mutex_t) replog_mutex; -#ifdef SLAPD_CRYPT -LDAP_SLAPD_F (ldap_pvt_thread_mutex_t) crypt_mutex; +#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD ) +LDAP_SLAPD_F (ldap_pvt_thread_mutex_t) passwd_mutex; #endif LDAP_SLAPD_F (ldap_pvt_thread_mutex_t) gmtime_mutex; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index f776f7d44d..3a37c5d8ca 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -203,11 +203,7 @@ int slap_sasl_init( void ) sasl_secprops.maxbufsize = 65536; sasl_secprops.security_flags = SASL_SEC_NOPLAINTEXT|SASL_SEC_NOANONYMOUS; -#ifdef SLAPD_SPASSWD - lutil_passwd_sasl_conn = server; -#else sasl_dispose( &server ); -#endif #endif return 0; @@ -216,9 +212,6 @@ int slap_sasl_init( void ) int slap_sasl_destroy( void ) { #ifdef HAVE_CYRUS_SASL -#ifdef SLAPD_SPASSWD - sasl_dispose( &lutil_passwd_sasl_conn ); -#endif sasl_done(); #endif return 0; -- 2.39.5