r24655: Fix bug 4919 reported by Matthias Wallnöfer <mwallnoefer@yahoo.de>:
authorAndrew Bartlett <abartlet@samba.org>
Fri, 24 Aug 2007 22:58:29 +0000 (22:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:02:33 +0000 (15:02 -0500)
> 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

source/dsdb/samdb/ldb_modules/partition.c

index 21eb9a74d7f4b7e1f1a7e9eef94c292e70198313..4c0c632139d556ac4d9293c57c727fb7a0d3143e 100644 (file)
@@ -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;
 }