summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-10 21:52:31 +0000
committerJeremy Allison <jra@samba.org>2000-10-10 21:52:31 +0000
commitcdb71ca5181aa1e06bebe2fffb02dc39de83645e (patch)
tree19b23d77aa31da1d109bf54cc03b18111a05b083 /source3/smbd
parente8912baf025a1356aa8c02f971fbe3d67adc9b0a (diff)
downloadsamba-cdb71ca5181aa1e06bebe2fffb02dc39de83645e.tar.gz
samba-cdb71ca5181aa1e06bebe2fffb02dc39de83645e.tar.bz2
samba-cdb71ca5181aa1e06bebe2fffb02dc39de83645e.zip
Fixes to periodically scan printing.tdb in idle time and occasionally
on exit. Needed to fix printing.tdb from groving to 300Mb+ if being driven by smbclient clients that never ask for status... (effective DOS attack :-). Jeremy. (This used to be commit 6581066b93a674fadf6f9b92441428d2cc8b4a02)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c6
-rw-r--r--source3/smbd/server.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 1599ade12d..9ed83ec88c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -994,6 +994,12 @@ machine %s in domain %s.\n", global_myname, global_myworkgroup ));
process_pending_change_notify_queue(t);
/*
+ * Ensure the print queue tdb doesn't grow too
+ * big by periodically scanning it.
+ */
+ process_print_queue(t);
+
+ /*
* Now we are root, check if the log files need pruning.
*/
if(need_to_check_log_size())
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 4442a1f71f..22a95fdd18 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -422,6 +422,10 @@ void exit_server(char *reason)
respond_to_all_remaining_local_messages();
+ /* Don't do this on every exit... */
+ if (sys_random() % 10)
+ process_print_queue(time(NULL));
+
#ifdef WITH_DFS
if (dcelogin_atmost_once) {
dfs_unlogin();