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_netlogon.c | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 source3/services/svc_netlogon.c (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c new file mode 100644 index 0000000000..2aa5a31cde --- /dev/null +++ b/source3/services/svc_netlogon.c @@ -0,0 +1,66 @@ +/* + * 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 netlogon service */ + +/********************************************************************* +*********************************************************************/ + +static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status ) +{ + return WERR_ACCESS_DENIED; +} + +/********************************************************************* +*********************************************************************/ + +static WERROR netlogon_start( const char *service ) +{ + return WERR_ACCESS_DENIED; +} + +/********************************************************************* +*********************************************************************/ + +static WERROR netlogon_status( const char *service, SERVICE_STATUS *service_status ) +{ + ZERO_STRUCTP( service_status ); + + service_status->type = 0x20; + if ( lp_servicenumber("NETLOGON") != -1 ) + service_status->state = SVCCTL_RUNNING; + else + service_status->state = SVCCTL_STOPPED; + + return WERR_OK; +} + +/********************************************************************* +*********************************************************************/ + +/* struct for svcctl control to manipulate netlogon service */ + +SERVICE_CONTROL_OPS netlogon_svc_ops = { + netlogon_stop, + netlogon_start, + netlogon_status +}; -- cgit From a48955306705ac7f045e3726d7097900550bebe3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 11 Dec 2005 04:21:34 +0000 Subject: 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) --- source3/services/svc_netlogon.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'source3/services/svc_netlogon.c') 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; } /********************************************************************* -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/services/svc_netlogon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c index 1bbef325ac..c561870552 100644 --- a/source3/services/svc_netlogon.c +++ b/source3/services/svc_netlogon.c @@ -32,7 +32,7 @@ static WERROR netlogon_status( const char *service, SERVICE_STATUS *service_stat service_status->type = 0x20; service_status->controls_accepted = SVCCTL_ACCEPT_NONE; - if ( lp_servicenumber("NETLOGON") != -1 ) { + if ( share_defined("NETLOGON") ) { service_status->state = SVCCTL_RUNNING; service_status->win32_exit_code = WERR_SERVICE_NEVER_STARTED; } @@ -57,7 +57,7 @@ static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status static WERROR netlogon_start( const char *service ) { - if ( lp_servicenumber("NETLOGON") == -1 ) + if ( share_defined("NETLOGON") ) return WERR_SERVICE_DISABLED; return WERR_ACCESS_DENIED; -- cgit From ff61853fb35953f7e4f210ce3e5a82e6da15534e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 7 Dec 2006 19:21:37 +0000 Subject: r20069: Fix logic bug I introduced (This used to be commit d935ecec98747dfd9f35ab81760ef95a0d983ed7) --- source3/services/svc_netlogon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c index c561870552..09e841cf7e 100644 --- a/source3/services/svc_netlogon.c +++ b/source3/services/svc_netlogon.c @@ -57,7 +57,7 @@ static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status static WERROR netlogon_start( const char *service ) { - if ( share_defined("NETLOGON") ) + if ( !share_defined("NETLOGON") ) return WERR_SERVICE_DISABLED; return WERR_ACCESS_DENIED; -- 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_netlogon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c index 09e841cf7e..ec379371f0 100644 --- a/source3/services/svc_netlogon.c +++ b/source3/services/svc_netlogon.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_netlogon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c index ec379371f0..11185fd116 100644 --- a/source3/services/svc_netlogon.c +++ b/source3/services/svc_netlogon.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 From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/services/svc_netlogon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/services/svc_netlogon.c') diff --git a/source3/services/svc_netlogon.c b/source3/services/svc_netlogon.c index 11185fd116..c5a5385cdd 100644 --- a/source3/services/svc_netlogon.c +++ b/source3/services/svc_netlogon.c @@ -31,7 +31,7 @@ static WERROR netlogon_status( const char *service, SERVICE_STATUS *service_stat service_status->type = 0x20; service_status->controls_accepted = SVCCTL_ACCEPT_NONE; - if ( share_defined("NETLOGON") ) { + if ( lp_servicenumber("NETLOGON") != -1 ) { service_status->state = SVCCTL_RUNNING; service_status->win32_exit_code = WERR_SERVICE_NEVER_STARTED; } @@ -56,7 +56,7 @@ static WERROR netlogon_stop( const char *service, SERVICE_STATUS *service_status static WERROR netlogon_start( const char *service ) { - if ( !share_defined("NETLOGON") ) + if ( lp_servicenumber("NETLOGON") == -1 ) return WERR_SERVICE_DISABLED; return WERR_ACCESS_DENIED; -- cgit