diff options
Diffstat (limited to 'source/smbd/service.c')
-rw-r--r-- | source/smbd/service.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source/smbd/service.c b/source/smbd/service.c index 18db2f8aba2..8653800aa0f 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -312,6 +312,13 @@ int find_service(fstring service) if (iService < 0) { } + /* Is it a usershare service ? */ + if (iService < 0 && *lp_usershare_path()) { + /* Ensure the name is canonicalized. */ + strlower_m(service); + iService = load_usershare_service(service); + } + /* just possibly it's a default service? */ if (iService < 0) { char *pdefservice = lp_defaultservice(); @@ -324,6 +331,14 @@ int find_service(fstring service) */ pstring defservice; pstrcpy(defservice, pdefservice); + + /* Disallow anything except explicit share names. */ + if (strequal(defservice,HOMES_NAME) || + strequal(defservice, PRINTERS_NAME) || + strequal(defservice, "ipc$")) { + goto fail; + } + iService = find_service(defservice); if (iService >= 0) { all_string_sub(service, "_","/",0); @@ -332,13 +347,6 @@ int find_service(fstring service) } } - /* Is it a usershare service ? */ - if (iService < 0 && *lp_usershare_path()) { - /* Ensure the name is canonicalized. */ - strlower_m(service); - iService = load_usershare_service(service); - } - if (iService >= 0) { if (!VALID_SNUM(iService)) { DEBUG(0,("Invalid snum %d for %s\n",iService, service)); @@ -346,6 +354,8 @@ int find_service(fstring service) } } + fail: + if (iService < 0) DEBUG(3,("find_service() failed to find service %s\n", service)); |