r21547: Fix from Michael Adam <ma@sernet.de>: Refuse registry shares without path.
authorVolker Lendecke <vlendec@samba.org>
Mon, 26 Feb 2007 20:14:35 +0000 (20:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:11 +0000 (12:18 -0500)
Thanks,

Volker

source/param/loadparm.c
source/smbd/service.c

index 8849d2dea7c1a2063dfc6be028cbb722b9e48f62..b90b53c16bb8c52f2594f1c96f98c2b5906ac652 100644 (file)
@@ -2157,7 +2157,6 @@ static int getservicebyname(const char *pszServiceName,
                            service * pserviceDest);
 static void copy_service(service * pserviceDest,
                         service * pserviceSource, BOOL *pcopymapDest);
-static BOOL service_ok(int iService);
 static BOOL do_parameter(const char *pszParmName, const char *pszParmValue);
 static BOOL do_section(const char *pszSectionName);
 static void init_copymap(service * pservice);
@@ -2977,7 +2976,7 @@ Check a service for consistency. Return False if the service is in any way
 incomplete or faulty, else True.
 ***************************************************************************/
 
-static BOOL service_ok(int iService)
+BOOL service_ok(int iService)
 {
        BOOL bRetval;
 
@@ -3010,7 +3009,7 @@ static BOOL service_ok(int iService)
                ServicePtrs[iService]->bAvailable = False;
        }
 
-       /* If a service is flagged unavailable, log the fact at level 0. */
+       /* If a service is flagged unavailable, log the fact at level 1. */
        if (!ServicePtrs[iService]->bAvailable)
                DEBUG(1, ("NOTE: Service %s is flagged unavailable.\n",
                          ServicePtrs[iService]->szService));
index de2bfd91004fc0b024e4f5cf7cdb30f3bc6299ea..c96bcea4e23172d1856f05472661f72f941cf6af 100644 (file)
@@ -313,6 +313,14 @@ static int load_registry_service(const char *servicename)
                TALLOC_FREE(value);
        }
 
+       if (!service_ok(res)) {
+               /* this is actually never reached, since 
+                * service_ok only returns False if the service
+                * entry does not have a service name, and we _know_
+                * we do have a service name here... */
+               res = -1;
+       }
+
  error:
 
        TALLOC_FREE(key);