#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>
+
+#ifdef HAVE_LDAP
+#define LDAP_DEPRECATED 1
#include <ldap.h>
+#endif
#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);
exit(EXIT_FAILURE);
}
} else {
- printf("afp_ldap.conf is not ok.\n");
- exit(EXIT_FAILURE);
+ 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;
}
}
int main( int argc, char **argv)
{
- int ret, i, c;
+ int ret, c;
int verbose = 0;
atalk_uuid_t uuid;
int logsetup = 0;
uuidtype_t type;
- char *uuidstring = NULL;
char *name = NULL;
while ((c = getopt(argc, argv, ":vu:g:i:")) != -1) {
printf("Searching user: %s\n", optarg);
ret = getuuidfromname( optarg, UUID_USER, uuid);
if (ret == 0) {
- uuid_bin2string( uuid, &uuidstring);
- printf("User: %s ==> UUID: %s\n", optarg, uuidstring);
- free(uuidstring);
+ printf("User: %s ==> UUID: %s\n", optarg, uuid_bin2string(uuid));
} else {
printf("User %s not found.\n", optarg);
}
printf("Searching group: %s\n", optarg);
ret = getuuidfromname( optarg, UUID_GROUP, uuid);
if (ret == 0) {
- uuid_bin2string( uuid, &uuidstring);
- printf("Group: %s ==> UUID: %s\n", optarg, uuidstring);
- free(uuidstring);
+ printf("Group: %s ==> UUID: %s\n", optarg, uuid_bin2string(uuid));
} else {
printf("Group %s not found.\n", optarg);
}
return 0;
}
-#endif /* HAVE_ACLS */