Compleatly remove support for logfile truncation. All logs are opened for
authorAndrew Bartlett <abartlet@samba.org>
Fri, 8 Nov 2002 23:05:34 +0000 (23:05 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 8 Nov 2002 23:05:34 +0000 (23:05 +0000)
append writes.

(blessed by jra)

Andrew Bartlett

source/lib/debug.c
source/nmbd/nmbd.c
source/nsswitch/winbindd.c
source/smbd/server.c
source/wrepld/server.c

index 483db71b852424dbfff9d058aa93c22cd3788260..f2a362bb8601c2da1ab122bd790a2a48c6d97fc9 100644 (file)
  *
  *  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 )
         {
index 9f4a934fae8d180ffc18a9b82e907da8d823c732..50730d40f35ffa11ce34bca796d44482e8d813e7 100644 (file)
@@ -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;
 
index 059d2f40d3eff67d762699455d62bfc3ecb1c380..2bd6d7967c226c4222c55b10ccbd1cb4660be3fa 100644 (file)
@@ -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);
 
index 1272fb1569ecd0c8bc5c0cd83b345f6640674af5..3d9a4675b2b4e8b6b02feb3b20b881fe421f9f2c 100644 (file)
@@ -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
index 14d3e730f475f0e9c25b26519dd99fe4da4fc65f..f08674afbb2158a9ab18fc753a281fbc1b513bb7 100644 (file)
@@ -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);