mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Add msdfs proxy functionality; a CIFS share can directly be a stand-in for
another share, and when clients connect to the first share, they will be
redirected to the proxied share.
(This used to be commit 514f548b18
)
This commit is contained in:
parent
dab0251509
commit
8701eb8db2
@ -381,6 +381,26 @@ BOOL get_referred_path(char *pathname, struct junction_map* jn,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (*lp_msdfs_proxy(snum) != '\0') {
|
||||
struct referral* ref;
|
||||
jn->referral_count = 1;
|
||||
if ((ref = (struct referral*) malloc(sizeof(struct referral)))
|
||||
== NULL) {
|
||||
DEBUG(0, ("malloc failed for referral\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
pstrcpy(ref->alternate_path, lp_msdfs_proxy(snum));
|
||||
if (dp.reqpath[0] != '\0')
|
||||
pstrcat(ref->alternate_path, dp.reqpath);
|
||||
ref->proximity = 0;
|
||||
ref->ttl = REFERRAL_TTL;
|
||||
jn->referral_list = ref;
|
||||
if (consumedcntp)
|
||||
*consumedcntp = strlen(pathname);
|
||||
return True;
|
||||
}
|
||||
|
||||
/* If not remote & not a self referral, return False */
|
||||
if (!resolve_dfs_path(pathname, &dp, conn, False,
|
||||
&jn->referral_list, &jn->referral_count,
|
||||
|
@ -317,6 +317,7 @@ typedef struct
|
||||
char *szVfsObjectFile;
|
||||
char *szVfsOptions;
|
||||
char *szVfsPath;
|
||||
char *szMSDfsProxy;
|
||||
int iMinPrintSpace;
|
||||
int iMaxPrintJobs;
|
||||
int iWriteCacheSize;
|
||||
@ -435,6 +436,7 @@ static service sDefault = {
|
||||
NULL, /* vfs object */
|
||||
NULL, /* vfs options */
|
||||
NULL, /* vfs path */
|
||||
NULL, /* szMSDfsProxy */
|
||||
0, /* iMinPrintSpace */
|
||||
1000, /* iMaxPrintJobs */
|
||||
0, /* iWriteCacheSize */
|
||||
@ -1075,6 +1077,7 @@ static struct parm_struct parm_table[] = {
|
||||
|
||||
|
||||
{"msdfs root", P_BOOL, P_LOCAL, &sDefault.bMSDfsRoot, NULL, NULL, FLAG_SHARE},
|
||||
{"msdfs proxy", P_STRING, P_LOCAL, &sDefault.szMSDfsProxy, NULL, NULL, FLAG_SHARE},
|
||||
{"host msdfs", P_BOOL, P_GLOBAL, &Globals.bHostMSDfs, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
|
||||
|
||||
{"Winbind options", P_SEP, P_SEPARATOR},
|
||||
@ -1721,6 +1724,7 @@ FN_LOCAL_STRING(lp_fstype, fstype)
|
||||
FN_LOCAL_STRING(lp_vfsobj, szVfsObjectFile)
|
||||
FN_LOCAL_STRING(lp_vfs_options, szVfsOptions)
|
||||
FN_LOCAL_STRING(lp_vfs_path, szVfsPath)
|
||||
FN_LOCAL_STRING(lp_msdfs_proxy, szMSDfsProxy)
|
||||
static FN_LOCAL_STRING(lp_volume, volume)
|
||||
FN_LOCAL_STRING(lp_mangled_map, szMangledMap)
|
||||
FN_LOCAL_STRING(lp_veto_files, szVetoFiles)
|
||||
|
Loading…
Reference in New Issue
Block a user