From 5b678f7a8469e345a6b25fa19ea1a20fce939a21 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Jun 2005 15:18:18 +0000 Subject: 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) --- source3/services/svc_spoolss.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c index bd2f7173f1..5f8fa73ced 100644 --- a/source3/services/svc_spoolss.c +++ b/source3/services/svc_spoolss.c @@ -27,6 +27,16 @@ static WERROR spoolss_stop( SERVICE_STATUS *service_status ) { + ZERO_STRUCTP( service_status ); + + lp_set_spoolss_state( SVCCTL_STOPPED ); + + service_status->type = 0x110; + service_status->state = SVCCTL_STOPPED; + service_status->controls_accepted = SVCCTL_ACCEPT_STOP; + + DEBUG(6,("spoolss_stop: spooler stopped (not really)\n")); + return WERR_OK; } @@ -35,6 +45,13 @@ static WERROR spoolss_stop( SERVICE_STATUS *service_status ) static WERROR spoolss_start( void ) { + /* see if the smb.conf will support this anyways */ + + if ( _lp_disable_spoolss() ) + return WERR_ACCESS_DENIED; + + lp_set_spoolss_state( SVCCTL_RUNNING ); + return WERR_OK; } @@ -43,6 +60,10 @@ static WERROR spoolss_start( void ) static WERROR spoolss_status( SERVICE_STATUS *service_status ) { + service_status->type = 0x110; + service_status->state = lp_get_spoolss_state(); + service_status->controls_accepted = SVCCTL_ACCEPT_STOP; + return WERR_OK; } -- cgit