summaryrefslogtreecommitdiffstats
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-02-21 02:04:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:07 -0500
commit01ecda0534a4a7f2a9fe492f1accbcec7552e8d1 (patch)
tree9079de0e083dd2305fb11652bd6c9af6a72d9d64 /source3/smbd/service.c
parenta9dbdf937c4901c4e791bff0753bafe709bc0fa5 (diff)
downloadsamba-01ecda0534a4a7f2a9fe492f1accbcec7552e8d1.tar.gz
samba-01ecda0534a4a7f2a9fe492f1accbcec7552e8d1.tar.xz
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)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index eb464c29b27..1b8e2e1d302 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));