diff options
author | Gerald Carter <jerry@samba.org> | 2005-06-15 15:18:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:16 -0500 |
commit | f19c10d0c3e7701066b765c712df0636e914bf7e (patch) | |
tree | af72ad610c894edb4d51f5985942d41ae2df1237 /source/param | |
parent | 2c68568e5232c057d4f76f4bb044c54d18272602 (diff) | |
download | samba-f19c10d0c3e7701066b765c712df0636e914bf7e.tar.gz samba-f19c10d0c3e7701066b765c712df0636e914bf7e.tar.xz samba-f19c10d0c3e7701066b765c712df0636e914bf7e.zip |
r7610: can successfully stop and start the 'spooler' service by setting the state for the 'disable spoolss' parameter in memory for an individual smbd
Diffstat (limited to 'source/param')
-rw-r--r-- | source/param/loadparm.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c index bfd7b650cbe..0083b508208 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -1860,7 +1860,7 @@ FN_GLOBAL_BOOL(lp_paranoid_server_security, &Globals.paranoid_server_security) FN_GLOBAL_INTEGER(lp_maxdisksize, &Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime, &Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_max_smbd_processes, &Globals.iMaxSmbdProcesses) -FN_GLOBAL_INTEGER(lp_disable_spoolss, &Globals.bDisableSpoolss) +FN_GLOBAL_INTEGER(_lp_disable_spoolss, &Globals.bDisableSpoolss) FN_GLOBAL_INTEGER(lp_syslog, &Globals.syslog) static FN_GLOBAL_INTEGER(lp_announce_as, &Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce, &Globals.lm_announce) @@ -4466,6 +4466,32 @@ const char *lp_printcapname(void) Ensure we don't use sendfile if server smb signing is active. ********************************************************************/ +static uint32 spoolss_state; + +BOOL lp_disable_spoolss( void ) +{ + if ( spoolss_state == SVCCTL_STATE_UNKNOWN ) + spoolss_state = _lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING; + + return spoolss_state == SVCCTL_STOPPED ? True : False; +} + +void lp_set_spoolss_state( uint32 state ) +{ + SMB_ASSERT( (state == SVCCTL_STOPPED) || (state == SVCCTL_RUNNING) ); + + spoolss_state = state; +} + +uint32 lp_get_spoolss_state( void ) +{ + return lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING; +} + +/******************************************************************* + Ensure we don't use sendfile if server smb signing is active. +********************************************************************/ + BOOL lp_use_sendfile(int snum) { /* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */ |