KRB_LIBS = @KRB4_LIBS@ @KRB5_LIBS@
SASL_LIBS = @SASL_LIBS@
TLS_LIBS = @TLS_LIBS@
-SECURITY_LIBS = @SASL_LIBS@ $(KRB_LIBS) @TLS_LIBS@
+AUTH_LIBS = @AUTH_LIBS@
+SECURITY_LIBS = $(SASL_LIBS) $(KRB_LIBS) $(TLS_LIBS) $(AUTH_LIBS)
MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
TERMCAP_LIBS=
TLS_LIBS=
MODULES_LIBS=
+AUTH_LIBS=
dnl ================================================================
dnl Checks for programs
AC_MSG_WARN([do not know how to generate dependencies])
fi
+dnl ----------------------------------------------------------------
+dnl Check for AIX security library
+AC_CHECK_LIB(s, afopen, [
+ AUTH_LIBS=-ls
+ AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
+])
+
dnl ----------------------------------------------------------------
dnl Check for module support
ol_link_modules=no
AC_SUBST(TERMCAP_LIBS)
AC_SUBST(TLS_LIBS)
AC_SUBST(MODULES_LIBS)
+AC_SUBST(AUTH_LIBS)
AC_SUBST(SLAPD_SQL_LDFLAGS)
AC_SUBST(SLAPD_SQL_LIBS)
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
+#ifdef HAVE_AIX_SECURITY
+# include <userpw.h>
+#endif
#include <lber.h>
#ifdef SLAPD_CRYPT
{ {sizeof("{CRYPT}")-1, "{CRYPT}"}, chk_crypt, hash_crypt },
-# if defined( HAVE_GETSPNAM ) \
- || ( defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) )
+#endif
+# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
{ {sizeof("{UNIX}")-1, "{UNIX}"}, chk_unix, NULL },
# endif
#endif
return strcmp( passwd->bv_val, cr ) ? 1 : 0;
}
-# if defined( HAVE_GETSPNAM ) \
- || ( defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD ) )
+# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
static int chk_unix(
const struct pw_scheme *sc,
const struct berval * passwd,
return -1; /* passwd must behave like a string */
}
-# ifdef HAVE_GETSPNAM
{
- struct spwd *spwd = getspnam(passwd->bv_val);
+ struct passwd *pwd = getpwnam(passwd->bv_val);
- if(spwd == NULL) {
+ if(pwd == NULL) {
return -1; /* not found */
}
- pw = spwd->sp_pwdp;
+ pw = pwd->pw_passwd;
}
-
-# else
+# ifdef HAVE_GETSPNAM
{
- struct passwd *pwd = getpwnam(passwd->bv_val);
+ struct spwd *spwd = getspnam(passwd->bv_val);
- if(pwd == NULL) {
- return -1; /* not found */
+ if(spwd != NULL) {
+ pw = spwd->sp_pwdp;
}
+ }
+# endif
+# ifdef HAVE_AIX_SECURITY
+ {
+ struct userpw *upw = getuserpw(passwd->bv_val);
- pw = pwd->pw_passwd;
+ if (upw != NULL) {
+ pw = upw->upw_passwd;
+ }
}
# endif