summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-12-29 21:13:53 +0000
committerJeremy Allison <jra@samba.org>2001-12-29 21:13:53 +0000
commit0d6a1c09982f7497a4ea80f9c4db3bb249ccfa67 (patch)
tree36189a462619a98ead4dcddd60d7c647e202602a
parent11b14e838988e71880e707174493da5fd3b0b75a (diff)
downloadsamba-0d6a1c09982f7497a4ea80f9c4db3bb249ccfa67.tar.gz
samba-0d6a1c09982f7497a4ea80f9c4db3bb249ccfa67.tar.bz2
samba-0d6a1c09982f7497a4ea80f9c4db3bb249ccfa67.zip
Fixup -i interactive modes.
Jeremy. (This used to be commit 9343b613d3778b0330bc4d610d3befd363797360)
-rw-r--r--source3/nmbd/nmbd.c11
-rw-r--r--source3/smbd/server.c18
2 files changed, 18 insertions, 11 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 80d712036d..29b6c0347a 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -634,10 +634,11 @@ static BOOL init_structs(void)
static void usage(char *pname)
{
- printf( "Usage: %s [-DaohV] [-H lmhosts file] [-d debuglevel] [-l log basename]\n", pname );
+ printf( "Usage: %s [-DaiohV] [-H lmhosts file] [-d debuglevel] [-l log basename]\n", pname );
printf( " [-n name] [-p port] [-s configuration file]\n" );
- printf( "\t-D Become a daemon\n" );
+ printf( "\t-D Become a daemon (default)\n" );
printf( "\t-a Append to log file (default)\n" );
+ printf( "\t-i Run interactive (not a daemon)\n" );
printf( "\t-o Overwrite log file, don't append\n" );
printf( "\t-h Print usage\n" );
printf( "\t-V Print version\n" );
@@ -717,9 +718,9 @@ static void usage(char *pname)
case 'G':
DEBUG(0,("Obsolete option '%c' used\n",opt));
break;
- case 'i':
- opt_interactive = True;
- break;
+ case 'i':
+ opt_interactive = True;
+ break;
case 'H':
pstrcpy(dyn_LMHOSTSFILE, optarg);
break;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index c6eed4b9bb..403ed12c40 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -559,10 +559,11 @@ usage on the program
static void usage(char *pname)
{
- d_printf("Usage: %s [-DaoPh?Vb] [-d debuglevel] [-l log basename] [-p port]\n", pname);
+ d_printf("Usage: %s [-DaioPh?Vb] [-d debuglevel] [-l log basename] [-p port]\n", pname);
d_printf(" [-O socket options] [-s services file]\n");
- d_printf("\t-D Become a daemon\n");
+ d_printf("\t-D Become a daemon (default)\n");
d_printf("\t-a Append to log file (default)\n");
+ d_printf("\t-i Run interactive (not a daemon)\n" );
d_printf("\t-o Overwrite log file, don't append\n");
d_printf("\t-h Print usage\n");
d_printf("\t-? Print usage\n");
@@ -585,6 +586,7 @@ static void usage(char *pname)
extern char *optarg;
/* shall I run as a daemon */
BOOL is_daemon = False;
+ BOOL interactive = False;
BOOL specified_logfile = False;
int port = SMB_PORT;
int opt;
@@ -600,7 +602,7 @@ static void usage(char *pname)
argc--;
}
- while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?bVaof:")) )
+ while ( EOF != (opt = getopt(argc, argv, "O:l:s:d:Dp:h?bVaiof:")) )
switch (opt) {
case 'O':
pstrcpy(user_socket_options,optarg);
@@ -620,6 +622,10 @@ static void usage(char *pname)
append_log = True;
break;
+ case 'i':
+ interactive = True;
+ break;
+
case 'o':
append_log = False;
break;
@@ -678,7 +684,7 @@ static void usage(char *pname)
pstrcpy(remote_machine, "smbd");
- setup_logging(argv[0],False);
+ setup_logging(argv[0],interactive);
/* we want to re-seed early to prevent time delays causing
client problems at a later date. (tridge) */
@@ -720,7 +726,7 @@ static void usage(char *pname)
reopen_logs();
DEBUG(1,( "smbd version %s started.\n", VERSION));
- DEBUGADD(1,( "Copyright Andrew Tridgell 1992-1998\n"));
+ DEBUGADD(1,( "Copyright Andrew Tridgell 1992-2002\n"));
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
(int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid()));
@@ -774,7 +780,7 @@ static void usage(char *pname)
is_daemon = True;
}
- if (is_daemon) {
+ if (is_daemon && !interactive) {
DEBUG( 3, ( "Becoming a daemon.\n" ) );
become_daemon();
}