svn commit: samba r21481 - in branches: SAMBA_3_0/source/smbd
SAMBA_3_0_25/source/smbd
jra at samba.org
jra at samba.org
Wed Feb 21 02:04:29 GMT 2007
Author: jra
Date: 2007-02-21 02:04:28 +0000 (Wed, 21 Feb 2007)
New Revision: 21481
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21481
Log:
No one said anything, so I'm disallowing anything
but explicit shares in "default service" :-).
Jeremy.
Modified:
branches/SAMBA_3_0/source/smbd/service.c
branches/SAMBA_3_0_25/source/smbd/service.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/service.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/service.c 2007-02-21 01:55:08 UTC (rev 21480)
+++ branches/SAMBA_3_0/source/smbd/service.c 2007-02-21 02:04:28 UTC (rev 21481)
@@ -402,6 +402,13 @@
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 @@
*/
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 @@
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 @@
}
}
+ fail:
+
if (iService < 0)
DEBUG(3,("find_service() failed to find service %s\n", service));
Modified: branches/SAMBA_3_0_25/source/smbd/service.c
===================================================================
--- branches/SAMBA_3_0_25/source/smbd/service.c 2007-02-21 01:55:08 UTC (rev 21480)
+++ branches/SAMBA_3_0_25/source/smbd/service.c 2007-02-21 02:04:28 UTC (rev 21481)
@@ -312,6 +312,13 @@
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 @@
*/
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 @@
}
}
- /* 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 @@
}
}
+ fail:
+
if (iService < 0)
DEBUG(3,("find_service() failed to find service %s\n", service));
More information about the samba-cvs
mailing list