summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-09-11 23:57:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:41 -0500
commit3a9d3821649c9ea88a6cd424f0838a453165a00a (patch)
tree4b4f61570a20e0a252436ebd88b1d0dee58c704e /source3/smbd/msdfs.c
parent1ef2464451ee64023173637fa03e703405dc8c85 (diff)
downloadsamba-3a9d3821649c9ea88a6cd424f0838a453165a00a.tar.gz
r25111: Move to talloced pathnames on most code paths.
There are now ony 17 pstrings left in reply.c, and these will be easy to remove (and I'll be doing that shortly). Had to fix an interesting bug in pull_ucs2_base_talloc() when a source string is not null terminated :-). Jeremy. (This used to be commit 0c9a8c4dff10974dbffd2a302ae982896122fcc0)
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index d687974ff3f..5cbe8c68aca 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -817,9 +817,9 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
}
if (pdp->reqpath[0] != '\0') {
- ref->alternate_path = talloc_asprintf(ctx,
- "%s%s",
+ ref->alternate_path = talloc_asprintf_append(
ref->alternate_path,
+ "%s",
pdp->reqpath);
if (!ref->alternate_path) {
TALLOC_FREE(pdp);
@@ -1298,7 +1298,6 @@ BOOL create_msdfs_link(const struct junction_map *jucn,
goto out;
}
for(i=0; i<jucn->referral_count; i++) {
- char *old_msdfs_link = msdfs_link;
char *refpath = jucn->referral_list[i].alternate_path;
/* Alternate paths always use Windows separators. */
@@ -1310,21 +1309,18 @@ BOOL create_msdfs_link(const struct junction_map *jucn,
continue;
}
if (i > 0 && insert_comma) {
- msdfs_link = talloc_asprintf(conn->mem_ctx,
- "%s,%s",
- old_msdfs_link,
+ msdfs_link = talloc_asprintf_append(msdfs_link,
+ ",%s",
refpath);
} else {
- msdfs_link = talloc_asprintf(conn->mem_ctx,
- "%s%s",
- old_msdfs_link,
+ msdfs_link = talloc_asprintf_append(msdfs_link,
+ "%s",
refpath);
}
if (!msdfs_link) {
goto out;
}
- TALLOC_FREE(old_msdfs_link);
if (!insert_comma) {
insert_comma = True;
}