From 2851e43e4881485b0af418975eca8f01ab27ca3b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Jun 2005 00:54:43 +0000 Subject: r7595: start trying to split out the svcctl functions into separate files for better maintenance; add SERVICE_CONTROL_OPS for spoolss service (This used to be commit 2b0ea30a1a3aebaabd5d328de50e6ad2ef18d45d) --- source3/services/svc_spoolss.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 source3/services/svc_spoolss.c (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c new file mode 100644 index 0000000000..991bc0fbfd --- /dev/null +++ b/source3/services/svc_spoolss.c @@ -0,0 +1,58 @@ +/* + * Unix SMB/CIFS implementation. + * Service Control API Implementation + * Copyright (C) Gerald Carter 2005. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "includes.h" + +/* Implementation for internal spoolss service */ + +/********************************************************************* +*********************************************************************/ + +static WERROR spoolss_stop( void ) +{ + return WERR_OK; +} + +/********************************************************************* +*********************************************************************/ + +static WERROR spoolss_start( void ) +{ + return WERR_OK; +} + +/********************************************************************* +*********************************************************************/ + +static WERROR spoolss_status( SERVICE_STATUS *service_status ) +{ + return WERR_OK; +} + +/********************************************************************* +*********************************************************************/ + +/* struct for svcctl control to manipulate spoolss service */ + +SERVICE_CONTROL_OPS spoolss_svc_ops = { + spoolss_stop, + spoolss_start, + spoolss_status +}; -- cgit From 899bc3a07df4ce1f77efc1abce7c3a2e855069e5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Jun 2005 03:10:36 +0000 Subject: r7603: * fix a bug in the SERVICE_ALL_ACCESS security mask * add calls to start and stop a service (to be filled in by the backend routines in services/svc_*.c (This used to be commit 793d28a946d83beb2576c5c8ce808d32c71c880a) --- source3/services/svc_spoolss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c index 991bc0fbfd..bd2f7173f1 100644 --- a/source3/services/svc_spoolss.c +++ b/source3/services/svc_spoolss.c @@ -25,7 +25,7 @@ /********************************************************************* *********************************************************************/ -static WERROR spoolss_stop( void ) +static WERROR spoolss_stop( SERVICE_STATUS *service_status ) { return WERR_OK; } -- cgit 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 From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/services/svc_spoolss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c index 5f8fa73ced..13a1dbb1bd 100644 --- a/source3/services/svc_spoolss.c +++ b/source3/services/svc_spoolss.c @@ -25,7 +25,7 @@ /********************************************************************* *********************************************************************/ -static WERROR spoolss_stop( SERVICE_STATUS *service_status ) +static WERROR spoolss_stop( const char *service, SERVICE_STATUS *service_status ) { ZERO_STRUCTP( service_status ); @@ -43,7 +43,7 @@ static WERROR spoolss_stop( SERVICE_STATUS *service_status ) /********************************************************************* *********************************************************************/ -static WERROR spoolss_start( void ) +static WERROR spoolss_start( const char *service ) { /* see if the smb.conf will support this anyways */ @@ -58,8 +58,10 @@ static WERROR spoolss_start( void ) /********************************************************************* *********************************************************************/ -static WERROR spoolss_status( SERVICE_STATUS *service_status ) +static WERROR spoolss_status( const char *service, SERVICE_STATUS *service_status ) { + ZERO_STRUCTP( service_status ); + service_status->type = 0x110; service_status->state = lp_get_spoolss_state(); service_status->controls_accepted = SVCCTL_ACCEPT_STOP; -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/services/svc_spoolss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c index 13a1dbb1bd..c7b1ccf1de 100644 --- a/source3/services/svc_spoolss.c +++ b/source3/services/svc_spoolss.c @@ -5,7 +5,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/services/svc_spoolss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/services/svc_spoolss.c') diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c index c7b1ccf1de..9d4113cadf 100644 --- a/source3/services/svc_spoolss.c +++ b/source3/services/svc_spoolss.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ #include "includes.h" -- cgit