Revoke some of the popt patch from metze I applied earlier today. It added
authorJelmer Vernooij <jelmer@samba.org>
Mon, 24 Mar 2003 14:15:14 +0000 (14:15 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 24 Mar 2003 14:15:14 +0000 (14:15 +0000)
some double options and broke some parameters.

16 files changed:
source/client/client.c
source/include/popt_common.h
source/lib/popt_common.c
source/nmbd/nmbd.c
source/nsswitch/wbinfo.c
source/nsswitch/winbindd.c
source/rpcclient/rpcclient.c
source/smbd/server.c
source/utils/net.c
source/utils/nmblookup.c
source/utils/ntlm_auth.c
source/utils/pdbedit.c
source/utils/smbcacls.c
source/utils/smbtree.c
source/utils/testparm.c
source/wrepld/server.c

index 8d6730cdc66685a9e46d76d1e84cf782d4e9df01..da4f0257555e71a4ace2775e818652340dbc5e5d 100644 (file)
@@ -2603,7 +2603,8 @@ static void remember_query_host(const char *arg,
                { "send-buffer", 'b', POPT_ARG_INT, NULL, 'b', "Changes the transmit/send buffer", "BYTES" },
                { "port", 'p', POPT_ARG_INT, &port, 'p', "Port to connect to", "PORT" },
                POPT_COMMON_SAMBA
-               POPT_CREDENTIALS
+               POPT_COMMON_CONNECTION
+               POPT_COMMON_CREDENTIALS
                POPT_TABLEEND
        };
        
index 380df4860e54e9694d91305f8ae385a0b4b6c215..57850bf68267e850f49ee61000b24798e70401c4 100644 (file)
@@ -23,6 +23,8 @@
 
 /* Common popt structures */
 extern struct poptOption popt_common_samba[];
+extern struct poptOption popt_common_connection[];
+extern struct poptOption popt_common_version[];
 extern struct poptOption popt_common_credentials[];
 
 #ifndef POPT_TABLEEND
@@ -30,7 +32,9 @@ extern struct poptOption popt_common_credentials[];
 #endif
 
 #define POPT_COMMON_SAMBA { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_samba, 0, "Common samba options:", NULL },
-#define POPT_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
+#define POPT_COMMON_CONNECTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_connection, 0, "Connection options:", NULL },
+#define POPT_COMMON_VERSION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version, 0, "Common samba options:", NULL },
+#define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL },
 
 struct user_auth_info {
        pstring username;
index 06ba4fc898ec435322f35aee1197dcd3993a1b62..edd54c13d59091ef3a87f3cb48761b54af7d01ec 100644 (file)
@@ -112,22 +112,33 @@ static void popt_common_callback(poptContext con,
        }
 }
 
-struct poptOption popt_common_samba[] = {
+struct poptOption popt_common_connection[] = {
        { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
-       { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
-       { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file",
-         "CONFIGFILE" },
        { "socket-options", 'O', POPT_ARG_STRING, NULL, 'O', "socket options to use",
          "SOCKETOPTIONS" },
-       { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
-       { "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Basename for log/debug files",
-         "LOGFILEBASE" },
        { "netbiosname", 'n', POPT_ARG_STRING, NULL, 'n', "Primary netbios name", "NETBIOSNAME" },
        { "workgroup", 'W', POPT_ARG_STRING, NULL, 'W', "Set the workgroup name", "WORKGROUP" },
        { "scope", 'i', POPT_ARG_STRING, NULL, 'i', "Use this Netbios scope", "SCOPE" },
        POPT_TABLEEND
 };
 
+struct poptOption popt_common_samba[] = {
+       { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+       { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
+       { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file", "CONFIGFILE" },
+       { "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Basename for log/debug files", "LOGFILEBASE" },
+       { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
+       POPT_TABLEEND
+};
+
+struct poptOption popt_common_version[] = {
+       { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+       { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
+       POPT_TABLEEND
+};
+
+
+
 /****************************************************************************
  * get a password from a a file or file descriptor
  * exit on failure
index d013b79d3e6b952c5d1c6e0b25fcc7dd77e6c8c4..184a86e2cfcefbac2816fc77bc1e664776d0b27f 100644 (file)
@@ -601,6 +601,7 @@ static BOOL open_sockets(BOOL isdaemon, int port)
        {"hosts", 'H', POPT_ARG_STRING, dyn_LMHOSTSFILE, 'H', "Load a netbios hosts file"},
        {"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" },
        POPT_COMMON_SAMBA
+       POPT_COMMON_CONNECTION
        { NULL }
        };
        pstring logfile;
index fe11cd652851cddae969bd737c1a6ef0e154c40d..5ec8e534aa991caebb2780de8db6875665b4fd37 100644 (file)
@@ -711,7 +711,7 @@ int main(int argc, char **argv)
                { "set-auth-user", 'A', POPT_ARG_STRING, &string_arg, OPT_SET_AUTH_USER, "Store user and password used by winbindd (root only)", "user%password" },
                { "get-auth-user", 0, POPT_ARG_NONE, NULL, OPT_GET_AUTH_USER, "Retrieve user and password used by winbindd (root only)", NULL },
                { "ping", 'p', POPT_ARG_NONE, 0, 'p', "Ping winbindd to see if it is alive" },
-               POPT_COMMON_SAMBA
+               POPT_COMMON_VERSION
                POPT_TABLEEND
        };
 
index cd72a4f5721891595424de2bd781072d6587a6b8..0f34924e9da32e1a3dd117b5928226887554f5a5 100644 (file)
@@ -820,6 +820,7 @@ int main(int argc, char **argv)
                { "dual-daemon", 'B', POPT_ARG_VAL, &opt_dual_daemon, True, "Dual daemon mode" },
                { "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, False, "Disable caching" },
                POPT_COMMON_SAMBA
+               POPT_COMMON_CONNECTION
                POPT_TABLEEND
        };
        poptContext pc;
index 97a944dbf9ddf7522169b7c3e44034ad3243ea14..6c1d05b3e93bfd7c89dbc28c8e722ca32e21a436 100644 (file)
@@ -507,7 +507,8 @@ out_free:
                {"command",     'c', POPT_ARG_STRING,   &cmdstr, 'c', "Execute semicolon separated cmds", "COMMANDS"},
                {"dest-ip", 'I', POPT_ARG_STRING,   &opt_ipaddr, 'I', "Specify destination IP address", "IP"},
                POPT_COMMON_SAMBA
-               POPT_CREDENTIALS
+               POPT_COMMON_CONNECTION
+               POPT_COMMON_CREDENTIALS
                POPT_TABLEEND
        };
 
index 715e9162631f06490e879d961464a3162478149d..a166027acb27dd1050c6376b87fe742d7715b65a 100644 (file)
@@ -670,6 +670,7 @@ static BOOL init_structs(void )
        {"build-options", 'b', POPT_ARG_NONE, NULL, 'b', "Print build options" },
        {"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"},
        POPT_COMMON_SAMBA
+       POPT_COMMON_CONNECTION
        { NULL }
        };
 
index d6945ceefbd28209275bdec9ae3a9be236d010ca..3ab34e7aa9a3db5ad2e513712e05c23617822a14 100644 (file)
@@ -530,6 +530,7 @@ static struct functable net_func[] = {
                {"force",       'f', POPT_ARG_NONE,   &opt_force},
                {"timeout",     't', POPT_ARG_INT,    &opt_timeout},
                {"machine-pass",'P', POPT_ARG_NONE,   &opt_machine_pass},
+               {"myworkgroup", 'W', POPT_ARG_STRING, &opt_workgroup},
                POPT_COMMON_SAMBA
                { 0, 0, 0, 0}
        };
index 88038fb566a18c958fe7197124ce3dd3261811a0..85f092c8b07d6d2de0b131c7aa755e7441f43d7d 100644 (file)
@@ -203,6 +203,7 @@ int main(int argc,char *argv[])
          { "root-port", 'r', POPT_ARG_VAL, &RootPort, True, "Use root port 137 (Win95 only replies to this)" },
          { "lookup-by-ip", 'A', POPT_ARG_VAL, &lookup_by_ip, True, "Do a node status on <name> as an IP Address" },
          POPT_COMMON_SAMBA
+         POPT_COMMON_CONNECTION
          { 0, 0, 0, 0 }
   };
        
index a28bbf936481ad86da7978732261bad51e3ee7db..f02bd5f5b3a587320a9d75486d73bb56ab9ecf11 100644 (file)
@@ -457,7 +457,8 @@ enum {
                { "request-lm-key", 0, POPT_ARG_NONE, &request_lm_key, OPT_LM_KEY, "Retreive LM session key"},
                { "request-nt-key", 0, POPT_ARG_NONE, &request_nt_key, OPT_NT_KEY, "Retreive NT session key"},
                POPT_COMMON_SAMBA
-               POPT_CREDENTIALS
+               POPT_COMMON_CONNECTION
+               POPT_COMMON_CREDENTIALS
                POPT_TABLEEND
        };
 
index 03be2571e54d75537ef80846699382580bea63fe..f33dbd9f1c90cab58c17221ff6704f108abe05a8 100644 (file)
@@ -516,7 +516,7 @@ int main (int argc, char **argv)
        poptContext pc;
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               {"list",        'l', POPT_ARG_NONE, &list_users, 0, "list all users", NULL},
+               {"list",        'L', POPT_ARG_NONE, &list_users, 0, "list all users", NULL},
                {"verbose",     'v', POPT_ARG_NONE, &verbose, 0, "be verbose", NULL },
                {"smbpasswd-style",     'w',POPT_ARG_NONE, &spstyle, 0, "give output in smbpasswd style", NULL},
                {"user",        'u', POPT_ARG_STRING, &user_name, 0, "use username", "USER" },
index ac15cf1aa03d783eda71a1ec40db99b409122dc2..562fd9943f9a7a2ea106d52c58671235a859c19f 100644 (file)
@@ -758,7 +758,7 @@ static struct cli_state *connect_one(const char *share)
                { "numeric", 0, POPT_ARG_NONE, &numeric, True, "Don't resolve sids or masks to names" },
                { "test-args", 't', POPT_ARG_NONE, &test_args, True, "Test arguments"},
                POPT_COMMON_SAMBA
-               POPT_CREDENTIALS
+               POPT_COMMON_CREDENTIALS
                { NULL }
        };
 
index 32506c41019f4d0c20c2d89abb953b44b7fa6efe..52de5ab467a36abff8d609de2bb91f0954e8dee2 100644 (file)
@@ -251,7 +251,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
                { "domains", 'D', POPT_ARG_VAL, &level, LEV_WORKGROUP, "List only domains (workgroups) of tree" },
                { "servers", 'S', POPT_ARG_VAL, &level, LEV_SERVER, "List domains(workgroups) and servers of tree" },
                POPT_COMMON_SAMBA
-               POPT_CREDENTIALS
+               POPT_COMMON_CREDENTIALS
                POPT_TABLEEND
        };
        poptContext pc;
index c0e4f7606e0a1a7f6e9178138258c90bfef4348d..4c8a2ccf639ff44ade480256923ad5a95134b715 100644 (file)
@@ -206,8 +206,8 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
                {"verbose", 'v', POPT_ARG_NONE, &show_defaults, 1, "Show default options too"},
                {"server", 'L',POPT_ARG_STRING, &new_local_machine, 0, "Set %%L macro to servername\n"},
                {"encoding", 't', POPT_ARG_STRING, &term_code, 0, "Print parameters with encoding"},
-               POPT_COMMON_SAMBA
-               {0,0,0,0}
+               POPT_COMMON_VERSION
+               POPT_TABLEEND
        };
 
        pc = poptGetContext(NULL, argc, argv, long_options, 
index be9d86952d280c34230a1b13de0cf7b1f027bb47..196ea0d1d102cadcd7cc91f5895a8912d7906da4 100644 (file)
@@ -516,6 +516,7 @@ static void process(void)
                { "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Run interactive (not a daemon)" },
                { "port", 'p', POPT_ARG_INT, &wins_port, 'p', "Listen on the specified port" },
                POPT_COMMON_SAMBA
+               POPT_COMMON_CONNECTION
                POPT_TABLEEND
        };
        int opt;