summaryrefslogtreecommitdiffstats
path: root/source/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
commit0c9a8c4dff10974dbffd2a302ae982896122fcc0 (patch)
tree9e20a03715c504a5bba4ba7991e0490d1d46fa28 /source/smbd/msdfs.c
parent2dea9464bba76af4315a8207ccd3e564ec19d146 (diff)
downloadsamba-0c9a8c4dff10974dbffd2a302ae982896122fcc0.tar.gz
samba-0c9a8c4dff10974dbffd2a302ae982896122fcc0.tar.xz
samba-0c9a8c4dff10974dbffd2a302ae982896122fcc0.zip
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.
Diffstat (limited to 'source/smbd/msdfs.c')
-rw-r--r--source/smbd/msdfs.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c
index d687974ff3f..5cbe8c68aca 100644
--- a/source/smbd/msdfs.c
+++ b/source/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;
}