summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-02 21:51:02 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-03 18:36:08 +1000
commit127bf61a4006c60a70b0e43b61c60e532990d3b8 (patch)
tree2f675843b4fbd3657bbca4dd18c7b5540d9cd1de /source4/param
parentc033b2dd2d09e3699e0756c8cc21388e383d8fd7 (diff)
downloadsamba-127bf61a4006c60a70b0e43b61c60e532990d3b8.tar.gz
samba-127bf61a4006c60a70b0e43b61c60e532990d3b8.tar.bz2
samba-127bf61a4006c60a70b0e43b61c60e532990d3b8.zip
support config files in the current directory
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/param/util.c b/source4/param/util.c
index 366c3f1d78..d9d4eb5e2b 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -118,9 +118,14 @@ char *config_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
}
p = strrchr(config_dir, '/');
if (p == NULL) {
- return NULL;
+ talloc_free(config_dir);
+ config_dir = talloc_strdup(mem_ctx, ".");
+ if (config_dir == NULL) {
+ return NULL;
+ }
+ } else {
+ p[0] = '\0';
}
- p[0] = '\0';
fname = talloc_asprintf(mem_ctx, "%s/%s", config_dir, name);
talloc_free(config_dir);
return fname;