summaryrefslogtreecommitdiffstats
path: root/source/nmbd/nmbd.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-08-21 17:21:55 +0000
committerChristopher R. Hertel <crh@samba.org>1998-08-21 17:21:55 +0000
commitb1d374fb14b1fb92a84260f1dcc59a39a4b99a3d (patch)
tree6ffcf18a115e31bd638d9cde0925162b95d09488 /source/nmbd/nmbd.c
parentd2fb7ee8f55dd1ff25fca46e18b02a05bc2b71ae (diff)
downloadsamba-b1d374fb14b1fb92a84260f1dcc59a39a4b99a3d.tar.gz
samba-b1d374fb14b1fb92a84260f1dcc59a39a4b99a3d.tar.xz
samba-b1d374fb14b1fb92a84260f1dcc59a39a4b99a3d.zip
nmbd and smbd had different behavior with respect to log files. nmbd would
default to overwrite and smbd would default to append. Also, the -a option (actually a toggle, such that "-a -a" would set the default) was documented as append mode for nmbd, and *overwrite mode* for smbd. nmbd now defaults to append mode, to match smbd. The -a option now always means append, and I've added the -o option to both, meaning overwrite. Note that the change to nmbd's default behavior may confuse some people. I've not seen anything about 2.0.0 changes in the WHATSNEW.txt file. Where would I document a change like this? Chris -)-----
Diffstat (limited to 'source/nmbd/nmbd.c')
-rw-r--r--source/nmbd/nmbd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index 9eae3b0e987..9b872f8ffe0 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -534,6 +534,8 @@ static void usage(char *pname)
printf( "\t-n netbiosname. " );
printf( "the netbios name to advertise for this host\n");
printf( "\t-H hosts file load a netbios hosts file\n" );
+ printf( "\t-a append to log file (default)\n" );
+ printf( "\t-o overwrite log file, don't append\n" );
printf( "\n");
} /* usage */
@@ -546,6 +548,9 @@ int main(int argc,char *argv[])
int opt;
extern FILE *dbf;
extern char *optarg;
+ extern BOOL append_log;
+
+ append_log = True; /* Default, override with '-o' option. */
global_nmb_port = NMB_PORT;
*host_file = 0;
@@ -595,7 +600,8 @@ int main(int argc,char *argv[])
#endif /* SIGUSR2 */
#endif /* MEM_MAN */
- while((opt = getopt(argc, argv, "as:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:")) != EOF)
+ while( EOF !=
+ (opt = getopt( argc, argv, "aos:T:I:C:bAi:B:N:Rn:l:d:Dp:hSH:G:f:" )) )
{
switch (opt)
{
@@ -624,10 +630,10 @@ int main(int argc,char *argv[])
strupper(scope);
break;
case 'a':
- {
- extern BOOL append_log;
- append_log = !append_log;
- }
+ append_log = True;
+ break;
+ case 'o':
+ append_log = False;
break;
case 'D':
is_daemon = True;