svn commit: samba r16894 - in trunk/source: param rpc_server services

vlendec at samba.org vlendec at samba.org
Sun Jul 9 12:54:45 GMT 2006


Author: vlendec
Date: 2006-07-09 12:54:45 +0000 (Sun, 09 Jul 2006)
New Revision: 16894

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16894

Log:
Introduce a function share_defined.

Jerry, while looking for possible usages of this function I came across
srv_spoolss_nt.c:334. To me this looks like reversed logic.

Volker

Modified:
   trunk/source/param/loadparm.c
   trunk/source/rpc_server/srv_spoolss_nt.c
   trunk/source/rpc_server/srv_svcctl_nt.c
   trunk/source/services/svc_netlogon.c


Changeset:
Modified: trunk/source/param/loadparm.c
===================================================================
--- trunk/source/param/loadparm.c	2006-07-09 12:30:48 UTC (rev 16893)
+++ trunk/source/param/loadparm.c	2006-07-09 12:54:45 UTC (rev 16894)
@@ -5126,6 +5126,11 @@
 	return (iService);
 }
 
+BOOL share_defined(const char *service_name)
+{
+	return (lp_servicenumber(service_name) != -1);
+}
+
 /*******************************************************************
  A useful volume label function. 
 ********************************************************************/

Modified: trunk/source/rpc_server/srv_spoolss_nt.c
===================================================================
--- trunk/source/rpc_server/srv_spoolss_nt.c	2006-07-09 12:30:48 UTC (rev 16893)
+++ trunk/source/rpc_server/srv_spoolss_nt.c	2006-07-09 12:54:45 UTC (rev 16894)
@@ -331,7 +331,7 @@
 	/* go ahead and re-read the services immediately */
 	reload_services( False );
 	
-	if ( lp_servicenumber( sharename )  < 0 )
+	if ( !share_defined( sharename ) )
 		return WERR_ACCESS_DENIED;
 		
 	return WERR_OK;

Modified: trunk/source/rpc_server/srv_svcctl_nt.c
===================================================================
--- trunk/source/rpc_server/srv_svcctl_nt.c	2006-07-09 12:30:48 UTC (rev 16893)
+++ trunk/source/rpc_server/srv_svcctl_nt.c	2006-07-09 12:54:45 UTC (rev 16894)
@@ -624,7 +624,7 @@
 	   the client from showing the "Start" button (if of course the services
 	   are not running */
 
-	if ( strequal( name, "NETLOGON" ) && ( lp_servicenumber(name) == -1 ) )
+	if ( strequal( name, "NETLOGON" ) && ( !share_defined(name) ) )
 		config->start_type = SVCCTL_DISABLED;
 	else if ( strequal( name, "WINS" ) && ( !lp_wins_support() ))
 		config->start_type = SVCCTL_DISABLED;

Modified: trunk/source/services/svc_netlogon.c
===================================================================
--- trunk/source/services/svc_netlogon.c	2006-07-09 12:30:48 UTC (rev 16893)
+++ trunk/source/services/svc_netlogon.c	2006-07-09 12:54:45 UTC (rev 16894)
@@ -32,7 +32,7 @@
         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_start( const char *service )
 {
-	if ( lp_servicenumber("NETLOGON") == -1 )
+	if ( share_defined("NETLOGON") )
 		return WERR_SERVICE_DISABLED;
 
 	return WERR_ACCESS_DENIED;



More information about the samba-cvs mailing list