summaryrefslogtreecommitdiff
path: root/source3/param/loadparm.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-15 15:18:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:16 -0500
commit5b678f7a8469e345a6b25fa19ea1a20fce939a21 (patch)
tree6699c3a948622073982cf78897c2f011be5e7d84 /source3/param/loadparm.c
parent7cbd740c62238406e64819e3594caeca341a25c9 (diff)
downloadsamba-5b678f7a8469e345a6b25fa19ea1a20fce939a21.tar.gz
samba-5b678f7a8469e345a6b25fa19ea1a20fce939a21.tar.bz2
samba-5b678f7a8469e345a6b25fa19ea1a20fce939a21.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
(This used to be commit f19c10d0c3e7701066b765c712df0636e914bf7e)
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r--source3/param/loadparm.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index bfd7b650cb..0083b50820 100644
--- a/source3/param/loadparm.c
+++ b/source3/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. */