mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
registry: Avoid mapping registry return codes: return the right value in the first place.
(This used to be commit 434e4857cec17d6d9e8983e151c170eed59fc6d1)
This commit is contained in:
parent
e490415e2e
commit
b5ba491012
@ -140,7 +140,7 @@ WERROR local_get_predefined_key(struct registry_context *ctx,
|
||||
}
|
||||
|
||||
if (mp == NULL)
|
||||
return WERR_NOT_FOUND;
|
||||
return WERR_BADFILE;
|
||||
|
||||
*key = reg_import_hive_key(ctx, mp->key,
|
||||
mp->path.predefined_key,
|
||||
|
@ -42,7 +42,7 @@ static WERROR mount_samba_hive(struct registry_context *ctx,
|
||||
|
||||
error = reg_open_hive(ctx, location, auth_info, creds, lp_ctx, &hive);
|
||||
|
||||
if (W_ERROR_EQUAL(error, WERR_NOT_FOUND))
|
||||
if (W_ERROR_EQUAL(error, WERR_BADFILE))
|
||||
error = reg_open_ldb_file(ctx, location, auth_info,
|
||||
creds, lp_ctx, &hive);
|
||||
|
||||
|
@ -53,7 +53,7 @@ static bool test_get_predefined_unknown(struct torture_context *tctx,
|
||||
WERROR error;
|
||||
|
||||
error = reg_get_predefined_key(rctx, 1337, &root);
|
||||
torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
|
||||
torture_assert_werr_equal(tctx, error, WERR_BADFILE,
|
||||
"getting predefined key failed");
|
||||
return true;
|
||||
}
|
||||
|
@ -356,13 +356,6 @@ static WERROR dcesrv_winreg_OpenKey(struct dcesrv_call_state *dce_call,
|
||||
r->out.handle = &newh->wire_handle;
|
||||
} else {
|
||||
talloc_free(newh);
|
||||
/*
|
||||
* Windows expects WERR_BADFILE when a particular key
|
||||
* is not found. If we receive WERR_NOT_FOUND from the lower
|
||||
* layer calls, translate it here to return what is expected.
|
||||
*/
|
||||
if (W_ERROR_EQUAL(result, WERR_NOT_FOUND))
|
||||
return WERR_BADFILE;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user