diff options
author | Volker Lendecke <vl@samba.org> | 2013-10-30 13:22:05 +0000 |
---|---|---|
committer | Björn Jacke <bj@sernet.de> | 2013-10-31 11:54:48 +0100 |
commit | 85b5bedd43cdb758463cb03079eb1bb4aadf6677 (patch) | |
tree | 5194ff4d97fe40eaf37b6819acc3c8b4eb44e531 /source3/smbd/msdfs.c | |
parent | 127fc670a39d15eaa3869045fca0287ba7df9efa (diff) | |
download | samba-85b5bedd43cdb758463cb03079eb1bb4aadf6677.tar.gz samba-85b5bedd43cdb758463cb03079eb1bb4aadf6677.tar.xz samba-85b5bedd43cdb758463cb03079eb1bb4aadf6677.zip |
smbd: Support multiple dfs targets for msdfs proxy shares
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r-- | source3/smbd/msdfs.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 52a2a4852e..aede3e6da0 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -958,6 +958,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx, if (pdp->reqpath[0] == '\0') { char *tmp; struct referral *ref; + int refcount; if (*lp_msdfs_proxy(talloc_tos(), snum) == '\0') { TALLOC_FREE(pdp); @@ -973,39 +974,20 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx, * the configured target share. */ - jucn->referral_count = 1; - if ((ref = talloc_zero(ctx, struct referral)) == NULL) { + tmp = talloc_asprintf(talloc_tos(), "msdfs:%s", + lp_msdfs_proxy(talloc_tos(), snum)); + if (tmp == NULL) { TALLOC_FREE(pdp); return NT_STATUS_NO_MEMORY; } - if (!(tmp = talloc_strdup(ctx, lp_msdfs_proxy(talloc_tos(), snum)))) { + if (!parse_msdfs_symlink(ctx, tmp, &ref, &refcount)) { + TALLOC_FREE(tmp); TALLOC_FREE(pdp); - return NT_STATUS_NO_MEMORY; + return NT_STATUS_INVALID_PARAMETER; } - - trim_string(tmp, "\\", 0); - - ref->alternate_path = talloc_asprintf(ctx, "\\%s", tmp); TALLOC_FREE(tmp); - - if (!ref->alternate_path) { - TALLOC_FREE(pdp); - return NT_STATUS_NO_MEMORY; - } - - if (pdp->reqpath[0] != '\0') { - ref->alternate_path = talloc_asprintf_append( - ref->alternate_path, - "%s", - pdp->reqpath); - if (!ref->alternate_path) { - TALLOC_FREE(pdp); - return NT_STATUS_NO_MEMORY; - } - } - ref->proximity = 0; - ref->ttl = REFERRAL_TTL; + jucn->referral_count = refcount; jucn->referral_list = ref; *consumedcntp = strlen(dfs_path); TALLOC_FREE(pdp); |