From aea0d4b9a0540e31392712bfeeb2185975919c42 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 25 Sep 2007 23:26:05 +0000 Subject: r25327: Normalize the path we return for 'msdfs proxy' We now accept both \\server\tmp and \server\tmp. There are other places where this might be necessary, but at least the functionality is a bit easier now. (This used to be commit 25cc27df97e9eecb470f99ea934de12f2a0f4df9) --- source3/smbd/msdfs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index a2d7b778ca..ff55904b81 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -788,6 +788,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx, */ if (pdp->reqpath[0] == '\0') { + char *tmp; struct referral *ref; if (*lp_msdfs_proxy(snum) == '\0') { @@ -810,7 +811,16 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx, return NT_STATUS_NO_MEMORY; } - ref->alternate_path = talloc_strdup(ctx, lp_msdfs_proxy(snum)); + if (!(tmp = talloc_strdup(ctx, lp_msdfs_proxy(snum)))) { + TALLOC_FREE(pdp); + return NT_STATUS_NO_MEMORY; + } + + 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; -- cgit