diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-23 20:56:41 -0600 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-24 01:51:04 -0600 |
commit | d0ba9f001474bfee9b1e8fb516effab736cd4050 (patch) | |
tree | 1f4f21c4cf230e2438b1a9fac46eab7e7714b5e6 /source4 | |
parent | 3ee442c54f658e0dc9541a492e46fd8f6bf3a7f4 (diff) | |
download | samba-d0ba9f001474bfee9b1e8fb516effab736cd4050.tar.gz samba-d0ba9f001474bfee9b1e8fb516effab736cd4050.tar.bz2 samba-d0ba9f001474bfee9b1e8fb516effab736cd4050.zip |
r26572: Fix warnings in the Python code.
(This used to be commit 15038d9586d0b58f301ca8c39c21ef10c4283f28)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/credentials/credentials.i | 8 | ||||
-rw-r--r-- | source4/auth/credentials/credentials_wrap.c | 2 | ||||
-rw-r--r-- | source4/auth/session.h | 1 | ||||
-rw-r--r-- | source4/lib/ldb/ldb.i | 30 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_wrap.c | 58 | ||||
-rw-r--r-- | source4/lib/registry/registry.i | 7 | ||||
-rw-r--r-- | source4/lib/registry/registry_wrap.c | 31 | ||||
-rw-r--r-- | source4/libcli/security/security.i | 4 | ||||
-rw-r--r-- | source4/libcli/security/security_descriptor.c | 6 | ||||
-rw-r--r-- | source4/libcli/security/security_wrap.c | 32 | ||||
-rw-r--r-- | source4/libcli/util/errors.i | 4 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc.i | 12 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_wrap.c | 169 | ||||
-rw-r--r-- | source4/param/param.i | 14 | ||||
-rw-r--r-- | source4/param/param_wrap.c | 18 | ||||
-rw-r--r-- | source4/samba4-knownfail | 1 | ||||
-rw-r--r-- | source4/samba4-skip | 2 | ||||
-rw-r--r-- | source4/scripting/python/misc.i | 1 | ||||
-rw-r--r-- | source4/scripting/python/misc_wrap.c | 3 |
19 files changed, 182 insertions, 221 deletions
diff --git a/source4/auth/credentials/credentials.i b/source4/auth/credentials/credentials.i index b06c4ff6da..8f09ff4b18 100644 --- a/source4/auth/credentials/credentials.i +++ b/source4/auth/credentials/credentials.i @@ -43,14 +43,14 @@ typedef struct cli_credentials cli_credentials; %} %typemap(out,noblock=1) struct samr_Password * { - $result = PyString_FromStringAndSize($1->hash, 16); + $result = PyString_FromStringAndSize((char *)$1->hash, 16); } %talloctype(cli_credentials); %rename(Credentials) cli_credentials; typedef struct cli_credentials { %extend { - cli_credentials() { + cli_credentials(void) { return cli_credentials_init(NULL); } /* username */ @@ -90,8 +90,8 @@ typedef struct cli_credentials { const struct samr_Password *get_nt_hash(TALLOC_CTX *mem_ctx); - bool authentication_requested(); + bool authentication_requested(void); - bool wrong_password(); + bool wrong_password(void); } } cli_credentials; diff --git a/source4/auth/credentials/credentials_wrap.c b/source4/auth/credentials/credentials_wrap.c index 0beaf85f42..ebf7162c5b 100644 --- a/source4/auth/credentials/credentials_wrap.c +++ b/source4/auth/credentials/credentials_wrap.c @@ -3407,7 +3407,7 @@ SWIGINTERN PyObject *_wrap_Credentials_get_nt_hash(PyObject *SWIGUNUSEDPARM(self arg1 = (cli_credentials *)(argp1); } result = (struct samr_Password *)cli_credentials_get_nt_hash(arg1,arg2); - resultobj = PyString_FromStringAndSize(result->hash, 16); + resultobj = PyString_FromStringAndSize((char *)result->hash, 16); return resultobj; fail: return NULL; diff --git a/source4/auth/session.h b/source4/auth/session.h index 233b84d39a..039c005bb0 100644 --- a/source4/auth/session.h +++ b/source4/auth/session.h @@ -28,6 +28,7 @@ struct auth_session_info { struct cli_credentials *credentials; }; +#include "librpc/gen_ndr/netlogon.h" #include "auth/session_proto.h" #endif /* _SAMBA_AUTH_SESSION_H */ diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 7c8241ba54..ffb69986e5 100644 --- a/source4/lib/ldb/ldb.i +++ b/source4/lib/ldb/ldb.i @@ -146,9 +146,9 @@ typedef int ldb_error; %rename(Dn) ldb_dn; typedef struct ldb_dn { %extend { - ldb_dn(ldb *ldb, const char *str) + ldb_dn(ldb *ldb_ctx, const char *str) { - ldb_dn *ret = ldb_dn_new(ldb, ldb, str); + ldb_dn *ret = ldb_dn_new(ldb_ctx, ldb_ctx, str); /* ldb_dn_new() doesn't accept NULL as memory context, so we do it this way... */ talloc_steal(NULL, ret); @@ -194,12 +194,12 @@ fail: #ifdef SWIGPYTHON %{ int ldb_dn_from_pyobject(TALLOC_CTX *mem_ctx, PyObject *object, - struct ldb_context *ldb, ldb_dn **dn) + struct ldb_context *ldb_ctx, ldb_dn **dn) { int ret; struct ldb_dn *odn; - if (ldb != NULL && PyString_Check(object)) { - *dn = ldb_dn_new(mem_ctx, ldb, PyString_AsString(object)); + if (ldb_ctx != NULL && PyString_Check(object)) { + *dn = ldb_dn_new(mem_ctx, ldb_ctx, PyString_AsString(object)); return 0; } ret = SWIG_ConvertPtr(object, (void **)&odn, SWIGTYPE_p_ldb_dn, @@ -387,7 +387,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * PyObject *fn = context; vasprintf(&text, fmt, ap); - PyObject_CallFunction(fn, "(i,s)", level, text); + PyObject_CallFunction(fn, (char *)"(i,s)", level, text); free(text); } %} @@ -408,7 +408,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * if (ldif == NULL) { return Py_None; } else { - return Py_BuildValue("(iO)", ldif->changetype, + return Py_BuildValue((char *)"(iO)", ldif->changetype, SWIG_NewPointerObj(ldif->msg, SWIGTYPE_p_ldb_message, 0)); } } @@ -427,7 +427,7 @@ PyObject *PyExc_LdbError; %} %init %{ - PyExc_LdbError = PyErr_NewException("_ldb.LdbError", NULL, NULL); + PyExc_LdbError = PyErr_NewException((char *)"_ldb.LdbError", NULL, NULL); PyDict_SetItemString(d, "LdbError", PyExc_LdbError); %} @@ -442,7 +442,7 @@ PyObject *PyExc_LdbError; %typemap(out,noblock=1) ldb_error { if ($1 != LDB_SUCCESS) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", $1, ldb_strerror($1))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", $1, ldb_strerror($1))); SWIG_fail; } $result = Py_None; @@ -466,20 +466,20 @@ typedef struct ldb_context { ldb(const char *url=NULL, unsigned int flags = 0, const char *options[] = NULL) { - ldb *ldb = ldb_init(NULL); + ldb *ldb_ctx = ldb_init(NULL); if (url != NULL) { int ret; - ret = ldb_connect(ldb, url, flags, options); + ret = ldb_connect(ldb_ctx, url, flags, options); if (ret != LDB_SUCCESS) - SWIG_exception(SWIG_ValueError, ldb_errstring(ldb)); + SWIG_exception(SWIG_ValueError, ldb_errstring(ldb_ctx)); } - return ldb; + return ldb_ctx; fail: - talloc_free(ldb); + talloc_free(ldb_ctx); return NULL; } @@ -606,7 +606,7 @@ time_t ldb_string_to_time(const char *s); %typemap(in) const struct ldb_module_ops * { $1 = talloc_zero(talloc_autofree_context(), struct ldb_module_ops); - $1->name = PyObject_GetAttrString($input, "name"); + $1->name = (char *)PyObject_GetAttrString($input, (char *)"name"); } %rename(register_module) ldb_register_module; diff --git a/source4/lib/ldb/ldb_wrap.c b/source4/lib/ldb/ldb_wrap.c index 1823fc192c..2272654b2c 100644 --- a/source4/lib/ldb/ldb_wrap.c +++ b/source4/lib/ldb/ldb_wrap.c @@ -2615,8 +2615,8 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -SWIGINTERN ldb_dn *new_ldb_dn(ldb *ldb,char const *str){ - ldb_dn *ret = ldb_dn_new(ldb, ldb, str); +SWIGINTERN ldb_dn *new_ldb_dn(ldb *ldb_ctx,char const *str){ + ldb_dn *ret = ldb_dn_new(ldb_ctx, ldb_ctx, str); /* ldb_dn_new() doesn't accept NULL as memory context, so we do it this way... */ talloc_steal(NULL, ret); @@ -2673,12 +2673,12 @@ SWIGINTERN ldb_dn *ldb_dn___add__(ldb_dn *self,ldb_dn *other){ } int ldb_dn_from_pyobject(TALLOC_CTX *mem_ctx, PyObject *object, - struct ldb_context *ldb, ldb_dn **dn) + struct ldb_context *ldb_ctx, ldb_dn **dn) { int ret; struct ldb_dn *odn; - if (ldb != NULL && PyString_Check(object)) { - *dn = ldb_dn_new(mem_ctx, ldb, PyString_AsString(object)); + if (ldb_ctx != NULL && PyString_Check(object)) { + *dn = ldb_dn_new(mem_ctx, ldb_ctx, PyString_AsString(object)); return 0; } ret = SWIG_ConvertPtr(object, (void **)&odn, SWIGTYPE_p_ldb_dn, @@ -2953,7 +2953,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * PyObject *fn = context; vasprintf(&text, fmt, ap); - PyObject_CallFunction(fn, "(i,s)", level, text); + PyObject_CallFunction(fn, (char *)"(i,s)", level, text); free(text); } @@ -2963,7 +2963,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * if (ldif == NULL) { return Py_None; } else { - return Py_BuildValue("(iO)", ldif->changetype, + return Py_BuildValue((char *)"(iO)", ldif->changetype, SWIG_NewPointerObj(ldif->msg, SWIGTYPE_p_ldb_message, 0)); } } @@ -3032,20 +3032,20 @@ SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) } SWIGINTERN ldb *new_ldb(char const *url,unsigned int flags,char const *options[]){ - ldb *ldb = ldb_init(NULL); + ldb *ldb_ctx = ldb_init(NULL); if (url != NULL) { int ret; - ret = ldb_connect(ldb, url, flags, options); + ret = ldb_connect(ldb_ctx, url, flags, options); if (ret != 0) - SWIG_exception(SWIG_ValueError, ldb_errstring(ldb)); + SWIG_exception(SWIG_ValueError, ldb_errstring(ldb_ctx)); } - return ldb; + return ldb_ctx; fail: - talloc_free(ldb); + talloc_free(ldb_ctx); return NULL; } SWIGINTERN void delete_ldb(ldb *self){ talloc_free(self); } @@ -3127,7 +3127,7 @@ SWIGINTERN PyObject *_wrap_new_Dn(PyObject *SWIGUNUSEDPARM(self), PyObject *args PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char * kwnames[] = { - (char *) "ldb",(char *) "str", NULL + (char *) "ldb_ctx",(char *) "str", NULL }; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_Dn",kwnames,&obj0,&obj1)) SWIG_fail; @@ -4295,7 +4295,7 @@ SWIGINTERN PyObject *_wrap_Ldb_connect(PyObject *SWIGUNUSEDPARM(self), PyObject "ldb context must be non-NULL"); result = ldb_connect(arg1,(char const *)arg2,arg3,(char const *(*))arg4); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4404,7 +4404,7 @@ SWIGINTERN PyObject *_wrap_Ldb_search(PyObject *SWIGUNUSEDPARM(self), PyObject * "ldb context must be non-NULL"); result = ldb_search(arg1,arg2,arg3,(char const *)arg4,(char const *const *)arg5,arg6); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4459,7 +4459,7 @@ SWIGINTERN PyObject *_wrap_Ldb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject * "ldb context must be non-NULL"); result = ldb_delete(arg1,arg2); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4503,7 +4503,7 @@ SWIGINTERN PyObject *_wrap_Ldb_rename(PyObject *SWIGUNUSEDPARM(self), PyObject * "ldb context must be non-NULL"); result = ldb_rename(arg1,arg2,arg3); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4546,7 +4546,7 @@ SWIGINTERN PyObject *_wrap_Ldb_add__SWIG_0(PyObject *SWIGUNUSEDPARM(self), int n "Message can not be None"); result = ldb_add(arg1,arg2); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4576,7 +4576,7 @@ SWIGINTERN PyObject *_wrap_Ldb_add__SWIG_1(PyObject *SWIGUNUSEDPARM(self), int n "ldb context must be non-NULL"); result = ldb_add__SWIG_1(arg1,arg2); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4648,7 +4648,7 @@ SWIGINTERN PyObject *_wrap_Ldb_modify(PyObject *SWIGUNUSEDPARM(self), PyObject * "Message can not be None"); result = ldb_modify(arg1,arg2); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4895,7 +4895,7 @@ SWIGINTERN PyObject *_wrap_Ldb_set_debug(PyObject *SWIGUNUSEDPARM(self), PyObjec "ldb context must be non-NULL"); result = ldb_set_debug(arg1,arg2,arg3); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -4944,7 +4944,7 @@ SWIGINTERN PyObject *_wrap_Ldb_set_opaque(PyObject *SWIGUNUSEDPARM(self), PyObje "ldb context must be non-NULL"); result = ldb_set_opaque(arg1,(char const *)arg2,arg3); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5016,7 +5016,7 @@ SWIGINTERN PyObject *_wrap_Ldb_transaction_start(PyObject *SWIGUNUSEDPARM(self), "ldb context must be non-NULL"); result = ldb_transaction_start(arg1); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5046,7 +5046,7 @@ SWIGINTERN PyObject *_wrap_Ldb_transaction_commit(PyObject *SWIGUNUSEDPARM(self) "ldb context must be non-NULL"); result = ldb_transaction_commit(arg1); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5076,7 +5076,7 @@ SWIGINTERN PyObject *_wrap_Ldb_transaction_cancel(PyObject *SWIGUNUSEDPARM(self) "ldb context must be non-NULL"); result = ldb_transaction_cancel(arg1); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5118,7 +5118,7 @@ SWIGINTERN PyObject *_wrap_Ldb___contains__(PyObject *SWIGUNUSEDPARM(self), PyOb "ldb context must be non-NULL"); result = ldb___contains__(arg1,arg2,arg3); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5284,11 +5284,11 @@ SWIGINTERN PyObject *_wrap_register_module(PyObject *SWIGUNUSEDPARM(self), PyObj { arg1 = talloc_zero(talloc_autofree_context(), struct ldb_module_ops); - arg1->name = PyObject_GetAttrString(obj0, "name"); + arg1->name = (char *)PyObject_GetAttrString(obj0, (char *)"name"); } result = ldb_register_module((struct ldb_module_ops const *)arg1); if (result != 0) { - PyErr_SetObject(PyExc_LdbError, Py_BuildValue("(i,s)", result, ldb_strerror(result))); + PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result))); SWIG_fail; } resultobj = Py_None; @@ -5992,7 +5992,7 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "CHANGETYPE_DELETE",SWIG_From_int((int)(LDB_CHANGETYPE_DELETE))); SWIG_Python_SetConstant(d, "CHANGETYPE_MODIFY",SWIG_From_int((int)(LDB_CHANGETYPE_MODIFY))); - PyExc_LdbError = PyErr_NewException("_ldb.LdbError", NULL, NULL); + PyExc_LdbError = PyErr_NewException((char *)"_ldb.LdbError", NULL, NULL); PyDict_SetItemString(d, "LdbError", PyExc_LdbError); SWIG_Python_SetConstant(d, "LDB_ERR_OPERATIONS_ERROR",SWIG_From_int((int)(1))); diff --git a/source4/lib/registry/registry.i b/source4/lib/registry/registry.i index 6f46e081c2..20ae671c75 100644 --- a/source4/lib/registry/registry.i +++ b/source4/lib/registry/registry.i @@ -26,6 +26,7 @@ #include "includes.h" #include "registry.h" #include "param/param.h" +#include "hive.h" typedef struct registry_context reg; typedef struct hive_key hive_key; @@ -102,16 +103,16 @@ typedef struct registry_context { WERROR generate_diff(struct registry_context *ctx2, const struct reg_diff_callbacks *callbacks, void *callback_data); - WERROR mount_hive(struct hive_key *hive_key, uint32_t hkey_id, + WERROR mount_hive(struct hive_key *key, uint32_t hkey_id, const char **elements=NULL); struct registry_key *import_hive_key(struct hive_key *hive, uint32_t predef_key, const char **elements); - WERROR mount_hive(struct hive_key *hive_key, const char *predef_name) + WERROR mount_hive(struct hive_key *key, const char *predef_name) { int i; for (i = 0; reg_predefined_keys[i].name; i++) { if (!strcasecmp(reg_predefined_keys[i].name, predef_name)) - return reg_mount_hive($self, hive_key, + return reg_mount_hive($self, key, reg_predefined_keys[i].handle, NULL); } return WERR_INVALID_NAME; diff --git a/source4/lib/registry/registry_wrap.c b/source4/lib/registry/registry_wrap.c index 00c7fc32b2..c5741b7e2c 100644 --- a/source4/lib/registry/registry_wrap.c +++ b/source4/lib/registry/registry_wrap.c @@ -2529,6 +2529,7 @@ static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0}; #include "includes.h" #include "registry.h" #include "param/param.h" +#include "hive.h" typedef struct registry_context reg; typedef struct hive_key hive_key; @@ -2830,11 +2831,11 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -SWIGINTERN WERROR reg_mount_hive__SWIG_1(reg *self,struct hive_key *hive_key,char const *predef_name){ +SWIGINTERN WERROR reg_mount_hive__SWIG_1(reg *self,struct hive_key *key,char const *predef_name){ int i; for (i = 0; reg_predefined_keys[i].name; i++) { if (!strcasecmp(reg_predefined_keys[i].name, predef_name)) - return reg_mount_hive(self, hive_key, + return reg_mount_hive(self, key, reg_predefined_keys[i].handle, NULL); } return WERR_INVALID_NAME; @@ -2949,7 +2950,7 @@ SWIGINTERN PyObject *_wrap_Registry(PyObject *SWIGUNUSEDPARM(self), PyObject *ar } result = reg_open_local(arg1,arg2,arg3,arg4); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3000,7 +3001,7 @@ SWIGINTERN PyObject *_wrap_reg_get_predefined_key_by_name(PyObject *SWIGUNUSEDPA arg3 = (struct registry_key **)(argp3); result = reg_get_predefined_key_by_name(arg1,(char const *)arg2,arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3043,7 +3044,7 @@ SWIGINTERN PyObject *_wrap_reg_key_del_abs(PyObject *SWIGUNUSEDPARM(self), PyObj arg2 = (char *)(buf2); result = reg_key_del_abs(arg1,(char const *)arg2); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3094,7 +3095,7 @@ SWIGINTERN PyObject *_wrap_reg_get_predefined_key(PyObject *SWIGUNUSEDPARM(self) arg3 = (struct registry_key **)(argp3); result = reg_get_predefined_key(arg1,arg2,arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3135,7 +3136,7 @@ SWIGINTERN PyObject *_wrap_reg_diff_apply(PyObject *SWIGUNUSEDPARM(self), PyObje arg2 = (char *)(buf2); result = reg_diff_apply(arg1,(char const *)arg2); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3193,7 +3194,7 @@ SWIGINTERN PyObject *_wrap_reg_generate_diff(PyObject *SWIGUNUSEDPARM(self), PyO } result = reg_generate_diff(arg1,arg2,(struct reg_diff_callbacks const *)arg3,arg4); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3259,7 +3260,7 @@ SWIGINTERN PyObject *_wrap_reg_mount_hive__SWIG_0(PyObject *SWIGUNUSEDPARM(self) } result = reg_mount_hive(arg1,arg2,arg3,(char const **)arg4); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3372,7 +3373,7 @@ SWIGINTERN PyObject *_wrap_reg_mount_hive__SWIG_1(PyObject *SWIGUNUSEDPARM(self) arg3 = (char *)(buf3); result = reg_mount_hive__SWIG_1(arg1,arg2,(char const *)arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3523,7 +3524,7 @@ SWIGINTERN PyObject *_wrap_hive_key(PyObject *SWIGUNUSEDPARM(self), PyObject *ar } result = reg_open_hive(arg1,(char const *)arg2,arg3,arg4,arg5,arg6); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3600,7 +3601,7 @@ SWIGINTERN PyObject *_wrap_open_ldb(PyObject *SWIGUNUSEDPARM(self), PyObject *ar } result = reg_open_ldb_file(arg1,(char const *)arg2,arg3,arg4,arg5,arg6); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3641,7 +3642,7 @@ SWIGINTERN PyObject *_wrap_create_dir(PyObject *SWIGUNUSEDPARM(self), PyObject * arg2 = (char *)(buf2); result = reg_create_directory(arg1,(char const *)arg2,arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3682,7 +3683,7 @@ SWIGINTERN PyObject *_wrap_open_dir(PyObject *SWIGUNUSEDPARM(self), PyObject *ar arg2 = (char *)(buf2); result = reg_open_directory(arg1,(char const *)arg2,arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3749,7 +3750,7 @@ SWIGINTERN PyObject *_wrap_open_samba(PyObject *SWIGUNUSEDPARM(self), PyObject * } result = reg_open_samba(arg1,arg2,arg3,arg4,arg5); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { diff --git a/source4/libcli/security/security.i b/source4/libcli/security/security.i index 7e48251e51..647c9aea09 100644 --- a/source4/libcli/security/security.i +++ b/source4/libcli/security/security.i @@ -83,8 +83,8 @@ typedef struct security_descriptor { security_descriptor(TALLOC_CTX *mem_ctx) { return security_descriptor_initialise(mem_ctx); } NTSTATUS sacl_add(const struct security_ace *ace); NTSTATUS dacl_add(const struct security_ace *ace); - NTSTATUS dacl_del(const struct security_ace *ace); - NTSTATUS sacl_del(const struct security_ace *ace); + NTSTATUS dacl_del(const struct dom_sid *trustee); + NTSTATUS sacl_del(const struct dom_sid *trustee); #ifdef SWIGPYTHON %rename(__eq__) equal; #endif diff --git a/source4/libcli/security/security_descriptor.c b/source4/libcli/security/security_descriptor.c index 6a124d7371..882284dd9b 100644 --- a/source4/libcli/security/security_descriptor.c +++ b/source4/libcli/security/security_descriptor.c @@ -235,7 +235,7 @@ NTSTATUS security_descriptor_dacl_add(struct security_descriptor *sd, static NTSTATUS security_descriptor_acl_del(struct security_descriptor *sd, bool sacl_del, - struct dom_sid *trustee) + const struct dom_sid *trustee) { int i; bool found = false; @@ -292,7 +292,7 @@ static NTSTATUS security_descriptor_acl_del(struct security_descriptor *sd, */ NTSTATUS security_descriptor_dacl_del(struct security_descriptor *sd, - struct dom_sid *trustee) + const struct dom_sid *trustee) { return security_descriptor_acl_del(sd, false, trustee); } @@ -303,7 +303,7 @@ NTSTATUS security_descriptor_dacl_del(struct security_descriptor *sd, */ NTSTATUS security_descriptor_sacl_del(struct security_descriptor *sd, - struct dom_sid *trustee) + const struct dom_sid *trustee) { return security_descriptor_acl_del(sd, true, trustee); } diff --git a/source4/libcli/security/security_wrap.c b/source4/libcli/security/security_wrap.c index 58bfd19bec..72118b2359 100644 --- a/source4/libcli/security/security_wrap.c +++ b/source4/libcli/security/security_wrap.c @@ -3116,7 +3116,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_add(PyObject *SWIGUNUSEDPARM arg2 = (struct security_ace *)(argp2); result = security_descriptor_sacl_add(arg1,(struct security_ace const *)arg2); if (NT_STATUS_IS_ERR(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, nt_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, nt_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3156,7 +3156,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_add(PyObject *SWIGUNUSEDPARM arg2 = (struct security_ace *)(argp2); result = security_descriptor_dacl_add(arg1,(struct security_ace const *)arg2); if (NT_STATUS_IS_ERR(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, nt_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, nt_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3171,7 +3171,7 @@ fail: SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; - struct security_ace *arg2 = (struct security_ace *) 0 ; + struct dom_sid *arg2 = (struct dom_sid *) 0 ; NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; @@ -3180,7 +3180,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "ace", NULL + (char *) "self",(char *) "trustee", NULL }; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_dacl_del",kwnames,&obj0,&obj1)) SWIG_fail; @@ -3189,14 +3189,14 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_descriptor_dacl_del" "', argument " "1"" of type '" "security_descriptor *""'"); } arg1 = (security_descriptor *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_ace, 0 | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_dom_sid, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_descriptor_dacl_del" "', argument " "2"" of type '" "struct security_ace const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_descriptor_dacl_del" "', argument " "2"" of type '" "struct dom_sid const *""'"); } - arg2 = (struct security_ace *)(argp2); - result = security_descriptor_dacl_del(arg1,(struct security_ace const *)arg2); + arg2 = (struct dom_sid *)(argp2); + result = security_descriptor_dacl_del(arg1,(struct dom_sid const *)arg2); if (NT_STATUS_IS_ERR(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, nt_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, nt_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { @@ -3211,7 +3211,7 @@ fail: SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; - struct security_ace *arg2 = (struct security_ace *) 0 ; + struct dom_sid *arg2 = (struct dom_sid *) 0 ; NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; @@ -3220,7 +3220,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "ace", NULL + (char *) "self",(char *) "trustee", NULL }; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_sacl_del",kwnames,&obj0,&obj1)) SWIG_fail; @@ -3229,14 +3229,14 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "security_descriptor_sacl_del" "', argument " "1"" of type '" "security_descriptor *""'"); } arg1 = (security_descriptor *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_security_ace, 0 | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_dom_sid, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_descriptor_sacl_del" "', argument " "2"" of type '" "struct security_ace const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "security_descriptor_sacl_del" "', argument " "2"" of type '" "struct dom_sid const *""'"); } - arg2 = (struct security_ace *)(argp2); - result = security_descriptor_sacl_del(arg1,(struct security_ace const *)arg2); + arg2 = (struct dom_sid *)(argp2); + result = security_descriptor_sacl_del(arg1,(struct dom_sid const *)arg2); if (NT_STATUS_IS_ERR(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, nt_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, nt_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { diff --git a/source4/libcli/util/errors.i b/source4/libcli/util/errors.i index ec230a9c18..ede536a995 100644 --- a/source4/libcli/util/errors.i +++ b/source4/libcli/util/errors.i @@ -20,7 +20,7 @@ #ifdef SWIGPYTHON %typemap(out,noblock=1) WERROR { if (!W_ERROR_IS_OK($1)) { - PyObject *obj = Py_BuildValue("(i,s)", $1.v, (char *)win_errstr($1)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", $1.v, win_errstr($1)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if ($result == NULL) { @@ -30,7 +30,7 @@ %typemap(out,noblock=1) NTSTATUS { if (NT_STATUS_IS_ERR($1)) { - PyObject *obj = Py_BuildValue("(i,s)", $1.v, (char *)nt_errstr($1)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", $1.v, nt_errstr($1)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if ($result == NULL) { diff --git a/source4/librpc/rpc/dcerpc.i b/source4/librpc/rpc/dcerpc.i index 3b860c4fa4..4128092a41 100644 --- a/source4/librpc/rpc/dcerpc.i +++ b/source4/librpc/rpc/dcerpc.i @@ -63,13 +63,13 @@ %rename(pipe_connect) dcerpc_pipe_connect; -NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, - struct dcerpc_pipe **OUT, - const char *binding, - const char *pipe_uuid, - uint32_t pipe_version, +NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, + struct dcerpc_pipe **pp, + const char *binding, + const struct ndr_interface_table *table, struct cli_credentials *credentials, - struct loadparm_context *lp_ctx); + struct event_context *ev, + struct loadparm_context *lp_ctx); %typemap(in,noblock=1) DATA_BLOB * (DATA_BLOB temp_data_blob) { temp_data_blob.data = PyString_AsString($input); diff --git a/source4/librpc/rpc/dcerpc_wrap.c b/source4/librpc/rpc/dcerpc_wrap.c index 0d4e875975..5be702b1bb 100644 --- a/source4/librpc/rpc/dcerpc_wrap.c +++ b/source4/librpc/rpc/dcerpc_wrap.c @@ -2461,22 +2461,24 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_char swig_types[2] #define SWIGTYPE_p_cli_credentials swig_types[3] #define SWIGTYPE_p_dcerpc_pipe swig_types[4] -#define SWIGTYPE_p_int swig_types[5] -#define SWIGTYPE_p_loadparm_context swig_types[6] -#define SWIGTYPE_p_loadparm_service swig_types[7] -#define SWIGTYPE_p_long_long swig_types[8] -#define SWIGTYPE_p_p_dcerpc_pipe swig_types[9] -#define SWIGTYPE_p_param_context swig_types[10] -#define SWIGTYPE_p_param_opt swig_types[11] -#define SWIGTYPE_p_param_section swig_types[12] -#define SWIGTYPE_p_short swig_types[13] -#define SWIGTYPE_p_signed_char swig_types[14] -#define SWIGTYPE_p_unsigned_char swig_types[15] -#define SWIGTYPE_p_unsigned_int swig_types[16] -#define SWIGTYPE_p_unsigned_long_long swig_types[17] -#define SWIGTYPE_p_unsigned_short swig_types[18] -static swig_type_info *swig_types[20]; -static swig_module_info swig_module = {swig_types, 19, 0, 0, 0, 0}; +#define SWIGTYPE_p_event_context swig_types[5] +#define SWIGTYPE_p_int swig_types[6] +#define SWIGTYPE_p_loadparm_context swig_types[7] +#define SWIGTYPE_p_loadparm_service swig_types[8] +#define SWIGTYPE_p_long_long swig_types[9] +#define SWIGTYPE_p_ndr_interface_table swig_types[10] +#define SWIGTYPE_p_p_dcerpc_pipe swig_types[11] +#define SWIGTYPE_p_param_context swig_types[12] +#define SWIGTYPE_p_param_opt swig_types[13] +#define SWIGTYPE_p_param_section swig_types[14] +#define SWIGTYPE_p_short swig_types[15] +#define SWIGTYPE_p_signed_char swig_types[16] +#define SWIGTYPE_p_unsigned_char swig_types[17] +#define SWIGTYPE_p_unsigned_int swig_types[18] +#define SWIGTYPE_p_unsigned_long_long swig_types[19] +#define SWIGTYPE_p_unsigned_short swig_types[20] +static swig_type_info *swig_types[22]; +static swig_module_info swig_module = {swig_types, 21, 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) @@ -2793,66 +2795,6 @@ SWIGINTERNINLINE PyObject* } SWIGINTERN void delete_cli_credentials(cli_credentials *self){ talloc_free(self); } - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = (unsigned int)(v); - } - } - return res; -} - #ifdef __cplusplus extern "C" { #endif @@ -3486,7 +3428,7 @@ SWIGINTERN PyObject *_wrap_Credentials_get_nt_hash(PyObject *SWIGUNUSEDPARM(self arg1 = (cli_credentials *)(argp1); } result = (struct samr_Password *)cli_credentials_get_nt_hash(arg1,arg2); - resultobj = PyString_FromStringAndSize(result->hash, 16); + resultobj = PyString_FromStringAndSize((char *)result->hash, 16); return resultobj; fail: return NULL; @@ -3593,20 +3535,20 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject TALLOC_CTX *arg1 = (TALLOC_CTX *) 0 ; struct dcerpc_pipe **arg2 = (struct dcerpc_pipe **) 0 ; char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - uint32_t arg5 ; - struct cli_credentials *arg6 = (struct cli_credentials *) 0 ; + struct ndr_interface_table *arg4 = (struct ndr_interface_table *) 0 ; + struct cli_credentials *arg5 = (struct cli_credentials *) 0 ; + struct event_context *arg6 = (struct event_context *) 0 ; struct loadparm_context *arg7 = (struct loadparm_context *) 0 ; NTSTATUS result; - struct dcerpc_pipe *temp_dcerpc_pipe2 ; + void *argp2 = 0 ; + int res2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; - int res4 ; - char *buf4 = 0 ; - int alloc4 = 0 ; - unsigned int val5 ; - int ecode5 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; void *argp6 = 0 ; int res6 = 0 ; void *argp7 = 0 ; @@ -3616,45 +3558,52 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; char * kwnames[] = { - (char *) "binding",(char *) "pipe_uuid",(char *) "pipe_version",(char *) "credentials",(char *) "lp_ctx", NULL + (char *) "pp",(char *) "binding",(char *) "table",(char *) "credentials",(char *) "ev",(char *) "lp_ctx", NULL }; - arg6 = NULL; + arg5 = NULL; arg7 = loadparm_init(NULL); arg1 = NULL; - arg2 = &temp_dcerpc_pipe2; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OO:pipe_connect",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res3 = SWIG_AsCharPtrAndSize(obj0, &buf3, NULL, &alloc3); + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOO:pipe_connect",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res2 = SWIG_ConvertPtr(obj0, &argp2,SWIGTYPE_p_p_dcerpc_pipe, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pipe_connect" "', argument " "2"" of type '" "struct dcerpc_pipe **""'"); + } + arg2 = (struct dcerpc_pipe **)(argp2); + res3 = SWIG_AsCharPtrAndSize(obj1, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pipe_connect" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); - res4 = SWIG_AsCharPtrAndSize(obj1, &buf4, NULL, &alloc4); + res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_ndr_interface_table, 0 | 0 ); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pipe_connect" "', argument " "4"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pipe_connect" "', argument " "4"" of type '" "struct ndr_interface_table const *""'"); } - arg4 = (char *)(buf4); - ecode5 = SWIG_AsVal_unsigned_SS_int(obj2, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pipe_connect" "', argument " "5"" of type '" "uint32_t""'"); - } - arg5 = (uint32_t)(val5); + arg4 = (struct ndr_interface_table *)(argp4); if (obj3) { - res6 = SWIG_ConvertPtr(obj3, &argp6,SWIGTYPE_p_cli_credentials, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pipe_connect" "', argument " "6"" of type '" "struct cli_credentials *""'"); + res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_cli_credentials, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pipe_connect" "', argument " "5"" of type '" "struct cli_credentials *""'"); } - arg6 = (struct cli_credentials *)(argp6); + arg5 = (struct cli_credentials *)(argp5); } if (obj4) { - res7 = SWIG_ConvertPtr(obj4, &argp7,SWIGTYPE_p_loadparm_context, 0 | 0 ); + res6 = SWIG_ConvertPtr(obj4, &argp6,SWIGTYPE_p_event_context, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pipe_connect" "', argument " "6"" of type '" "struct event_context *""'"); + } + arg6 = (struct event_context *)(argp6); + } + if (obj5) { + res7 = SWIG_ConvertPtr(obj5, &argp7,SWIGTYPE_p_loadparm_context, 0 | 0 ); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "pipe_connect" "', argument " "7"" of type '" "struct loadparm_context *""'"); } arg7 = (struct loadparm_context *)(argp7); } - result = dcerpc_pipe_connect(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7); + result = dcerpc_pipe_connect(arg1,arg2,(char const *)arg3,(struct ndr_interface_table const *)arg4,arg5,arg6,arg7); resultobj = SWIG_NewPointerObj((NTSTATUS *)memcpy((NTSTATUS *)malloc(sizeof(NTSTATUS)),&result,sizeof(NTSTATUS)), SWIGTYPE_p_NTSTATUS, SWIG_POINTER_OWN | 0 ); /* Set REF_ALLOC flag so we don't have to do too much extra mucking around with ref variables in ndr unmarshalling. */ @@ -3665,11 +3614,9 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject resultobj = SWIG_NewPointerObj(*arg2, SWIGTYPE_p_dcerpc_pipe, 0); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } @@ -3735,10 +3682,12 @@ static swig_type_info _swigt__p_TALLOC_CTX = {"_p_TALLOC_CTX", "TALLOC_CTX *", 0 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_cli_credentials = {"_p_cli_credentials", "struct cli_credentials *|cli_credentials *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_dcerpc_pipe = {"_p_dcerpc_pipe", "struct dcerpc_pipe *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_event_context = {"_p_event_context", "struct event_context *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_loadparm_context = {"_p_loadparm_context", "struct loadparm_context *|loadparm_context *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_loadparm_service = {"_p_loadparm_service", "struct loadparm_service *|loadparm_service *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ndr_interface_table = {"_p_ndr_interface_table", "struct ndr_interface_table *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_dcerpc_pipe = {"_p_p_dcerpc_pipe", "struct dcerpc_pipe **", 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}; @@ -3756,10 +3705,12 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_char, &_swigt__p_cli_credentials, &_swigt__p_dcerpc_pipe, + &_swigt__p_event_context, &_swigt__p_int, &_swigt__p_loadparm_context, &_swigt__p_loadparm_service, &_swigt__p_long_long, + &_swigt__p_ndr_interface_table, &_swigt__p_p_dcerpc_pipe, &_swigt__p_param_context, &_swigt__p_param_opt, @@ -3777,10 +3728,12 @@ static swig_cast_info _swigc__p_TALLOC_CTX[] = { {&_swigt__p_TALLOC_CTX, 0, 0, static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_cli_credentials[] = { {&_swigt__p_cli_credentials, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_dcerpc_pipe[] = { {&_swigt__p_dcerpc_pipe, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_event_context[] = { {&_swigt__p_event_context, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_loadparm_context[] = { {&_swigt__p_loadparm_context, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_loadparm_service[] = { {&_swigt__p_loadparm_service, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ndr_interface_table[] = { {&_swigt__p_ndr_interface_table, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_dcerpc_pipe[] = { {&_swigt__p_p_dcerpc_pipe, 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}}; @@ -3798,10 +3751,12 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_char, _swigc__p_cli_credentials, _swigc__p_dcerpc_pipe, + _swigc__p_event_context, _swigc__p_int, _swigc__p_loadparm_context, _swigc__p_loadparm_service, _swigc__p_long_long, + _swigc__p_ndr_interface_table, _swigc__p_p_dcerpc_pipe, _swigc__p_param_context, _swigc__p_param_opt, diff --git a/source4/param/param.i b/source4/param/param.i index f5877a167a..55c7b3fe0c 100644 --- a/source4/param/param.i +++ b/source4/param/param.i @@ -57,7 +57,7 @@ typedef struct loadparm_context { const char *configfile() { return lp_configfile($self); } bool is_mydomain(const char *domain) { return lp_is_mydomain($self, domain); } bool is_myname(const char *name) { return lp_is_myname($self, name); } - int use(struct param_context *param) { return param_use($self, param); } + int use(struct param_context *param_ctx) { return param_use($self, param_ctx); } bool set(const char *parm_name, const char *parm_value) { return lp_set_cmdline($self, parm_name, parm_value); } @@ -143,12 +143,12 @@ typedef struct loadparm_context { return Py_None; case P_LIST: { - int i; + int j; const char **strlist = *(const char ***)parm_ptr; PyObject *pylist = PyList_New(str_list_length(strlist)); - for (i = 0; strlist[i]; i++) - PyList_SetItem(pylist, i, - PyString_FromString(strlist[i])); + for (j = 0; strlist[j]; j++) + PyList_SetItem(pylist, j, + PyString_FromString(strlist[j])); return pylist; } @@ -181,9 +181,9 @@ typedef struct param_context { struct param_opt *get(const char *name, const char *section_name="global"); const char *get_string(const char *name, const char *section_name="global"); int set_string(const char *param, const char *value, const char *section="global"); - int set(const char *param, PyObject *ob, const char *section_name="global") + int set(const char *parameter, PyObject *ob, const char *section_name="global") { - struct param_opt *opt = param_get_add($self, param, section_name); + struct param_opt *opt = param_get_add($self, parameter, section_name); talloc_free(opt->value); opt->value = talloc_strdup(opt, PyObject_Str(ob)); diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c index c2df6bd1d0..d594955f38 100644 --- a/source4/param/param_wrap.c +++ b/source4/param/param_wrap.c @@ -2641,7 +2641,7 @@ SWIG_FromCharPtr(const char *cptr) SWIGINTERN bool loadparm_context_is_mydomain(loadparm_context *self,char const *domain){ return lp_is_mydomain(self, domain); } SWIGINTERN bool loadparm_context_is_myname(loadparm_context *self,char const *name){ return lp_is_myname(self, name); } -SWIGINTERN int loadparm_context_use(loadparm_context *self,struct param_context *param){ return param_use(self, param); } +SWIGINTERN int loadparm_context_use(loadparm_context *self,struct param_context *param_ctx){ return param_use(self, param_ctx); } SWIGINTERN bool loadparm_context_set(loadparm_context *self,char const *parm_name,char const *parm_value){ return lp_set_cmdline(self, parm_name, parm_value); } @@ -2725,12 +2725,12 @@ SWIGINTERN PyObject *loadparm_context_get(loadparm_context *self,char const *par return Py_None; case P_LIST: { - int i; + int j; const char **strlist = *(const char ***)parm_ptr; PyObject *pylist = PyList_New(str_list_length(strlist)); - for (i = 0; strlist[i]; i++) - PyList_SetItem(pylist, i, - PyString_FromString(strlist[i])); + for (j = 0; strlist[j]; j++) + PyList_SetItem(pylist, j, + PyString_FromString(strlist[j])); return pylist; } @@ -2743,8 +2743,8 @@ SWIGINTERN char const *loadparm_service_volume_label(loadparm_service *self){ re SWIGINTERN char const *loadparm_service_printername(loadparm_service *self){ return lp_printername(self); } SWIGINTERN int loadparm_service_maxprintjobs(loadparm_service *self){ return lp_maxprintjobs(self); } SWIGINTERN param *new_param(TALLOC_CTX *mem_ctx){ return param_init(mem_ctx); } -SWIGINTERN int param_set(param *self,char const *param,PyObject *ob,char const *section_name){ - struct param_opt *opt = param_get_add(self, param, section_name); +SWIGINTERN int param_set(param *self,char const *parameter,PyObject *ob,char const *section_name){ + struct param_opt *opt = param_get_add(self, parameter, section_name); talloc_free(opt->value); opt->value = talloc_strdup(opt, PyObject_Str(ob)); @@ -3008,7 +3008,7 @@ SWIGINTERN PyObject *_wrap_LoadParm_use(PyObject *SWIGUNUSEDPARM(self), PyObject PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "param", NULL + (char *) "self",(char *) "param_ctx", NULL }; arg1 = loadparm_init(NULL); @@ -3536,7 +3536,7 @@ SWIGINTERN PyObject *_wrap_ParamFile_set(PyObject *SWIGUNUSEDPARM(self), PyObjec PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "param",(char *) "ob",(char *) "section_name", NULL + (char *) "self",(char *) "parameter",(char *) "ob",(char *) "section_name", NULL }; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:ParamFile_set",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; diff --git a/source4/samba4-knownfail b/source4/samba4-knownfail index b582d44097..227dad323c 100644 --- a/source4/samba4-knownfail +++ b/source4/samba4-knownfail @@ -33,4 +33,3 @@ RPC-NETLOGON.*.GetPassword RPC-NETLOGON.*.GetTrustPasswords BASE-CHARSET.*.Testing partial surrogate .*NET-API-DELSHARE.* # DelShare isn't implemented yet -ldap.python # Conversion not finished yet diff --git a/source4/samba4-skip b/source4/samba4-skip index d88f010511..9ca63f4568 100644 --- a/source4/samba4-skip +++ b/source4/samba4-skip @@ -49,3 +49,5 @@ RPC-FRSAPI # Not provided by Samba 4 ^samba4.NET-API-BECOME-DC.*$ # Fails WINBIND # FIXME: This should not be skipped NSS-TEST # Fails +samba4.ldap.python # Conversion from EJS not yet finished +samba4.samba3.python # Conversion from EJS not yet finished diff --git a/source4/scripting/python/misc.i b/source4/scripting/python/misc.i index 3af10dfce9..2f41840670 100644 --- a/source4/scripting/python/misc.i +++ b/source4/scripting/python/misc.i @@ -22,6 +22,7 @@ #include "includes.h" #include "ldb.h" #include "param/param.h" +#include "auth/credentials/credentials.h" #include "dsdb/samdb/samdb.h" #include "lib/ldb-samba/ldif_handlers.h" %} diff --git a/source4/scripting/python/misc_wrap.c b/source4/scripting/python/misc_wrap.c index 03128c2e9e..a7493550cc 100644 --- a/source4/scripting/python/misc_wrap.c +++ b/source4/scripting/python/misc_wrap.c @@ -2530,6 +2530,7 @@ static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; #include "includes.h" #include "ldb.h" #include "param/param.h" +#include "auth/credentials/credentials.h" #include "dsdb/samdb/samdb.h" #include "lib/ldb-samba/ldif_handlers.h" @@ -3016,7 +3017,7 @@ SWIGINTERN PyObject *_wrap_dsdb_attach_schema_from_ldif_file(PyObject *SWIGUNUSE "ldb context must be non-NULL"); result = dsdb_attach_schema_from_ldif_file(arg1,(char const *)arg2,(char const *)arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue("(i,s)", (&result)->v, win_errstr(result)); + PyObject *obj = Py_BuildValue((char *)"(i,s)", (&result)->v, win_errstr(result)); PyErr_SetObject(PyExc_RuntimeError, obj); SWIG_fail; } else if (resultobj == NULL) { |