diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/security/security.i | 8 | ||||
-rw-r--r-- | source4/libcli/security/security.py | 5 | ||||
-rw-r--r-- | source4/libcli/security/security_wrap.c | 62 | ||||
-rw-r--r-- | source4/libcli/security/tests/bindings.py | 4 | ||||
-rw-r--r-- | source4/libcli/swig/libcli_smb.i | 2 | ||||
-rw-r--r-- | source4/libcli/swig/libcli_smb.py | 2 | ||||
-rw-r--r-- | source4/libcli/swig/libcli_smb_wrap.c | 14 |
7 files changed, 58 insertions, 39 deletions
diff --git a/source4/libcli/security/security.i b/source4/libcli/security/security.i index 1d964cc3d5..6ba106bb5f 100644 --- a/source4/libcli/security/security.i +++ b/source4/libcli/security/security.i @@ -27,8 +27,8 @@ typedef struct security_token security_token; typedef struct security_descriptor security_descriptor; %} -%import "../../lib/talloc/talloc.i" -%import "../util/errors.i" +%import "../lib/talloc/talloc.i" +%include "../util/errors.i" %import "stdint.i" enum sec_privilege { @@ -117,6 +117,10 @@ typedef struct dom_sid { #endif bool equal(const struct dom_sid *other); } +%pythoncode { + def __repr__(self): + return "Sid(%r)" % str(self) +} } dom_sid; %feature("docstring") random_sid "random_sid() -> sid\n" \ diff --git a/source4/libcli/security/security.py b/source4/libcli/security/security.py index 065c7a19e4..c310dde56b 100644 --- a/source4/libcli/security/security.py +++ b/source4/libcli/security/security.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.35 +# Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. @@ -149,6 +149,9 @@ class Sid(object): __repr__ = _swig_repr def __init__(self, *args, **kwargs): _security.Sid_swiginit(self,_security.new_Sid(*args, **kwargs)) + def __repr__(self): + return "Sid(%r)" % str(self) + __swig_destroy__ = _security.delete_Sid Sid.__str__ = new_instancemethod(_security.Sid___str__,None,Sid) Sid.__eq__ = new_instancemethod(_security.Sid___eq__,None,Sid) diff --git a/source4/libcli/security/security_wrap.c b/source4/libcli/security/security_wrap.c index a10626c043..b7d66b5aec 100644 --- a/source4/libcli/security/security_wrap.c +++ b/source4/libcli/security/security_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 1.3.36 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -52,6 +52,12 @@ # endif #endif +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) @@ -2521,7 +2527,7 @@ static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0}; #define SWIG_name "_security" -#define SWIGVERSION 0x010335 +#define SWIGVERSION 0x010336 #define SWIG_VERSION SWIGVERSION @@ -2537,6 +2543,9 @@ typedef struct security_token security_token; typedef struct security_descriptor security_descriptor; +#include "libcli/util/pyerrors.h" + + #define SWIG_From_long PyInt_FromLong @@ -2834,7 +2843,6 @@ SWIGINTERN PyObject *_wrap_SecurityToken_is_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; struct dom_sid *arg2 = (struct dom_sid *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -2844,6 +2852,7 @@ SWIGINTERN PyObject *_wrap_SecurityToken_is_sid(PyObject *SWIGUNUSEDPARM(self), char * kwnames[] = { (char *) "self",(char *) "sid", NULL }; + bool result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SecurityToken_is_sid",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_token, 0 | 0 ); @@ -2867,10 +2876,10 @@ fail: SWIGINTERN PyObject *_wrap_SecurityToken_is_system(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + bool result; if (!args) SWIG_fail; swig_obj[0] = args; @@ -2890,10 +2899,10 @@ fail: SWIGINTERN PyObject *_wrap_SecurityToken_is_anonymous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + bool result; if (!args) SWIG_fail; swig_obj[0] = args; @@ -2914,7 +2923,6 @@ SWIGINTERN PyObject *_wrap_SecurityToken_has_sid(PyObject *SWIGUNUSEDPARM(self), PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; struct dom_sid *arg2 = (struct dom_sid *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -2924,6 +2932,7 @@ SWIGINTERN PyObject *_wrap_SecurityToken_has_sid(PyObject *SWIGUNUSEDPARM(self), char * kwnames[] = { (char *) "self",(char *) "sid", NULL }; + bool result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SecurityToken_has_sid",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_token, 0 | 0 ); @@ -2947,10 +2956,10 @@ fail: SWIGINTERN PyObject *_wrap_SecurityToken_has_builtin_administrators(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + bool result; if (!args) SWIG_fail; swig_obj[0] = args; @@ -2970,10 +2979,10 @@ fail: SWIGINTERN PyObject *_wrap_SecurityToken_has_nt_authenticated_users(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + bool result; if (!args) SWIG_fail; swig_obj[0] = args; @@ -2994,7 +3003,6 @@ SWIGINTERN PyObject *_wrap_SecurityToken_has_privilege(PyObject *SWIGUNUSEDPARM( PyObject *resultobj = 0; security_token *arg1 = (security_token *) 0 ; enum sec_privilege arg2 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; int val2 ; @@ -3004,6 +3012,7 @@ SWIGINTERN PyObject *_wrap_SecurityToken_has_privilege(PyObject *SWIGUNUSEDPARM( char * kwnames[] = { (char *) "self",(char *) "privilege", NULL }; + bool result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SecurityToken_has_privilege",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_token, 0 | 0 ); @@ -3072,7 +3081,6 @@ SWIGINTERN PyObject *_wrap_delete_SecurityToken(PyObject *SWIGUNUSEDPARM(self), } arg1 = (security_token *)(argp1); delete_security_token(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -3110,7 +3118,6 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_add(PyObject *SWIGUNUSEDPARM PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; struct security_ace *arg2 = (struct security_ace *) 0 ; - NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3120,6 +3127,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_add(PyObject *SWIGUNUSEDPARM char * kwnames[] = { (char *) "self",(char *) "ace", NULL }; + NTSTATUS result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_sacl_add",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_descriptor, 0 | 0 ); @@ -3134,8 +3142,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((char *)"(i,s)", NT_STATUS_V(result), nt_errstr(result)); - PyErr_SetObject(PyExc_RuntimeError, obj); + PyErr_SetNTSTATUS(result); SWIG_fail; } else if (resultobj == NULL) { resultobj = Py_None; @@ -3150,7 +3157,6 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_add(PyObject *SWIGUNUSEDPARM PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; struct security_ace *arg2 = (struct security_ace *) 0 ; - NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3160,6 +3166,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_add(PyObject *SWIGUNUSEDPARM char * kwnames[] = { (char *) "self",(char *) "ace", NULL }; + NTSTATUS result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_dacl_add",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_descriptor, 0 | 0 ); @@ -3174,8 +3181,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((char *)"(i,s)", NT_STATUS_V(result), nt_errstr(result)); - PyErr_SetObject(PyExc_RuntimeError, obj); + PyErr_SetNTSTATUS(result); SWIG_fail; } else if (resultobj == NULL) { resultobj = Py_None; @@ -3190,7 +3196,6 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; struct dom_sid *arg2 = (struct dom_sid *) 0 ; - NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3200,6 +3205,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM char * kwnames[] = { (char *) "self",(char *) "trustee", NULL }; + NTSTATUS result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_dacl_del",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_descriptor, 0 | 0 ); @@ -3214,8 +3220,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_dacl_del(PyObject *SWIGUNUSEDPARM 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((char *)"(i,s)", NT_STATUS_V(result), nt_errstr(result)); - PyErr_SetObject(PyExc_RuntimeError, obj); + PyErr_SetNTSTATUS(result); SWIG_fail; } else if (resultobj == NULL) { resultobj = Py_None; @@ -3230,7 +3235,6 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; struct dom_sid *arg2 = (struct dom_sid *) 0 ; - NTSTATUS result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3240,6 +3244,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM char * kwnames[] = { (char *) "self",(char *) "trustee", NULL }; + NTSTATUS result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor_sacl_del",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_descriptor, 0 | 0 ); @@ -3254,8 +3259,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor_sacl_del(PyObject *SWIGUNUSEDPARM 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((char *)"(i,s)", NT_STATUS_V(result), nt_errstr(result)); - PyErr_SetObject(PyExc_RuntimeError, obj); + PyErr_SetNTSTATUS(result); SWIG_fail; } else if (resultobj == NULL) { resultobj = Py_None; @@ -3270,7 +3274,6 @@ SWIGINTERN PyObject *_wrap_security_descriptor___eq__(PyObject *SWIGUNUSEDPARM(s PyObject *resultobj = 0; security_descriptor *arg1 = (security_descriptor *) 0 ; struct security_descriptor *arg2 = (struct security_descriptor *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3280,6 +3283,7 @@ SWIGINTERN PyObject *_wrap_security_descriptor___eq__(PyObject *SWIGUNUSEDPARM(s char * kwnames[] = { (char *) "self",(char *) "other", NULL }; + bool result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:security_descriptor___eq__",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_security_descriptor, 0 | 0 ); @@ -3315,7 +3319,6 @@ SWIGINTERN PyObject *_wrap_delete_security_descriptor(PyObject *SWIGUNUSEDPARM(s } arg1 = (security_descriptor *)(argp1); delete_security_descriptor(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -3338,7 +3341,6 @@ SWIGINTERN PyObject *_wrap_new_Sid(PyObject *SWIGUNUSEDPARM(self), PyObject *arg PyObject *resultobj = 0; TALLOC_CTX *arg1 = (TALLOC_CTX *) 0 ; char *arg2 = (char *) 0 ; - dom_sid *result = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; @@ -3346,6 +3348,7 @@ SWIGINTERN PyObject *_wrap_new_Sid(PyObject *SWIGUNUSEDPARM(self), PyObject *arg char * kwnames[] = { (char *) "text", NULL }; + dom_sid *result = 0 ; arg1 = NULL; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_Sid",kwnames,&obj0)) SWIG_fail; @@ -3368,10 +3371,10 @@ SWIGINTERN PyObject *_wrap_Sid___str__(PyObject *SWIGUNUSEDPARM(self), PyObject PyObject *resultobj = 0; dom_sid *arg1 = (dom_sid *) 0 ; TALLOC_CTX *arg2 = (TALLOC_CTX *) 0 ; - char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; + char *result = 0 ; arg2 = NULL; if (!args) SWIG_fail; @@ -3393,7 +3396,6 @@ SWIGINTERN PyObject *_wrap_Sid___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject * PyObject *resultobj = 0; dom_sid *arg1 = (dom_sid *) 0 ; struct dom_sid *arg2 = (struct dom_sid *) 0 ; - bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -3403,6 +3405,7 @@ SWIGINTERN PyObject *_wrap_Sid___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject * char * kwnames[] = { (char *) "self",(char *) "other", NULL }; + bool result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Sid___eq__",kwnames,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_dom_sid, 0 | 0 ); @@ -3438,7 +3441,6 @@ SWIGINTERN PyObject *_wrap_delete_Sid(PyObject *SWIGUNUSEDPARM(self), PyObject * } arg1 = (dom_sid *)(argp1); delete_dom_sid(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -3475,13 +3477,13 @@ fail: SWIGINTERN PyObject *_wrap_privilege_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; enum sec_privilege arg1 ; - char *result = 0 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char * kwnames[] = { (char *) "privilege", NULL }; + char *result = 0 ; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:privilege_name",kwnames,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); @@ -3500,7 +3502,6 @@ fail: SWIGINTERN PyObject *_wrap_privilege_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; - enum sec_privilege result; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; @@ -3508,6 +3509,7 @@ SWIGINTERN PyObject *_wrap_privilege_id(PyObject *SWIGUNUSEDPARM(self), PyObject char * kwnames[] = { (char *) "name", NULL }; + enum sec_privilege result; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:privilege_id",kwnames,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); diff --git a/source4/libcli/security/tests/bindings.py b/source4/libcli/security/tests/bindings.py index 82ce7aeba8..b539de833d 100644 --- a/source4/libcli/security/tests/bindings.py +++ b/source4/libcli/security/tests/bindings.py @@ -65,6 +65,10 @@ class DomSidTests(unittest.TestCase): sid = security.random_sid() self.assertTrue(str(sid).startswith("S-1-5-21-")) + def test_repr(self): + sid = security.random_sid() + self.assertTrue(repr(sid).startswith("Sid('S-1-5-21-")) + class PrivilegeTests(unittest.TestCase): def test_privilege_name(self): diff --git a/source4/libcli/swig/libcli_smb.i b/source4/libcli/swig/libcli_smb.i index 4125bcf5a9..0162b7b66a 100644 --- a/source4/libcli/swig/libcli_smb.i +++ b/source4/libcli/swig/libcli_smb.i @@ -1,6 +1,6 @@ %module libcli_smb -%import "../../lib/talloc/talloc.i" +%import "../../../lib/talloc/talloc.i" %import "../../lib/events/events.i" %{ diff --git a/source4/libcli/swig/libcli_smb.py b/source4/libcli/swig/libcli_smb.py index 6e4fe036c7..4662618fd3 100644 --- a/source4/libcli/swig/libcli_smb.py +++ b/source4/libcli/swig/libcli_smb.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.35 +# Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. diff --git a/source4/libcli/swig/libcli_smb_wrap.c b/source4/libcli/swig/libcli_smb_wrap.c index a3ea079b83..99bbdc7f96 100644 --- a/source4/libcli/swig/libcli_smb_wrap.c +++ b/source4/libcli/swig/libcli_smb_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 1.3.36 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -52,6 +52,12 @@ # endif #endif +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) @@ -2513,7 +2519,7 @@ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}; #define SWIG_name "_libcli_smb" -#define SWIGVERSION 0x010335 +#define SWIGVERSION 0x010336 #define SWIG_VERSION SWIGVERSION @@ -2603,7 +2609,6 @@ SWIGINTERN PyObject *_wrap_smbcli_sock_connect_byname(PyObject *SWIGUNUSEDPARM(s TALLOC_CTX *arg3 = (TALLOC_CTX *) 0 ; struct resolve_context *arg4 = (struct resolve_context *) 0 ; struct event_context *arg5 = (struct event_context *) 0 ; - struct smbcli_socket *result = 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; @@ -2620,8 +2625,9 @@ SWIGINTERN PyObject *_wrap_smbcli_sock_connect_byname(PyObject *SWIGUNUSEDPARM(s char * kwnames[] = { (char *) "host",(char *) "ports",(char *) "resolve_ctx",(char *) "event_ctx", NULL }; + struct smbcli_socket *result = 0 ; - arg5 = s4_event_context_init(NULL); + arg5 = event_context_init(NULL); arg3 = NULL; if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:smbcli_sock_connect_byname",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); |