diff options
Diffstat (limited to 'source4/lib/registry')
-rw-r--r-- | source4/lib/registry/hive.c | 2 | ||||
-rw-r--r-- | source4/lib/registry/patchfile.c | 4 | ||||
-rw-r--r-- | source4/lib/registry/samba.c | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/source4/lib/registry/hive.c b/source4/lib/registry/hive.c index b2c826b93d..97ce883e66 100644 --- a/source4/lib/registry/hive.c +++ b/source4/lib/registry/hive.c @@ -39,6 +39,8 @@ _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location, fd = open(location, O_RDWR); if (fd == -1) { + if (errno == ENOENT) + return WERR_NOT_FOUND; return WERR_BADFILE; } diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c index 50c8f54397..8df873d56b 100644 --- a/source4/lib/registry/patchfile.c +++ b/source4/lib/registry/patchfile.c @@ -252,7 +252,9 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1, /** * Load diff file */ -_PUBLIC_ WERROR reg_diff_load(const char *filename, const struct reg_diff_callbacks *callbacks, void *callback_data) +_PUBLIC_ WERROR reg_diff_load(const char *filename, + const struct reg_diff_callbacks *callbacks, + void *callback_data) { int fd; char hdr[4]; diff --git a/source4/lib/registry/samba.c b/source4/lib/registry/samba.c index 244c467a2c..6aaaa118d0 100644 --- a/source4/lib/registry/samba.c +++ b/source4/lib/registry/samba.c @@ -36,7 +36,12 @@ WERROR mount_samba_hive(struct registry_context *ctx, location = talloc_asprintf(ctx, "%s/%s.ldb", lp_private_dir(), name); + error = reg_open_hive(ctx, location, auth_info, creds, &hive); + + if (W_ERROR_EQUAL(error, WERR_NOT_FOUND)) + error = reg_open_ldb_file(ctx, location, auth_info, creds, &hive); + if (!W_ERROR_IS_OK(error)) return error; |