summaryrefslogtreecommitdiff
path: root/packaging/SuSE/samba-3.0.0-msdfs.diff
blob: 1e688e64c4b263df334d142ef79e5a355bbf7fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--- source/param/loadparm.c	Wed Oct  9 21:17:05 2002
+++ source/param/loadparm.c	Mon Oct 14 16:33:08 2002
@@ -386,6 +386,8 @@
 	BOOL bInheritPerms;
 	BOOL bInheritACLS;
 	BOOL bMSDfsRoot;
+	BOOL bMSDfsProxy;
+	char *bMSDfsLinkName;
 	BOOL bUseClientDriver;
 	BOOL bDefaultDevmode;
 	BOOL bNTAclSupport;
@@ -508,6 +510,8 @@
 	False,			/* bInheritPerms */
 	False,			/* bInheritACLS */
 	False,			/* bMSDfsRoot */
+	False,                  /* bMSDfsProxy */
+	NULL,                   /* bMSDfsLinkName */
 	False,			/* bUseClientDriver */
 	False,			/* bDefaultDevmode */
 	True,			/* bNTAclSupport */
@@ -1079,6 +1083,8 @@
 
 	
 	{"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE},
+	{"msdfs proxy", P_BOOL, P_LOCAL, &sDefault.bMSDfsProxy, NULL, NULL, FLAG_SHARE},
+	{"msdfs link name", P_STRING, P_LOCAL, &sDefault.bMSDfsLinkName, NULL, NULL, FLAG_SHARE},
 	{"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
 
 	{"Winbind options", P_SEP, P_SEPARATOR},
@@ -1730,6 +1736,8 @@
 FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles)
 FN_LOCAL_STRING(lp_driverlocation, szPrinterDriverLocation)
 FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot)
+FN_LOCAL_BOOL(lp_msdfs_proxy, bMSDfsProxy)
+FN_LOCAL_STRING(lp_msdfs_link_name, bMSDfsLinkName)
 FN_LOCAL_BOOL(lp_autoloaded, autoloaded)
 FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose)
 FN_LOCAL_BOOL(lp_rootpreexec_close, bRootpreexecClose)
--- source/msdfs/msdfs.c	Tue Jul  2 08:34:24 2002
+++ source/msdfs/msdfs.c	Mon Oct 14 16:49:57 2002
@@ -600,12 +600,38 @@
 	int reply_size = 0;
 	char *pathnamep = pathname;
 
+	struct connection_struct conns;
+	struct connection_struct* conn = &conns;
+	int snum;
+	pstring conn_path;
+	struct dfs_path dpi;
+
+	struct junction_map junction2;
+	parse_dfs_path(pathname, &dpi);
+	pstrcpy(junction2.service_name, dpi.servicename);
+	snum = lp_servicenumber(junction2.service_name);
+	create_conn_struct(conn, snum, conn_path);
+	
+
 	ZERO_STRUCT(junction);
 
 	/* get the junction entry */
 	if (!pathnamep)
 		return -1;
 
+        if (lp_msdfs_proxy(SNUM(conn))) {
+		DEBUG(10,("running in proxy mode\n"));
+		pstrcpy(pathnamep, "\\");
+		pstrcat(pathnamep, dpi.hostname);
+		pstrcat(pathnamep, "\\");
+		pstrcat(pathnamep, dpi.servicename);
+		pstrcat(pathnamep, "\\");
+		pstrcat(pathnamep, (char *) lp_msdfs_link_name(SNUM(conn)));
+	 } else {
+	        DEBUG(10,("running in normal mode\n"));
+	}
+	
+	
 	/* Trim pathname sent by client so it begins with only one backslash.
 	   Two backslashes confuse some dfs clients
 	 */
@@ -631,6 +657,17 @@
 		}
 	}
 	
+        if ( lp_msdfs_proxy(SNUM(conn)) ) {
+		DEBUG(10,("running in proxy mode\n"));
+		pstrcpy ( pathnamep, "\\" );
+		pstrcat ( pathnamep, dpi.hostname);
+		pstrcat ( pathnamep, "\\" );
+		pstrcat ( pathnamep, dpi.servicename);
+        } else {
+	   	DEBUG(10,("running in normal mode\n"));
+	}
+		
+	
 	/* create the referral depeding on version */
 	DEBUG(10,("max_referral_level :%d\n",max_referral_level));
 	if(max_referral_level<2 || max_referral_level>3)