Add debug switch to netdomjoin.
authorGünther Deschner <gd@samba.org>
Fri, 4 Jan 2008 14:18:42 +0000 (15:18 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 4 Jan 2008 14:21:41 +0000 (15:21 +0100)
Guenther
(This used to be commit 2b221708c07967bccd68e8c7983791b4628405bb)

source3/lib/netapi/examples/netdomjoin/netdomjoin.c

index e8b529927ff48fe100f3d34c877b175ff666568e..634d265597236b126033250b70a9d1dea02c6002 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Unix SMB/CIFS implementation.
  *  Join Support (cmdline + netapi)
- *  Copyright (C) Guenther Deschner 2007
+ *  Copyright (C) Guenther Deschner 2007-2008
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -56,7 +56,10 @@ int main(int argc, char **argv)
 
        if (argc < 2) {
                printf("usage: netdomjoin\n");
-               printf("\t[hostname=HOSTNAME] [domain=DOMAIN] <ou=OU> <usero=USERO> <passwordo=PASSWORDO> <userd=USERD> <passwordd=PASSWORDD>\n");
+               printf("\t[hostname] [domain=DOMAIN] <ou=OU> "
+                      "<usero=USERO> <passwordo=PASSWORDO> "
+                      "<userd=USERD> <passwordd=PASSWORDD> "
+                      "<debug=DEBUGLEVEL>\n");
                return 0;
        }
 
@@ -87,6 +90,11 @@ int main(int argc, char **argv)
                        str = get_string_param(argv[i]);
                        libnetapi_set_password(ctx, str);
                }
+               if (strncasecmp(argv[i], "debug", strlen("debug"))== 0) {
+                       const char *str = NULL;
+                       str = get_string_param(argv[i]);
+                       libnetapi_set_debuglevel(ctx, str);
+               }
        }
 
        status = NetJoinDomain(server_name,