summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-11-08 23:05:34 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-11-08 23:05:34 +0000
commitc501ac2bfa4b9fa88c402bb0313312ea0f565443 (patch)
tree5c753104c95368c9947f70390e01ac412e0d9762 /source3
parent48b32cd865b572c797e6f5de1b8a574bd86e250a (diff)
Compleatly remove support for logfile truncation. All logs are opened for
append writes. (blessed by jra) Andrew Bartlett (This used to be commit 81633064dd196c40541ecece8def51745f514646)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/debug.c13
-rw-r--r--source3/nmbd/nmbd.c5
-rw-r--r--source3/nsswitch/winbindd.c6
-rw-r--r--source3/smbd/server.c3
-rw-r--r--source3/wrepld/server.c11
5 files changed, 2 insertions, 36 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 483db71b85..f2a362bb86 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -74,15 +74,12 @@
*
* dbf - Global debug file handle.
* debugf - Debug file name.
- * append_log - If True, then the output file will be opened in append
- * mode.
* DEBUGLEVEL - System-wide debug message limit. Messages with message-
* levels higher than DEBUGLEVEL will not be processed.
*/
XFILE *dbf = NULL;
pstring debugf = "";
-BOOL append_log = False;
BOOL debug_warn_unknown_class = True;
BOOL debug_auto_add_unknown_class = True;
BOOL AllowDebugChange = True;
@@ -576,10 +573,7 @@ BOOL reopen_logs( void )
}
pstrcpy( debugf, fname );
- if (append_log)
- new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644);
- else
- new_dbf = x_fopen( debugf, O_WRONLY|O_CREAT|O_TRUNC, 0644 );
+ new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644);
if (!new_dbf) {
log_overflow = True;
@@ -731,10 +725,7 @@ void check_log_size( void )
{
mode_t oldumask = umask( 022 );
- if( append_log )
- dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644 );
- else
- dbf = x_fopen( debugf, O_WRONLY|O_CREAT|O_TRUNC, 0644 );
+ dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644 );
(void)umask( oldumask );
if( dbf )
{
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 9f4a934fae..50730d40f3 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -661,15 +661,12 @@ static BOOL init_structs(void)
**************************************************************************** */
int main(int argc, const char *argv[])
{
- extern BOOL append_log;
static BOOL opt_interactive = False;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
{"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon(default)" },
- {"log-append", 'a', POPT_ARG_VAL, &append_log, True, "Append to log file" },
{"interactive", 'i', POPT_ARG_VAL, &opt_interactive, True, "Run interactive (not a daemon)" },
- {"log-overwrite", 'o', POPT_ARG_VAL, &append_log, False, "Overwrite log file, don't append" },
{"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" },
{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
@@ -683,8 +680,6 @@ static BOOL init_structs(void)
int opt;
pstring logfile;
- append_log = True; /* Default, override with '-o' option. */
-
global_nmb_port = NMB_PORT;
global_in_nmbd = True;
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 059d2f40d3..2bd6d7967c 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -746,7 +746,6 @@ static void usage(void)
extern BOOL AllowDebugChange;
extern pstring global_myname;
extern fstring global_myworkgroup;
- extern BOOL append_log;
pstring logfile;
BOOL interactive = False;
int opt;
@@ -759,11 +758,6 @@ static void usage(void)
fault_setup((void (*)(void *))fault_quit );
- /* Append to log file by default as we are a single process daemon
- program. */
-
- append_log = True;
-
snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
lp_set_logfile(logfile);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 1272fb1569..3d9a4675b2 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -622,7 +622,6 @@ static void init_structs(void )
static BOOL is_daemon = False;
static BOOL interactive = False;
static char *ports = NULL;
- extern BOOL append_log;
int opt;
poptContext pc;
@@ -640,8 +639,6 @@ static void init_structs(void )
{ NULL }
};
- append_log = True;
-
#ifdef HAVE_SET_AUTH_PARAMETERS
set_auth_parameters(argc,argv);
#endif
diff --git a/source3/wrepld/server.c b/source3/wrepld/server.c
index 14d3e730f4..f08674afbb 100644
--- a/source3/wrepld/server.c
+++ b/source3/wrepld/server.c
@@ -541,7 +541,6 @@ static void process(void)
****************************************************************************/
int main(int argc,char *argv[])
{
- extern BOOL append_log;
extern char *optarg;
/* shall I run as a daemon */
BOOL is_daemon = False;
@@ -576,18 +575,10 @@ static void process(void)
lp_set_logfile(logfile);
break;
- case 'a':
- append_log = True;
- break;
-
case 'i':
interactive = True;
break;
- case 'o':
- append_log = False;
- break;
-
case 'D':
is_daemon = True;
break;
@@ -628,8 +619,6 @@ static void process(void)
load_case_tables();
- append_log = True;
-
if(!specified_logfile) {
slprintf(logfile, sizeof(logfile)-1, "%s/log.wrepld",
dyn_LOGFILEBASE);