diff options
author | Jeremy Allison <jra@samba.org> | 2007-02-21 02:04:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:07 -0500 |
commit | 01ecda0534a4a7f2a9fe492f1accbcec7552e8d1 (patch) | |
tree | 9079de0e083dd2305fb11652bd6c9af6a72d9d64 | |
parent | a9dbdf937c4901c4e791bff0753bafe709bc0fa5 (diff) | |
download | samba-01ecda0534a4a7f2a9fe492f1accbcec7552e8d1.tar.gz samba-01ecda0534a4a7f2a9fe492f1accbcec7552e8d1.tar.bz2 samba-01ecda0534a4a7f2a9fe492f1accbcec7552e8d1.zip |
r21481: No one said anything, so I'm disallowing anything
but explicit shares in "default service" :-).
Jeremy.
(This used to be commit 90bdcce765998cc0f5768d24926d52b8a4a44f90)
-rw-r--r-- | source3/smbd/service.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c index eb464c29b2..1b8e2e1d30 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -402,6 +402,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(); @@ -414,6 +421,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); @@ -426,13 +441,6 @@ int find_service(fstring service) iService = load_registry_service(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)); @@ -440,6 +448,8 @@ int find_service(fstring service) } } + fail: + if (iService < 0) DEBUG(3,("find_service() failed to find service %s\n", service)); |