summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-08-24 22:58:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:33 -0500
commit67729cf71fa6796c79cee576db461b4523bd75a7 (patch)
treebdbbf90bf37b0f7aaec729c7e4ff9763e47816b1
parent7663475111079b8e2415d6e1ee20527c7463f613 (diff)
downloadsamba-67729cf71fa6796c79cee576db461b4523bd75a7.tar.gz
samba-67729cf71fa6796c79cee576db461b4523bd75a7.tar.bz2
samba-67729cf71fa6796c79cee576db461b4523bd75a7.zip
r24655: Fix bug 4919 reported by Matthias Wallnöfer <mwallnoefer@yahoo.de>:
> When you change to the SAMBA private directory on a shell (default > /usr/local/samba/private) and start there for example ldbedit with the sam.ldb, > the application crashes if you don't put the "./" before the filename. I've adapted Matthias's patch. Andrew Bartlett (This used to be commit ba82197e30da8e626419e877d224431703edc866)
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index 21eb9a74d7..4c0c632139 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -722,11 +722,10 @@ static const char *relative_path(struct ldb_module *module,
}
if ( (p = strrchr(path, '/')) != NULL) {
p[0] = '\0';
+ full_name = talloc_asprintf(mem_ctx, "%s/%s", path, name);
} else {
- talloc_free(path);
- return NULL;
+ full_name = talloc_asprintf(mem_ctx, "./%s", name);
}
- full_name = talloc_asprintf(mem_ctx, "%s/%s", path, name);
talloc_free(path);
return full_name;
}