summaryrefslogtreecommitdiffstats
path: root/source3/registry
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2013-03-20 13:00:26 +0100
committerChristian Ambach <ambi@samba.org>2013-03-20 17:08:51 +0100
commitf7564cae4cdd1e2629404c5a1229978451584257 (patch)
tree85552a5e8d24a1b90a58208d2ce6a417bf976cba /source3/registry
parent4490e72426bc55a5680df84fce344aa509219219 (diff)
downloadsamba-f7564cae4cdd1e2629404c5a1229978451584257.tar.gz
samba-f7564cae4cdd1e2629404c5a1229978451584257.tar.xz
samba-f7564cae4cdd1e2629404c5a1229978451584257.zip
s3:registry accept windows like long hivenames
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Wed Mar 20 17:08:52 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_api.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index c263174bc23..ca990e22f85 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -70,6 +70,7 @@
#include "reg_dispatcher.h"
#include "reg_objects.h"
#include "../librpc/gen_ndr/ndr_security.h"
+#include "reg_parse_internal.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_REGISTRY
@@ -232,12 +233,17 @@ WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive,
const struct security_token *token,
struct registry_key **pkey)
{
+ const struct hive_info *hi;
SMB_ASSERT(hive != NULL);
- SMB_ASSERT(hive[0] != '\0');
SMB_ASSERT(strchr(hive, '\\') == NULL);
- return regkey_open_onelevel(mem_ctx, NULL, hive, token, desired_access,
- pkey);
+ hi = hive_info(hive);
+ if (hi == NULL) {
+ return WERR_BADFILE;
+ }
+
+ return regkey_open_onelevel(mem_ctx, NULL, hi->short_name, token,
+ desired_access, pkey);
}