summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-09-25 23:26:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:00 -0500
commitaea0d4b9a0540e31392712bfeeb2185975919c42 (patch)
treee0460beae432fe51bcd4d8ac03b16724a17c2bb5
parentf0653fd572bbc7f924767f76853432fc29861a1c (diff)
downloadsamba-aea0d4b9a0540e31392712bfeeb2185975919c42.tar.gz
samba-aea0d4b9a0540e31392712bfeeb2185975919c42.tar.bz2
samba-aea0d4b9a0540e31392712bfeeb2185975919c42.zip
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)
-rw-r--r--source3/smbd/msdfs.c12
1 files changed, 11 insertions, 1 deletions
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;