logger_test_SOURCES = logger_test.c
logger_test_LDADD = $(top_builddir)/libatalk/libatalk.la
-if HAVE_ACLS
bin_PROGRAMS += afpldaptest
afpldaptest_SOURCES = uuidtest.c
afpldaptest_CFLAGS = -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\"
afpldaptest_LDADD = $(top_builddir)/libatalk/libatalk.la
-endif
+
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_ACLS
-
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-#include <ldap.h>
#include <atalk/ldapconfig.h>
#include <atalk/uuid.h>
static int inited = 0;
if (! inited) {
+#ifdef HAVE_LDAP
/* Parse afp_ldap.conf */
printf("Start parsing afp_ldap.conf\n");
acl_ldap_readconfig(_PATH_ACL_LDAPCONF);
} else {
printf("afp_ldap.conf is not ok, not using LDAP. Only local UUID testing available.\n");
}
+#else
+ printf("Built without LDAP support, only local UUID testing available.\n");
+#endif
inited = 1;
}
}
return 0;
}
-#endif /* HAVE_ACLS */
*)
with_ldap=auto
;;
- esac ],
- [with_ldap=auto])
+ esac ])
AC_MSG_RESULT($with_ldap)
-if test x"$with_ldap" = x"no"; then
- AC_MSG_RESULT(Disabling LDAP support)
-else
- with_ldap=yes
- AC_MSG_NOTICE([Checking for LDAP header and library])
- AC_CHECK_HEADER([ldap.h],,
- [AC_MSG_ERROR([LDAP client headers not found.])
- with_ldap=no])
- AC_CHECK_LIB(ldap, ldap_init,,
- [AC_MSG_ERROR([LDAP client libs not found.])
- with_ldap=no])
+
+if test x"$with_ldap" != x"no" ; then
+ AC_CHECK_HEADER([ldap.h], with_ldap=yes,
+ [ if test x"$with_ldap" = x"yes" ; then
+ AC_MSG_ERROR([Missing LDAP headers])
+ fi
+ with_ldap=no
+ ])
+ AC_CHECK_LIB(ldap, ldap_init, with_ldap=yes,
+ [ if test x"$with_ldap" = x"yes" ; then
+ AC_MSG_ERROR([Missing LDAP library])
+ fi
+ with_ldap=no
+ ])
fi
+
if test x"$with_ldap" = x"yes"; then
AC_DEFINE(HAVE_LDAP,1,[Whether LDAP is available])
fi
return 0;
}
+#ifdef HAVE_LDAP
ret = ldap_getnamefromuuid(uuid_bin2string(uuidp), name, type);
if (ret != 0) {
LOG(log_warning, logtype_afpd, "getnamefromuuid(%s): no result from ldap_getnamefromuuid",
add_cachebyuuid( uuidp, *name, *type, 0);
LOG(log_debug, logtype_afpd, "getnamefromuuid{LDAP}: UUID: %s -> name: %s, type:%s",
uuid_bin2string(uuidp), *name, uuidtype[*type]);
+#endif
}
cleanup: