r12757: r12126@cabra: derrell | 2006-01-03 15:21:36 -0500
authorDerrell Lipman <derrell@samba.org>
Sat, 7 Jan 2006 20:43:28 +0000 (20:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:02 +0000 (11:06 -0500)
 added flag to not request authentication information

examples/libsmbclient/testbrowse.c

index b5337ae983ad0fb7b95c8973747fe2c8aa6b7eab..ca126c9510fe35f1960e98bac9fbe74088077ff6 100644 (file)
@@ -30,6 +30,7 @@ main(int argc, char * argv[])
 {
     int                         debug = 0;
     int                         debug_stderr = 0;
+    int                         no_auth = 0;
     int                         scan = 0;
     int                         iterations = -1;
     int                         again;
@@ -58,6 +59,10 @@ main(int argc, char * argv[])
                 "iterations", 'i', POPT_ARG_INT, &iterations,
                 0, "Iterations", "integer"
             },
+            {
+                "noauth", 'A', POPT_ARG_NONE, &no_auth,
+                0, "Do not request authentication data", "integer"
+            },
             {
                 NULL
             }
@@ -82,9 +87,14 @@ main(int argc, char * argv[])
         return 1;
     }
         
+    /* If we're scanning, do no requests for authentication data */
+    if (scan) {
+        no_auth = 1;
+    }
+
     /* Set mandatory options (is that a contradiction in terms?) */
     context->debug = debug;
-    context->callbacks.auth_fn = (scan ? no_auth_data_fn : get_auth_data_fn);
+    context->callbacks.auth_fn = (no_auth ? no_auth_data_fn : get_auth_data_fn);
 
     /* If we've been asked to log to stderr instead of stdout... */
     if (debug_stderr) {
@@ -102,7 +112,6 @@ main(int argc, char * argv[])
     /* Tell the compatibility layer to use this context */
     smbc_set_context(context);
 
-
     if (scan)
     {
         for (;