]> arthur.barton.de Git - netatalk.git/blobdiff - bin/misc/uuidtest.c
Merge branch-2-1
[netatalk.git] / bin / misc / uuidtest.c
index de114eb30549c7c0b907c7d07e3ca6aa9a8f353d..cb9177edd7e26e8c758076447307ba2987c050e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  $Id: uuidtest.c,v 1.2 2009-11-28 12:20:12 franklahm Exp $
+  $Id: uuidtest.c,v 1.3 2009-11-28 12:27:24 franklahm Exp $
   Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -34,7 +34,7 @@
 
 static void usage()
 {
-    printf("Usage: uuidtest -u <user> | -g <group> | -i <UUID>\n");
+    printf("Usage: afpldaptest -u <user> | -g <group> | -i <UUID>\n");
 }
 
 static void parse_ldapconf()
@@ -68,24 +68,26 @@ int main( int argc, char **argv)
 {
     int ret, i, c;
     int verbose = 0;
-    uuid_t uuid;
+    atalk_uuid_t uuid;
+    int logsetup = 0;
     uuidtype_t type;
     char *uuidstring = NULL;
     char *name = NULL;
 
-    setuplog("console log_error /dev/tty");
-
     while ((c = getopt(argc, argv, ":vu:g:i:")) != -1) {
         switch(c) {
 
         case 'v':
             if (! verbose) {
                 verbose = 1;
-                setuplog("console log_debug /dev/tty");
+                setuplog("default log_maxdebug /dev/tty");
+                logsetup = 1;
             }
             break;
 
         case 'u':
+            if (! logsetup)
+                setuplog("default log_info /dev/tty");
             parse_ldapconf();
             printf("Searching user: %s\n", optarg);
             ret = getuuidfromname( optarg, UUID_USER, uuid);
@@ -99,6 +101,8 @@ int main( int argc, char **argv)
             break;
 
         case 'g':
+            if (! logsetup)
+                setuplog("default log_info /dev/tty");
             parse_ldapconf();
             printf("Searching group: %s\n", optarg);
             ret = getuuidfromname( optarg, UUID_GROUP, uuid);
@@ -112,6 +116,8 @@ int main( int argc, char **argv)
             break;
 
         case 'i':
+            if (! logsetup)
+                setuplog("default log_info /dev/tty");
             parse_ldapconf();
             printf("Searching uuid: %s\n", optarg);
             uuid_string2bin(optarg, uuid);
@@ -129,6 +135,7 @@ int main( int argc, char **argv)
 
         case ':':
         case '?':
+        case 'h':
             usage();
             exit(EXIT_FAILURE);
         }
@@ -137,4 +144,4 @@ int main( int argc, char **argv)
     return 0;
 }
 
-#endif  /* HAVE_NFSv4_ACLS */
+#endif  /* HAVE_ACLS */