diff options
Diffstat (limited to 'source4/param/param_wrap.c')
-rw-r--r-- | source4/param/param_wrap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c index e9fe8a3df5..d8be725c5e 100644 --- a/source4/param/param_wrap.c +++ b/source4/param/param_wrap.c @@ -2765,7 +2765,16 @@ SWIGINTERN struct param_opt *param_section_next_parameter(param_section *self,st struct loadparm_context *lp_from_py_object(PyObject *py_obj) { struct loadparm_context *lp_ctx; - if (SWIG_ConvertPtr(py_obj, &lp_ctx, SWIGTYPE_p_loadparm_context, 0 | 0 ) < 0) + if (PyString_Check(py_obj)) { + lp_ctx = loadparm_init(NULL); + if (!lp_load(lp_ctx, PyString_AsString(py_obj))) { + talloc_free(lp_ctx); + return NULL; + } + return lp_ctx; + } + + if (SWIG_ConvertPtr(py_obj, (void *)&lp_ctx, SWIGTYPE_p_loadparm_context, 0 | 0 ) < 0) return NULL; return lp_ctx; } |