summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-03-18 10:13:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:41 -0500
commit8d0cfddb26a354606844a10254055fb8cd54e792 (patch)
tree105c6c04e7e8739fb7854df80aceb6acd4db7658 /source3/lib/debug.c
parent2864d86b37fe29ba2e985b61e646061feb0b841f (diff)
downloadsamba-8d0cfddb26a354606844a10254055fb8cd54e792.tar.gz
samba-8d0cfddb26a354606844a10254055fb8cd54e792.tar.bz2
samba-8d0cfddb26a354606844a10254055fb8cd54e792.zip
r21868: Remove check_log_size from the central smbd processing loop. This can be done
with a become_root/unbecome_root in debug.c. (This used to be commit 4632a0caaf251d9cc7b9d84cbd20362d37f0e4e0)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r--source3/lib/debug.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 62fda5741c..a2e8574bbd 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -688,20 +688,15 @@ 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_uid_only();
+
(void)reopen_logs();
if( dbf && get_file_size( debugf ) > maxlog ) {
pstring name;
@@ -714,6 +709,8 @@ void check_log_size( void )
(void)rename(name, debugf);
}
}
+
+ unbecome_root_uid_only();
}
/*