diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/client/client.c HEAD-ioctl/source/client/client.c
--- HEAD/source/client/client.c	Mon Mar 24 07:10:42 2003
+++ HEAD-ioctl/source/client/client.c	Mon Mar 24 09:05:28 2003
@@ -2589,15 +2589,7 @@ static void remember_query_host(const ch
 	int rc = 0;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		POPT_COMMON_SAMBA
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options }, 
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netbios_name },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_scope },
-		POPT_CREDENTIALS
+
 		{ "name-resolve", 'R', POPT_ARG_STRING, &new_name_resolve_order, 'R', "Use these name resolution services only", "NAME-RESOLVE-ORDER" },
 		{ "message", 'M', POPT_ARG_STRING, NULL, 'M', "Send message", "HOST" },
 		{ "ip-address", 'I', POPT_ARG_STRING, NULL, 'I', "Use this IP to connect to", "IP" },
@@ -2610,7 +2602,9 @@ static void remember_query_host(const ch
 		{ "command", 'c', POPT_ARG_STRING, &cmdstr, 'c', "Execute semicolon separated commands" }, 
 		{ "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" },
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		POPT_CREDENTIALS
+		{ NULL }
 	};
 	
 
@@ -2720,7 +2714,7 @@ static void remember_query_host(const ch
 
 	pstrcpy(username, cmdline_auth_info.username);
 	pstrcpy(password, cmdline_auth_info.password);
-	pstrcpy(workgroup, cmdline_auth_info.workgroup);
+	pstrcpy(workgroup, lp_workgroup());
 	use_kerberos = cmdline_auth_info.use_kerberos;
 	got_pass = cmdline_auth_info.got_pass;
 
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/include/popt_common.h HEAD-ioctl/source/include/popt_common.h
--- HEAD/source/include/popt_common.h	Sun Mar 23 00:48:02 2003
+++ HEAD-ioctl/source/include/popt_common.h	Mon Mar 24 08:40:45 2003
@@ -22,22 +22,15 @@
 #define _POPT_COMMON_H
 
 /* Common popt structures */
-extern struct poptOption popt_common_debug[];
-extern struct poptOption popt_common_configfile[];
-extern struct poptOption popt_common_socket_options[];
-extern struct poptOption popt_common_version[];
-extern struct poptOption popt_common_netbios_name[];
-extern struct poptOption popt_common_log_base[];
+extern struct poptOption popt_common_samba[];
 extern struct poptOption popt_common_credentials[];
-extern struct poptOption popt_common_scope[];
 
-#define POPT_COMMON_SAMBA { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version, 0, "Common samba options:", NULL },
+#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 },
 
 struct user_auth_info {
 	pstring username;
 	pstring password;
-	pstring workgroup;
 	BOOL got_pass;
 	BOOL use_kerberos;
 };
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/lib/popt_common.c HEAD-ioctl/source/lib/popt_common.c
--- HEAD/source/lib/popt_common.c	Mon Mar 24 07:10:43 2003
+++ HEAD-ioctl/source/lib/popt_common.c	Mon Mar 24 09:27:03 2003
@@ -29,6 +29,7 @@
  *		-V,--version
  *		-l,--log-base
  *		-n,--netbios-name
+ *		-W,--workgroup
  *		-i,--scope
  */
 
@@ -102,49 +103,29 @@ static void popt_common_callback(poptCon
 			  set_global_scope(arg);
 		}
 		break;
+
+	case 'W':
+		if (arg) {
+			set_global_myworkgroup(arg);
+		}
+		break;
 	}
 }
 
-struct poptOption popt_common_debug[] = {
+struct poptOption popt_common_samba[] = {
 	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
 	{ "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
-	{ 0 }
-};
-
-struct poptOption popt_common_scope[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback }, 
-    { "scope", 'i', POPT_ARG_STRING, NULL, 'i', "Use this Netbios scope", "SCOPE" },  
-	{ 0 }
-};
-
-struct poptOption popt_common_configfile[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
-	{ "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file" },
-	{ 0 }
-};
-
-struct poptOption popt_common_socket_options[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
-	{"socket-options", 'O', POPT_ARG_STRING, NULL, 'O', "socket options to use" },
-	{ 0 }
-};
-
-struct poptOption popt_common_version[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
-	{"version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
-	{ 0 }
-};
-
-struct poptOption popt_common_netbios_name[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
-	{"netbiosname", 'n', POPT_ARG_STRING, NULL, 'n', "Primary netbios name"},
-	{ 0 }
-};
-
-struct poptOption popt_common_log_base[] = {
-	{ NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, popt_common_callback },
-	{ "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Basename for log/debug files"},
-	{ 0 }
+	{ "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" },
+	{ NULL }
 };
 
 /****************************************************************************
@@ -255,7 +236,7 @@ static void get_credentials_file(const c
 		else if (strwicmp("username", param) == 0)
 			pstrcpy(info->username, val);
 		else if (strwicmp("domain", param) == 0)
-			pstrcpy(info->workgroup,val);
+			set_global_myworkgroup(val);
 		memset(buf, 0, sizeof(buf));
 	}
 	x_fclose(auth);
@@ -263,7 +244,6 @@ static void get_credentials_file(const c
 
 /* Handle command line options:
  *		-U,--user
- *		-W,--workgroup
  *		-A,--authentication-file
  *		-k,--use-kerberos
  *		-N,--no-pass
@@ -327,30 +307,25 @@ static void popt_common_credentials_call
 		get_credentials_file(arg, &cmdline_auth_info);
 		break;
 
-		case 'W':
-			pstrcpy(cmdline_auth_info.workgroup,arg);
-			break;
-
-		case 'k':
+	case 'k':
 #ifndef HAVE_KRB5
-			d_printf("No kerberos support compiled in\n");
-			exit(1);
+		d_printf("No kerberos support compiled in\n");
+		exit(1);
 #else
-			cmdline_auth_info.got_pass = True;
+		cmdline_auth_info.use_kerberos = True;
+		cmdline_auth_info.got_pass = True;
 #endif
-
-			break;
-		}
+		break;
 	}
+}
 
 
 
-	struct poptOption popt_common_credentials[] = {
-		{ NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, popt_common_credentials_callback },
-		{ "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "USERNAME" },
-		{ "no-pass", 'N', POPT_ARG_VAL, &cmdline_auth_info.got_pass, True, "Don't ask for a password" },
-		{ "kerberos", 'k', POPT_ARG_VAL, &cmdline_auth_info.use_kerberos, True, "Use kerberos (active directory) authentication" },
-		{ "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" },
-		{ "workgroup", 'W', POPT_ARG_STRING, NULL, 'W', "Set the workgroup name", "WORKGROUP" },
-		{ 0 }
-	};
+struct poptOption popt_common_credentials[] = {
+	{ NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, popt_common_credentials_callback },
+	{ "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "USERNAME" },
+	{ "no-pass", 'N', POPT_ARG_NONE, &cmdline_auth_info.got_pass, True, "Don't ask for a password" },
+	{ "kerberos", 'k', POPT_ARG_NONE, &cmdline_auth_info.use_kerberos, True, "Use kerberos (active directory) authentication" },
+	{ "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" },
+	{ 0 }
+};
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/nmbd/nmbd.c HEAD-ioctl/source/nmbd/nmbd.c
--- HEAD/source/nmbd/nmbd.c	Mon Mar 24 07:10:43 2003
+++ HEAD-ioctl/source/nmbd/nmbd.c	Mon Mar 24 08:58:47 2003
@@ -601,11 +601,6 @@ static BOOL open_sockets(BOOL isdaemon, 
 	{"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
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options },
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netbios_name },
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base },
 	{ NULL }
 	};
 	pstring logfile;
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/nsswitch/wbinfo.c HEAD-ioctl/source/nsswitch/wbinfo.c
--- HEAD/source/nsswitch/wbinfo.c	Mon Mar 17 07:12:33 2003
+++ HEAD-ioctl/source/nsswitch/wbinfo.c	Mon Mar 24 09:35:49 2003
@@ -711,8 +711,8 @@ 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" },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 
 	/* Samba client initialisation */
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/nsswitch/winbindd.c HEAD-ioctl/source/nsswitch/winbindd.c
--- HEAD/source/nsswitch/winbindd.c	Mon Mar 24 07:10:44 2003
+++ HEAD-ioctl/source/nsswitch/winbindd.c	Mon Mar 24 09:00:27 2003
@@ -814,16 +814,13 @@ int main(int argc, char **argv)
 	static BOOL log_stdout = False;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		POPT_COMMON_SAMBA
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
 		{ "stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
 		{ "foreground", 'F', POPT_ARG_VAL, &Fork, False, "Daemon in foreground mode" },
 		{ "interactive", 'i', POPT_ARG_NONE, NULL, 'i', "Interactive mode" },
 		{ "dual-daemon", 'B', POPT_ARG_VAL, &opt_dual_daemon, True, "Dual daemon mode" },
 		{ "no-caching", 'n', POPT_ARG_VAL, &opt_nocache, False, "Disable caching" },
-		
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 	poptContext pc;
 	int opt;
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/rpcclient/rpcclient.c HEAD-ioctl/source/rpcclient/rpcclient.c
--- HEAD/source/rpcclient/rpcclient.c	Mon Mar 17 07:12:35 2003
+++ HEAD-ioctl/source/rpcclient/rpcclient.c	Mon Mar 24 09:25:29 2003
@@ -97,70 +97,6 @@ static char **completion_fn(char *text, 
 	return matches;
 }
 
-/***********************************************************************
- * read in username/password credentials from a file
- */
-static void read_authfile (
-	char *filename, 
-	char* username, 
-	char* password, 
-	char* domain
-)
-{
-	FILE *auth;
-        fstring buf;
-        uint16 len = 0;
-	char *ptr, *val, *param;
-                               
-	if ((auth=sys_fopen(filename, "r")) == NULL)
-	{
-		printf ("ERROR: Unable to open credentials file!\n");
-		return;
-	}
-                                
-	while (!feof(auth))
-	{  
-		/* get a line from the file */
-		if (!fgets (buf, sizeof(buf), auth))
-			continue;
-		
-		len = strlen(buf);
-		
-		/* skip empty lines */			
-		if ((len) && (buf[len-1]=='\n'))
-		{
-			buf[len-1] = '\0';
-			len--;
-		}	
-		if (len == 0)
-			continue;
-					
-		/* break up the line into parameter & value.
-		   will need to eat a little whitespace possibly */
-		param = buf;
-		if (!(ptr = strchr_m(buf, '=')))
-			continue;
-		val = ptr+1;
-		*ptr = '\0';
-					
-		/* eat leading white space */
-		while ((*val!='\0') && ((*val==' ') || (*val=='\t')))
-			val++;
-					
-		if (strwicmp("password", param) == 0)
-			fstrcpy (password, val);
-		else if (strwicmp("username", param) == 0)
-			fstrcpy (username, val);
-		else if (strwicmp("domain", param) == 0)
-			fstrcpy (domain, val);
-						
-		memset(buf, 0, sizeof(buf));
-	}
-	fclose(auth);
-	
-	return;
-}
-
 static char* next_command (char** cmdstr)
 {
 	static pstring 		command;
@@ -181,28 +117,6 @@ static char* next_command (char** cmdstr
 	return command;
 }
 
-
-/**
- * Find default username from environment variables.
- *
- * @param username fstring to receive username; not touched if none is
- * known.
- **/
-static void get_username (char *username)
-{
-        if (getenv("USER"))
-                fstrcpy(username,getenv("USER"));
- 
-        if (*username == 0 && getenv("LOGNAME"))
-                fstrcpy(username,getenv("LOGNAME"));
- 
-        if (*username == 0) {
-                fstrcpy(username,"GUEST");
-        }
-
-	return;
-}
-
 /* Fetch the SID for this computer */
 
 static void fetch_machine_sid(struct cli_state *cli)
@@ -575,21 +489,12 @@ out_free:
 
  int main(int argc, char *argv[])
 {
-	static int		got_pass = 0;
 	BOOL 			interactive = True;
 	int 			opt;
-	static char		*cmdstr = "";
+	static char		*cmdstr = NULL;
 	const char *server;
 	struct cli_state	*cli;
-	fstring 		password="",
-				username="",
-		domain="";
-	static char 		*opt_authfile=NULL,
-				*opt_username=NULL,
-				*opt_domain=NULL,
- 	                        *opt_logfile=NULL,
-	                        *opt_ipaddr=NULL;
-	pstring 		logfile;
+	static char 		*opt_ipaddr=NULL;
 	struct cmd_set 		**cmd_set;
 	struct in_addr 		server_ip;
 	NTSTATUS 		nt_status;
@@ -599,16 +504,10 @@ out_free:
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		{"authfile",	'A', POPT_ARG_STRING,	&opt_authfile, 'A', "File containing user credentials", "AUTHFILE"},
-		{"nopass",	'N', POPT_ARG_NONE,	&got_pass, 'N', "Don't ask for a password"},
-		{"user", 'U', POPT_ARG_STRING,	&opt_username, 'U', "Set the network username", "USER"},
-		{"workgroup", 'W', POPT_ARG_STRING, 	&opt_domain, 'W', "Set the domain name for user account", "DOMAIN"},
 		{"command",	'c', POPT_ARG_STRING,	&cmdstr, 'c', "Execute semicolon separated cmds", "COMMANDS"},
-		{"logfile",	'l', POPT_ARG_STRING,	&opt_logfile, 'l', "Logfile to use instead of stdout", "LOGFILE" },
 		{"dest-ip", 'I', POPT_ARG_STRING,   &opt_ipaddr, 'I', "Specify destination IP address", "IP"},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
+		POPT_COMMON_SAMBA
+		POPT_CREDENTIALS
 		{ NULL }
 	};
 
@@ -628,43 +527,13 @@ out_free:
 	
 	while((opt = poptGetNextOpt(pc)) != -1) {
 		switch (opt) {
-		case 'A':
-			/* only get the username, password, and domain from the file */
-			read_authfile (opt_authfile, username, password, domain);
-			if (strlen (password))
-				got_pass = 1;
-			break;
-			
-		case 'l':
-			slprintf(logfile, sizeof(logfile) - 1, "%s.client", 
-				 opt_logfile);
-			lp_set_logfile(logfile);
-			interactive = False;
-			break;
-			
-		case 'U': {
-			char *lp;
 
-			fstrcpy(username,opt_username);
-
-			if ((lp=strchr_m(username,'%'))) {
-				*lp = 0;
-				fstrcpy(password,lp+1);
-				got_pass = 1;
-				memset(strchr_m(opt_username,'%') + 1, 'X',
-				       strlen(password));
-			}
-			break;
-		}
 		case 'I':
 		        if ( (server_ip.s_addr=inet_addr(opt_ipaddr)) == INADDR_NONE ) {
 				fprintf(stderr, "%s not a valid IP address\n",
 					opt_ipaddr);
 				return 1;
 			}
-		case 'W':
-			fstrcpy(domain, opt_domain);
-			break;
 		}
 	}
 
@@ -701,28 +570,25 @@ out_free:
 	 * from stdin if necessary
 	 */
 
-	if (!got_pass) {
+	if (!cmdline_auth_info.got_pass) {
 		char *pass = getpass("Password:");
 		if (pass) {
-			fstrcpy(password, pass);
+			pstrcpy(cmdline_auth_info.password, pass);
 		}
 	}
 	
-	if (!strlen(username) && !got_pass)
-		get_username(username);
-		
 	nt_status = cli_full_connection(&cli, global_myname(), server, 
 					opt_ipaddr ? &server_ip : NULL, 0,
 					"IPC$", "IPC",  
-					username, domain,
-					password, 0, NULL);
+					cmdline_auth_info.username, lp_workgroup(),
+					cmdline_auth_info.password, 0, NULL);
 	
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		DEBUG(0,("Cannot connect to server.  Error was %s\n", nt_errstr(nt_status)));
 		return 1;
 	}
 
-	memset(password,'X',sizeof(password));
+	memset(cmdline_auth_info.password,'X',sizeof(cmdline_auth_info.password));
 
 	/* Load command lists */
 
@@ -737,7 +603,7 @@ out_free:
 	fetch_machine_sid(cli);
  
        /* Do anything specified with -c */
-        if (cmdstr[0]) {
+        if (cmdstr && cmdstr[0]) {
                 char    *cmd;
                 char    *p = cmdstr;
  
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/smbd/server.c HEAD-ioctl/source/smbd/server.c
--- HEAD/source/smbd/server.c	Mon Mar 24 07:10:45 2003
+++ HEAD-ioctl/source/smbd/server.c	Mon Mar 24 08:57:17 2003
@@ -670,10 +670,6 @@ 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
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug},
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile},
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options},
-	{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base},
 	{ NULL }
 	};
 
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/torture/samtest.c HEAD-ioctl/source/torture/samtest.c
--- HEAD/source/torture/samtest.c	Wed Feb 26 07:58:16 2003
+++ HEAD-ioctl/source/torture/samtest.c	Mon Mar 24 09:52:53 2003
@@ -353,10 +353,7 @@ int main(int argc, char *argv[])
 {
 	BOOL 			interactive = True;
 	int 			opt;
-	static char		*cmdstr = "";
-	static char *opt_logfile=NULL;
-	static char *config_file = dyn_CONFIGFILE;
-	pstring 		logfile;
+	static char		*cmdstr = NULL;
 	struct cmd_set 		**cmd_set;
 	struct samtest_state st;
 
@@ -365,12 +362,9 @@ int main(int argc, char *argv[])
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
 		{"command",	'e', POPT_ARG_STRING,	&cmdstr, 'e', "Execute semicolon seperated cmds"},
-		{"logfile",	'l', POPT_ARG_STRING,	&opt_logfile, 'l', "Logfile to use instead of stdout"},
-		{"configfile", 'c', POPT_ARG_STRING, &config_file, 0,"use different configuration file",NULL},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ 0, 0, 0, 0}
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 
 	ZERO_STRUCT(st);
@@ -419,7 +413,7 @@ int main(int argc, char *argv[])
 	}
 
        /* Do anything specified with -c */
-	if (cmdstr[0]) {
+	if (cmdstr && cmdstr[0]) {
 		char    *cmd;
 		char    *p = cmdstr;
  
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/torture/vfstest.c HEAD-ioctl/source/torture/vfstest.c
--- HEAD/source/torture/vfstest.c	Wed Feb 26 07:58:16 2003
+++ HEAD-ioctl/source/torture/vfstest.c	Mon Mar 24 09:46:39 2003
@@ -476,7 +476,7 @@ int main(int argc, char *argv[])
 {
 	BOOL 			interactive = True;
 	int 			opt;
-	static char		*cmdstr = "";
+	static char		*cmdstr = NULL;
 	static char		*opt_logfile=NULL;
 	static int		opt_debuglevel;
 	pstring 		logfile;
@@ -484,7 +484,7 @@ int main(int argc, char *argv[])
 	extern BOOL 		AllowDebugChange;
 	static struct vfs_state vfs;
 	int i;
-	static const char	*filename = "";
+	static const char	*filename = NULL;
 
 	/* make sure the vars that get altered (4th field) are in
 	   a fixed location or certain compilers complain */
@@ -493,10 +493,8 @@ int main(int argc, char *argv[])
 		POPT_AUTOHELP
 		{"file",	'f', POPT_ARG_STRING,	&filename, 0, },
 		{"command",	'c', POPT_ARG_STRING,	&cmdstr, 0, "Execute specified list of commands" },
-		{"logfile",	'l', POPT_ARG_STRING,	&opt_logfile, 'l', "Write output to specified logfile" },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ 0, 0, 0, 0}
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 
 
@@ -510,12 +508,6 @@ int main(int argc, char *argv[])
 	
 	while((opt = poptGetNextOpt(pc)) != -1) {
 		switch (opt) {
-		case 'l':
-			slprintf(logfile, sizeof(logfile) - 1, "%s.client", 
-				 opt_logfile);
-			lp_set_logfile(logfile);
-			interactive = False;
-			break;
 			
 		case 'd':
 			DEBUGLEVEL = opt_debuglevel;
@@ -556,13 +548,13 @@ int main(int argc, char *argv[])
 	smbd_vfs_init(vfs.conn);
 
 	/* Do we have a file input? */
-	if (filename[0]) {
+	if (filename && filename[0]) {
 		process_file(&vfs, filename);
 		return 0;
 	}
 
 	/* Do anything specified with -c */
-	if (cmdstr[0]) {
+	if (cmdstr && cmdstr[0]) {
 		char    *cmd;
 		char    *p = cmdstr;
  
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/net.c HEAD-ioctl/source/utils/net.c
--- HEAD/source/utils/net.c	Mon Mar 24 07:10:45 2003
+++ HEAD-ioctl/source/utils/net.c	Mon Mar 24 09:02:31 2003
@@ -515,7 +515,6 @@ static struct functable net_func[] = {
 	struct poptOption long_options[] = {
 		{"help",	'h', POPT_ARG_NONE,   0, 'h'},
 		{"workgroup",	'w', POPT_ARG_STRING, &opt_target_workgroup},
-		{"myworkgroup",	'W', POPT_ARG_STRING, &opt_workgroup},
 		{"user",	'U', POPT_ARG_STRING, &opt_user_name, 'U'},
 		{"ipaddress",	'I', POPT_ARG_STRING, 0,'I'},
 		{"port",	'p', POPT_ARG_INT,    &opt_port},
@@ -532,8 +531,6 @@ static struct functable net_func[] = {
 		{"timeout",	't', POPT_ARG_INT,    &opt_timeout},
 		{"machine-pass",'P', POPT_ARG_NONE,   &opt_machine_pass},
 		POPT_COMMON_SAMBA
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
 		{ 0, 0, 0, 0}
 	};
 
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/nmblookup.c HEAD-ioctl/source/utils/nmblookup.c
--- HEAD/source/utils/nmblookup.c	Mon Mar 24 07:10:46 2003
+++ HEAD-ioctl/source/utils/nmblookup.c	Mon Mar 24 09:02:53 2003
@@ -203,9 +203,6 @@ 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
-	  { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_scope },
-	  { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-	  { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
 	  { 0, 0, 0, 0 }
   };
 	
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/ntlm_auth.c HEAD-ioctl/source/utils/ntlm_auth.c
--- HEAD/source/utils/ntlm_auth.c	Mon Mar 24 07:10:46 2003
+++ HEAD-ioctl/source/utils/ntlm_auth.c	Mon Mar 24 09:06:40 2003
@@ -439,14 +439,13 @@ enum {
 	OPT_NT_KEY
 };
 
-int main(int argc, const char **argv)
+ int main(int argc, const char **argv)
 {
 	int opt;
 
 	poptContext pc;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-
 		{ "helper-protocol", 0, POPT_ARG_STRING, &helper_protocol, OPT_DOMAIN, "operate as a stdio-based helper", "helper protocol to use"},
  		{ "username", 0, POPT_ARG_STRING, &username, OPT_USERNAME, "username"},
  		{ "domain", 0, POPT_ARG_STRING, &domain, OPT_DOMAIN, "domain name"},
@@ -457,10 +456,9 @@ int main(int argc, const char **argv)
 		{ "password", 0, POPT_ARG_STRING, &password, OPT_PASSWORD, "User's plaintext password"},		
 		{ "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"},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		POPT_CREDENTIALS
+		{ NULL }
 	};
 
 	/* Samba client initialisation */
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/pdbedit.c HEAD-ioctl/source/utils/pdbedit.c
--- HEAD/source/utils/pdbedit.c	Mon Mar 24 07:10:46 2003
+++ HEAD-ioctl/source/utils/pdbedit.c	Mon Mar 24 09:10:56 2003
@@ -537,9 +537,7 @@ int main (int argc, char **argv)
 		{"value",       'C', POPT_ARG_LONG, &account_policy_value, 'C',"set the account policy to this value", NULL},
 		{"account-control",	'c', POPT_ARG_STRING, &account_control, 0, "Values of account control", NULL},
 		POPT_COMMON_SAMBA
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{0,0,0,0}
+		{ NULL }
 	};
 	
 	setup_logging("pdbedit", True);
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/smbcacls.c HEAD-ioctl/source/utils/smbcacls.c
--- HEAD/source/utils/smbcacls.c	Fri Mar 21 08:38:58 2003
+++ HEAD-ioctl/source/utils/smbcacls.c	Mon Mar 24 09:33:59 2003
@@ -24,11 +24,8 @@
 
 #include "includes.h"
 
-static fstring password;
-static pstring username;
 static pstring owner_username;
 static fstring server;
-static int got_pass;
 static int test_args = False;
 static TALLOC_CTX *ctx;
 
@@ -716,19 +713,19 @@ static struct cli_state *connect_one(con
 	NTSTATUS nt_status;
 	zero_ip(&ip);
 	
-	if (!got_pass) {
+	if (!cmdline_auth_info.got_pass) {
 		char *pass = getpass("Password: ");
 		if (pass) {
-			fstrcpy(password, pass);
-			got_pass = True;
+			pstrcpy(cmdline_auth_info.password, pass);
+			cmdline_auth_info.got_pass = True;
 		}
 	}
 
 	if (NT_STATUS_IS_OK(nt_status = cli_full_connection(&c, global_myname(), server, 
 							    &ip, 0,
 							    share, "?????",  
-							    username, lp_workgroup(),
-							    password, 0, NULL))) {
+							    cmdline_auth_info.username, lp_workgroup(),
+							    cmdline_auth_info.password, 0, NULL))) {
 		return c;
 	} else {
 		DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));
@@ -743,7 +740,6 @@ static struct cli_state *connect_one(con
 {
 	char *share;
 	int opt;
-	char *p;
 	enum acl_mode mode = SMB_ACL_SET;
 	static char *the_acl = NULL;
 	enum chown_mode change_mode = REQUEST_NONE;
@@ -759,12 +755,10 @@ static struct cli_state *connect_one(con
 		{ "set", 'S', POPT_ARG_STRING, NULL, 'S', "Set acls", "ACLS" },
 		{ "chown", 'C', POPT_ARG_STRING, NULL, 'C', "Change ownership of a file", "USERNAME" },
 		{ "chgrp", 'G', POPT_ARG_STRING, NULL, 'G', "Change group ownership of a file", "GROUPNAME" },
-		{ "numeric", 'n', POPT_ARG_VAL, &numeric, True, "Don't resolve sids or masks to names" },
-		{ "test-args", 't', POPT_ARG_VAL, &test_args, True, "Test arguments"},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{"username", 'U', POPT_ARG_STRING, NULL, 'U', "User to authenticate as", "user%password" },
+		{ "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
 		{ NULL }
 	};
 
@@ -781,33 +775,12 @@ static struct cli_state *connect_one(con
 	lp_load(dyn_CONFIGFILE,True,False,False);
 	load_interfaces();
 
-	if (getenv("USER")) {
-		pstrcpy(username,getenv("USER"));
-
-		if ((p=strchr_m(username,'%'))) {
-			*p = 0;
-			fstrcpy(password,p+1);
-			got_pass = True;
-			memset(strchr_m(getenv("USER"), '%') + 1, 'X',
-			       strlen(password));
-		}
-	}
 	pc = poptGetContext("smbcacls", argc, argv, long_options, 0);
 	
 	poptSetOtherOptionHelp(pc, "//server1/share1 filename");
 
 	while ((opt = poptGetNextOpt(pc)) != -1) {
 		switch (opt) {
-		case 'U':
-			pstrcpy(username,poptGetOptArg(pc));
-			p = strchr_m(username,'%');
-			if (p) {
-				*p = 0;
-				fstrcpy(password, p+1);
-				got_pass = 1;
-			}
-			break;
-
 		case 'S':
 			the_acl = smb_xstrdup(poptGetOptArg(pc));
 			mode = SMB_ACL_SET;
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/smbtree.c HEAD-ioctl/source/utils/smbtree.c
--- HEAD/source/utils/smbtree.c	Mon Mar 24 07:10:46 2003
+++ HEAD-ioctl/source/utils/smbtree.c	Mon Mar 24 09:09:42 2003
@@ -247,14 +247,12 @@ static BOOL print_tree(struct user_auth_
 {
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
 		{ "broadcast", 'b', POPT_ARG_VAL, &use_bcast, True, "Use broadcast instead of using the master browser" },
 		{ "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" },
-		{ 0 }
+		POPT_COMMON_SAMBA
+		POPT_CREDENTIALS
+		{ NULL }
 	};
 	poptContext pc;
 	
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/status.c HEAD-ioctl/source/utils/status.c
--- HEAD/source/utils/status.c	Wed Feb 19 06:38:50 2003
+++ HEAD-ioctl/source/utils/status.c	Mon Mar 24 09:08:56 2003
@@ -559,10 +559,8 @@ static int traverse_sessionid(TDB_CONTEX
 		{"profile",	'P', POPT_ARG_NONE,	&profile_only, 'P', "Do profiling" },
 #endif /* WITH_PROFILE */
 		{"byterange",	'B', POPT_ARG_NONE,	&show_brl, 'B', "Include byte range locks"},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{ 0, 0, 0, 0}
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 
 	setup_logging(argv[0],True);
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/utils/testparm.c HEAD-ioctl/source/utils/testparm.c
--- HEAD/source/utils/testparm.c	Mon Mar 24 07:10:47 2003
+++ HEAD-ioctl/source/utils/testparm.c	Mon Mar 24 09:07:14 2003
@@ -186,7 +186,7 @@ via the %%o substitution. With encrypted
 	return ret;
 }   
 
-int main(int argc, const char *argv[])
+ int main(int argc, const char *argv[])
 {
 	const char *config_file = dyn_CONFIGFILE;
 	int s;
@@ -206,7 +206,7 @@ int main(int argc, const char *argv[])
 		{"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"},
-		{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
+		POPT_COMMON_SAMBA
 		{0,0,0,0}
 	};
 
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/web/swat.c HEAD-ioctl/source/web/swat.c
--- HEAD/source/web/swat.c	Fri Mar 21 08:38:58 2003
+++ HEAD-ioctl/source/web/swat.c	Mon Mar 24 09:01:14 2003
@@ -1267,9 +1267,8 @@ static void printers_page(void)
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
 		{ "disable-authentication", 'a', POPT_ARG_VAL, &demo_mode, True, "Disable authentication (demo mode)" },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile},
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 
 	fault_setup(NULL);
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure --exclude=autom4te.cache HEAD/source/wrepld/server.c HEAD-ioctl/source/wrepld/server.c
--- HEAD/source/wrepld/server.c	Mon Mar 24 07:10:47 2003
+++ HEAD-ioctl/source/wrepld/server.c	Mon Mar 24 08:59:38 2003
@@ -510,17 +510,13 @@ static void process(void)
 	static BOOL log_stdout = False;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		POPT_COMMON_SAMBA
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
-		{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base },
 		{ "daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon (default)" },
 		{ "foreground", 'F', POPT_ARG_VAL, &Fork, False, "Run daemon in foreground (for daemontools, etc)" },
 		{ "stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
 		{ "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" },
-		{ 0, 0, 0, 0 }
+		POPT_COMMON_SAMBA
+		{ NULL }
 	};
 	int opt;
 	poptContext pc;
