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