summaryrefslogtreecommitdiff
path: root/source3/services
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-12-11 04:21:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:47 -0500
commita48955306705ac7f045e3726d7097900550bebe3 (patch)
tree75e4c9f289256f9553f947c76602aba9f1dd7553 /source3/services
parent1e0684678eb1851735c9a3321837ad19ea4aba68 (diff)
downloadsamba-a48955306705ac7f045e3726d7097900550bebe3.tar.gz
samba-a48955306705ac7f045e3726d7097900550bebe3.tar.bz2
samba-a48955306705ac7f045e3726d7097900550bebe3.zip
r12173: doing some service control work
* Add a few new error codes for disabled services * dump some more details about service status in 'net rpc service' * disable the WINS and NetLogon services if not configured in smb.conf Still trying to figure out how to disable the start button on the NetLogon and WINS services. (This used to be commit c0f54eeebc84ec9fab63c5b105511762bcc136be)
Diffstat (limited to 'source3/services')
-rw-r--r--source3/services/svc_netlogon.c33
-rw-r--r--source3/services/svc_wins.c32
2 files changed, 40 insertions, 25 deletions
diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c
index 2aa5a31cde..1bbef325ac 100644
--- a/source3/services/svc_netlogon.c
+++ b/source3/services/svc_netlogon.c
@@ -25,33 +25,42 @@
/*********************************************************************
*********************************************************************/
-static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status )
+static WERROR netlogon_status( const char *service, SERVICE_STATUS *service_status )
{
- return WERR_ACCESS_DENIED;
+ ZERO_STRUCTP( service_status );
+
+ service_status->type = 0x20;
+ service_status->controls_accepted = SVCCTL_ACCEPT_NONE;
+
+ if ( lp_servicenumber("NETLOGON") != -1 ) {
+ service_status->state = SVCCTL_RUNNING;
+ service_status->win32_exit_code = WERR_SERVICE_NEVER_STARTED;
+ }
+ else
+ service_status->state = SVCCTL_STOPPED;
+
+ return WERR_OK;
}
/*********************************************************************
*********************************************************************/
-static WERROR netlogon_start( const char *service )
+static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status )
{
+ netlogon_status( service, service_status );
+
return WERR_ACCESS_DENIED;
}
/*********************************************************************
*********************************************************************/
-static WERROR netlogon_status( const char *service, SERVICE_STATUS *service_status )
+static WERROR netlogon_start( const char *service )
{
- ZERO_STRUCTP( service_status );
+ if ( lp_servicenumber("NETLOGON") == -1 )
+ return WERR_SERVICE_DISABLED;
- service_status->type = 0x20;
- if ( lp_servicenumber("NETLOGON") != -1 )
- service_status->state = SVCCTL_RUNNING;
- else
- service_status->state = SVCCTL_STOPPED;
-
- return WERR_OK;
+ return WERR_ACCESS_DENIED;
}
/*********************************************************************
diff --git a/source3/services/svc_wins.c b/source3/services/svc_wins.c
index 3a4650664d..37cfc99c06 100644
--- a/source3/services/svc_wins.c
+++ b/source3/services/svc_wins.c
@@ -25,33 +25,39 @@
/*********************************************************************
*********************************************************************/
-static WERROR wins_stop( const char *service, SERVICE_STATUS *service_status )
+static WERROR wins_status( const char *service, SERVICE_STATUS *service_status )
{
- return WERR_ACCESS_DENIED;
+ ZERO_STRUCTP( service_status );
+
+ service_status->type = 0x10;
+ service_status->controls_accepted = SVCCTL_ACCEPT_NONE;
+
+ if ( lp_wins_support() )
+ service_status->state = SVCCTL_RUNNING;
+ else {
+ service_status->state = SVCCTL_STOPPED;
+ service_status->win32_exit_code = WERR_SERVICE_NEVER_STARTED;
+ }
+
+ return WERR_OK;
}
/*********************************************************************
*********************************************************************/
-static WERROR wins_start( const char *service )
+static WERROR wins_stop( const char *service, SERVICE_STATUS *service_status )
{
+ wins_status( service, service_status );
+
return WERR_ACCESS_DENIED;
}
/*********************************************************************
*********************************************************************/
-static WERROR wins_status( const char *service, SERVICE_STATUS *service_status )
+static WERROR wins_start( const char *service )
{
- ZERO_STRUCTP( service_status );
-
- service_status->type = 0x10;
- if ( lp_wins_support() )
- service_status->state = SVCCTL_RUNNING;
- else
- service_status->state = SVCCTL_STOPPED;
-
- return WERR_OK;
+ return WERR_ACCESS_DENIED;
}
/*********************************************************************