From 41a09c3c533ab170097309e1f91314eda32e4f4c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 24 Mar 2003 14:15:14 +0000 Subject: Revoke some of the popt patch from metze I applied earlier today. It added some double options and broke some parameters. (This used to be commit d5f9b0275c91512e1926504f22aaeec2d104430d) --- source3/client/client.c | 3 ++- source3/include/popt_common.h | 6 +++++- source3/lib/popt_common.c | 25 ++++++++++++++++++------- source3/nmbd/nmbd.c | 1 + source3/nsswitch/wbinfo.c | 2 +- source3/nsswitch/winbindd.c | 1 + source3/rpcclient/rpcclient.c | 3 ++- source3/smbd/server.c | 1 + source3/utils/net.c | 1 + source3/utils/nmblookup.c | 1 + source3/utils/ntlm_auth.c | 3 ++- source3/utils/pdbedit.c | 2 +- source3/utils/smbcacls.c | 2 +- source3/utils/smbtree.c | 2 +- source3/utils/testparm.c | 4 ++-- source3/wrepld/server.c | 1 + 16 files changed, 41 insertions(+), 17 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index 8d6730cdc6..da4f025755 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -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 }; diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index 380df4860e..57850bf682 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -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; diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 06ba4fc898..edd54c13d5 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -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 diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index d013b79d3e..184a86e2cf 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -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; diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index fe11cd6528..5ec8e534aa 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -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 }; diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index cd72a4f572..0f34924e9d 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -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; diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 97a944dbf9..6c1d05b3e9 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -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 }; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 715e916263..a166027acb 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -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 } }; diff --git a/source3/utils/net.c b/source3/utils/net.c index d6945ceefb..3ab34e7aa9 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -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} }; diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 88038fb566..85f092c8b0 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -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 as an IP Address" }, POPT_COMMON_SAMBA + POPT_COMMON_CONNECTION { 0, 0, 0, 0 } }; diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index a28bbf9364..f02bd5f5b3 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -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 }; diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 03be2571e5..f33dbd9f1c 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -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" }, diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index ac15cf1aa0..562fd9943f 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -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 } }; diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c index 32506c4101..52de5ab467 100644 --- a/source3/utils/smbtree.c +++ b/source3/utils/smbtree.c @@ -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; diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index c0e4f7606e..4c8a2ccf63 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -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, diff --git a/source3/wrepld/server.c b/source3/wrepld/server.c index be9d86952d..196ea0d1d1 100644 --- a/source3/wrepld/server.c +++ b/source3/wrepld/server.c @@ -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; -- cgit