summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-17 23:16:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:51:25 +0100
commit12a513b47b1a1f2adeb2cb2a10ac36d02dd44065 (patch)
treeffd350db11a507777686060b8288b038670f0768 /source4/lib/registry
parent57b8a8fd42f5d89f439fd9d0781bd8f561a84131 (diff)
downloadsamba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.tar.gz
samba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.tar.bz2
samba-12a513b47b1a1f2adeb2cb2a10ac36d02dd44065.zip
r26518: Fix provision of registry using Python.
(This used to be commit 12eb38e553993b2726a803af4ae9c05229d6ebe4)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c2
-rw-r--r--source4/lib/registry/local.c2
-rw-r--r--source4/lib/registry/registry.i5
-rw-r--r--source4/lib/registry/registry.py3
-rw-r--r--source4/lib/registry/registry_wrap.c25
5 files changed, 17 insertions, 20 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 78acc3150b..c9697ddb4c 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -346,7 +346,7 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
if (location == NULL)
return WERR_INVALID_PARAM;
- wrap = ldb_wrap_connect(parent_ctx, global_loadparm,
+ wrap = ldb_wrap_connect(parent_ctx, lp_ctx,
location, session_info, credentials, 0, NULL);
if (wrap == NULL) {
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index 5789a94a6d..1ed4f0262e 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -321,7 +321,7 @@ WERROR reg_mount_hive(struct registry_context *rctx,
mp->path.predefined_key = key_id;
mp->prev = mp->next = NULL;
mp->key = hive_key;
- if (elements != NULL) {
+ if (elements != NULL && str_list_length(elements) != 0) {
mp->path.elements = talloc_array(mp, const char *,
str_list_length(elements));
for (i = 0; elements[i] != NULL; i++) {
diff --git a/source4/lib/registry/registry.i b/source4/lib/registry/registry.i
index c5b4eed968..784462c368 100644
--- a/source4/lib/registry/registry.i
+++ b/source4/lib/registry/registry.i
@@ -105,11 +105,6 @@ typedef struct registry_context {
WERROR mount_hive(struct hive_key *hive_key, uint32_t hkey_id,
const char **elements=NULL);
}
-
- %pythoncode {
- def mount(self, path, hkey_id, elements=[]):
- self.mount_hive(Hive(path), hkey_id, elements)
- }
} reg;
/* Hives */
diff --git a/source4/lib/registry/registry.py b/source4/lib/registry/registry.py
index 0097949896..67607cd7ac 100644
--- a/source4/lib/registry/registry.py
+++ b/source4/lib/registry/registry.py
@@ -65,9 +65,6 @@ Registry = _registry.Registry
class reg(object):
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
- def mount(self, path, hkey_id, elements=[]):
- self.mount_hive(Hive(path), hkey_id, elements)
-
def __init__(self, *args, **kwargs):
_registry.reg_swiginit(self,_registry.new_reg(*args, **kwargs))
__swig_destroy__ = _registry.delete_reg
diff --git a/source4/lib/registry/registry_wrap.c b/source4/lib/registry/registry_wrap.c
index 21cc4896f6..e4e1502404 100644
--- a/source4/lib/registry/registry_wrap.c
+++ b/source4/lib/registry/registry_wrap.c
@@ -2470,16 +2470,17 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
#define SWIGTYPE_p_p_registry_context swig_types[11]
#define SWIGTYPE_p_p_registry_key swig_types[12]
#define SWIGTYPE_p_param_context swig_types[13]
-#define SWIGTYPE_p_param_section swig_types[14]
-#define SWIGTYPE_p_registry_context swig_types[15]
-#define SWIGTYPE_p_short swig_types[16]
-#define SWIGTYPE_p_signed_char swig_types[17]
-#define SWIGTYPE_p_unsigned_char swig_types[18]
-#define SWIGTYPE_p_unsigned_int swig_types[19]
-#define SWIGTYPE_p_unsigned_long_long swig_types[20]
-#define SWIGTYPE_p_unsigned_short swig_types[21]
-static swig_type_info *swig_types[23];
-static swig_module_info swig_module = {swig_types, 22, 0, 0, 0, 0};
+#define SWIGTYPE_p_param_opt swig_types[14]
+#define SWIGTYPE_p_param_section swig_types[15]
+#define SWIGTYPE_p_registry_context swig_types[16]
+#define SWIGTYPE_p_short swig_types[17]
+#define SWIGTYPE_p_signed_char swig_types[18]
+#define SWIGTYPE_p_unsigned_char swig_types[19]
+#define SWIGTYPE_p_unsigned_int swig_types[20]
+#define SWIGTYPE_p_unsigned_long_long swig_types[21]
+#define SWIGTYPE_p_unsigned_short swig_types[22]
+static swig_type_info *swig_types[24];
+static swig_module_info swig_module = {swig_types, 23, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -3492,6 +3493,7 @@ static swig_type_info _swigt__p_p_hive_key = {"_p_p_hive_key", "struct hive_key
static swig_type_info _swigt__p_p_registry_context = {"_p_p_registry_context", "struct registry_context **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_registry_key = {"_p_p_registry_key", "struct registry_key **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_param_context = {"_p_param_context", "struct param_context *|param *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_param_opt = {"_p_param_opt", "struct param_opt *|param_opt *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_param_section = {"_p_param_section", "struct param_section *|param_section *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_registry_context = {"_p_registry_context", "struct registry_context *|reg *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
@@ -3516,6 +3518,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_p_registry_context,
&_swigt__p_p_registry_key,
&_swigt__p_param_context,
+ &_swigt__p_param_opt,
&_swigt__p_param_section,
&_swigt__p_registry_context,
&_swigt__p_short,
@@ -3540,6 +3543,7 @@ static swig_cast_info _swigc__p_p_hive_key[] = { {&_swigt__p_p_hive_key, 0, 0,
static swig_cast_info _swigc__p_p_registry_context[] = { {&_swigt__p_p_registry_context, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_registry_key[] = { {&_swigt__p_p_registry_key, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_param_context[] = { {&_swigt__p_param_context, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_param_opt[] = { {&_swigt__p_param_opt, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_param_section[] = { {&_swigt__p_param_section, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_registry_context[] = { {&_swigt__p_registry_context, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_short[] = { {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
@@ -3564,6 +3568,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_p_registry_context,
_swigc__p_p_registry_key,
_swigc__p_param_context,
+ _swigc__p_param_opt,
_swigc__p_param_section,
_swigc__p_registry_context,
_swigc__p_short,