mirror of
https://github.com/samba-team/samba.git
synced 2025-11-21 12:23:50 +03:00
r22213: We can't use become_root() here, as it does DEBUG()
itself. become_root_uid_only did not :-) Revert 21868, we need to find a better way. Volker
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
6cf0b93b1d
commit
629f966714
@@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user