From: Volker Lendecke Date: Mon, 26 Feb 2007 20:14:35 +0000 (+0000) Subject: r21547: Fix from Michael Adam : Refuse registry shares without path. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~1063 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e795865d58472498097edc3fb68438ed08c38d8d;p=thirdparty%2Fsamba.git r21547: Fix from Michael Adam : Refuse registry shares without path. Thanks, Volker --- diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 8849d2dea7c..b90b53c16bb 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -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)); diff --git a/source/smbd/service.c b/source/smbd/service.c index de2bfd91004..c96bcea4e23 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -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);