]> arthur.barton.de Git - netatalk.git/blobdiff - bin/misc/uuidtest.c
Merge master
[netatalk.git] / bin / misc / uuidtest.c
index b0e5ef9f993034b0a5383d667b2201f7be978467..0efc3318c6a45d0fe25c85b3cdf5016b9c548789 100644 (file)
 #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>
@@ -41,6 +43,7 @@ static void parse_ldapconf()
     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);
@@ -58,6 +61,9 @@ static void parse_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;
     }
 }
@@ -117,15 +123,15 @@ int main( int argc, char **argv)
             ret = getnamefromuuid( uuid, &name, &type);
             if (ret == 0) {
                 switch (type) {
-                case UUID_LOCAL:
-                    printf("local UUID: %s\n", optarg);
-                    break;
                 case UUID_USER:
                     printf("UUID: %s ==> User: %s\n", optarg, name);
                     break;
                 case UUID_GROUP:
                     printf("UUID: %s ==> Group: %s\n", optarg, name);
                     break;
+                default:
+                    printf("???: %s\n", optarg);
+                    break;
                 }
                 free(name);
             } else {
@@ -144,4 +150,3 @@ int main( int argc, char **argv)
     return 0;
 }
 
-#endif  /* HAVE_ACLS */