1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r21481: No one said anything, so I'm disallowing anything

but explicit shares in "default service" :-).
Jeremy.
(This used to be commit 90bdcce765998cc0f5768d24926d52b8a4a44f90)
This commit is contained in:
Jeremy Allison 2007-02-21 02:04:28 +00:00 committed by Gerald (Jerry) Carter
parent a9dbdf937c
commit 01ecda0534

View File

@ -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));