diff options
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r-- | source3/lib/debug.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 138c52cdce..62fda5741c 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -688,15 +688,20 @@ void check_log_size( void ) int maxlog; SMB_STRUCT_STAT st; + /* + * We need to be root to check/change log-file, skip this and let the main + * loop check do a new check as root. + */ + + if( geteuid() != 0 ) + return; + if(log_overflow || !need_to_check_log_size() ) return; maxlog = lp_max_log_size() * 1024; if( sys_fstat( x_fileno( dbf ), &st ) == 0 && st.st_size > maxlog ) { - - become_root(); - (void)reopen_logs(); if( dbf && get_file_size( debugf ) > maxlog ) { pstring name; @@ -709,8 +714,6 @@ void check_log_size( void ) (void)rename(name, debugf); } } - - unbecome_root(); } /* |