Changeset 988 for vendor/current/source4/librpc/ndr
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/librpc/ndr
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/librpc/ndr/py_misc.c
r740 r988 2 2 Unix SMB/CIFS implementation. 3 3 Samba utility functions 4 4 5 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008 5 6 … … 20 21 #include "librpc/gen_ndr/misc.h" 21 22 22 #ifndef Py_RETURN_NONE23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None24 #endif25 26 23 static int py_GUID_cmp(PyObject *py_self, PyObject *py_other) 27 24 { 28 25 int ret; 29 struct GUID *self = py _talloc_get_ptr(py_self), *other;30 other = py _talloc_get_ptr(py_other);26 struct GUID *self = pytalloc_get_ptr(py_self), *other; 27 other = pytalloc_get_ptr(py_other); 31 28 if (other == NULL) 32 29 return -1; … … 44 41 static PyObject *py_GUID_str(PyObject *py_self) 45 42 { 46 struct GUID *self = py _talloc_get_ptr(py_self);43 struct GUID *self = pytalloc_get_ptr(py_self); 47 44 char *str = GUID_string(NULL, self); 48 45 PyObject *ret = PyString_FromString(str); … … 53 50 static PyObject *py_GUID_repr(PyObject *py_self) 54 51 { 55 struct GUID *self = py _talloc_get_ptr(py_self);52 struct GUID *self = pytalloc_get_ptr(py_self); 56 53 char *str = GUID_string(NULL, self); 57 54 PyObject *ret = PyString_FromFormat("GUID('%s')", str); … … 64 61 PyObject *str = NULL; 65 62 NTSTATUS status; 66 struct GUID *guid = py _talloc_get_ptr(self);63 struct GUID *guid = pytalloc_get_ptr(self); 67 64 const char *kwnames[] = { "str", NULL }; 68 65 … … 103 100 char *str = NULL; 104 101 NTSTATUS status; 105 struct policy_handle *handle = py _talloc_get_ptr(self);102 struct policy_handle *handle = pytalloc_get_ptr(self); 106 103 const char *kwnames[] = { "uuid", "type", NULL }; 107 104 … … 122 119 static PyObject *py_policy_handle_repr(PyObject *py_self) 123 120 { 124 struct policy_handle *self = py _talloc_get_ptr(py_self);121 struct policy_handle *self = pytalloc_get_ptr(py_self); 125 122 char *uuid_str = GUID_string(NULL, &self->uuid); 126 123 PyObject *ret = PyString_FromFormat("policy_handle(%d, '%s')", self->handle_type, uuid_str); … … 131 128 static PyObject *py_policy_handle_str(PyObject *py_self) 132 129 { 133 struct policy_handle *self = py _talloc_get_ptr(py_self);130 struct policy_handle *self = pytalloc_get_ptr(py_self); 134 131 char *uuid_str = GUID_string(NULL, &self->uuid); 135 132 PyObject *ret = PyString_FromFormat("%d, %s", self->handle_type, uuid_str); -
vendor/current/source4/librpc/ndr/py_security.c
r740 r988 2 2 Unix SMB/CIFS implementation. 3 3 Samba utility functions 4 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008 4 5 Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008-2010 5 6 6 7 This program is free software; you can redistribute it and/or modify … … 20 21 #include "libcli/security/security.h" 21 22 22 #ifndef Py_RETURN_NONE23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None24 #endif25 26 23 static void PyType_AddMethods(PyTypeObject *type, PyMethodDef *methods) 27 24 { … … 44 41 static PyObject *py_dom_sid_split(PyObject *py_self, PyObject *args) 45 42 { 46 struct dom_sid *self = py _talloc_get_ptr(py_self);43 struct dom_sid *self = pytalloc_get_ptr(py_self); 47 44 struct dom_sid *domain_sid; 48 45 TALLOC_CTX *mem_ctx; … … 64 61 } 65 62 66 py_domain_sid = py _talloc_steal(&dom_sid_Type, domain_sid);63 py_domain_sid = pytalloc_steal(&dom_sid_Type, domain_sid); 67 64 talloc_free(mem_ctx); 68 65 return Py_BuildValue("(OI)", py_domain_sid, rid); … … 71 68 static int py_dom_sid_cmp(PyObject *py_self, PyObject *py_other) 72 69 { 73 struct dom_sid *self = py_talloc_get_ptr(py_self), *other; 74 other = py_talloc_get_ptr(py_other); 70 struct dom_sid *self = pytalloc_get_ptr(py_self), *other; 71 int val; 72 73 other = pytalloc_get_ptr(py_other); 75 74 if (other == NULL) 76 75 return -1; 77 76 78 return dom_sid_compare(self, other); 77 val = dom_sid_compare(self, other); 78 if (val > 0) { 79 return 1; 80 } else if (val < 0) { 81 return -1; 82 } 83 return 0; 79 84 } 80 85 81 86 static PyObject *py_dom_sid_str(PyObject *py_self) 82 87 { 83 struct dom_sid *self = py _talloc_get_ptr(py_self);88 struct dom_sid *self = pytalloc_get_ptr(py_self); 84 89 char *str = dom_sid_string(NULL, self); 85 90 PyObject *ret = PyString_FromString(str); … … 90 95 static PyObject *py_dom_sid_repr(PyObject *py_self) 91 96 { 92 struct dom_sid *self = py _talloc_get_ptr(py_self);97 struct dom_sid *self = pytalloc_get_ptr(py_self); 93 98 char *str = dom_sid_string(NULL, self); 94 99 PyObject *ret = PyString_FromFormat("dom_sid('%s')", str); … … 100 105 { 101 106 char *str = NULL; 102 struct dom_sid *sid = py _talloc_get_ptr(self);107 struct dom_sid *sid = pytalloc_get_ptr(self); 103 108 const char *kwnames[] = { "str", NULL }; 104 109 … … 135 140 static PyObject *py_descriptor_sacl_add(PyObject *self, PyObject *args) 136 141 { 137 struct security_descriptor *desc = py _talloc_get_ptr(self);142 struct security_descriptor *desc = pytalloc_get_ptr(self); 138 143 NTSTATUS status; 139 144 struct security_ace *ace; … … 143 148 return NULL; 144 149 145 ace = py _talloc_get_ptr(py_ace);150 ace = pytalloc_get_ptr(py_ace); 146 151 status = security_descriptor_sacl_add(desc, ace); 147 152 PyErr_NTSTATUS_IS_ERR_RAISE(status); … … 151 156 static PyObject *py_descriptor_dacl_add(PyObject *self, PyObject *args) 152 157 { 153 struct security_descriptor *desc = py _talloc_get_ptr(self);158 struct security_descriptor *desc = pytalloc_get_ptr(self); 154 159 NTSTATUS status; 155 160 struct security_ace *ace; … … 159 164 return NULL; 160 165 161 ace = py _talloc_get_ptr(py_ace);166 ace = pytalloc_get_ptr(py_ace); 162 167 163 168 status = security_descriptor_dacl_add(desc, ace); … … 168 173 static PyObject *py_descriptor_dacl_del(PyObject *self, PyObject *args) 169 174 { 170 struct security_descriptor *desc = py _talloc_get_ptr(self);175 struct security_descriptor *desc = pytalloc_get_ptr(self); 171 176 NTSTATUS status; 172 177 struct dom_sid *sid; … … 176 181 return NULL; 177 182 178 sid = py _talloc_get_ptr(py_sid);183 sid = pytalloc_get_ptr(py_sid); 179 184 status = security_descriptor_dacl_del(desc, sid); 180 185 PyErr_NTSTATUS_IS_ERR_RAISE(status); … … 184 189 static PyObject *py_descriptor_sacl_del(PyObject *self, PyObject *args) 185 190 { 186 struct security_descriptor *desc = py _talloc_get_ptr(self);191 struct security_descriptor *desc = pytalloc_get_ptr(self); 187 192 NTSTATUS status; 188 193 struct dom_sid *sid; … … 192 197 return NULL; 193 198 194 sid = py _talloc_get_ptr(py_sid);199 sid = pytalloc_get_ptr(py_sid); 195 200 status = security_descriptor_sacl_del(desc, sid); 196 201 PyErr_NTSTATUS_IS_ERR_RAISE(status); … … 200 205 static PyObject *py_descriptor_new(PyTypeObject *self, PyObject *args, PyObject *kwargs) 201 206 { 202 return py _talloc_steal(self, security_descriptor_initialise(NULL));207 return pytalloc_steal(self, security_descriptor_initialise(NULL)); 203 208 } 204 209 … … 213 218 return NULL; 214 219 215 sid = py _talloc_get_ptr(py_sid);220 sid = pytalloc_get_ptr(py_sid); 216 221 217 222 secdesc = sddl_decode(NULL, sddl, sid); … … 221 226 } 222 227 223 return py _talloc_steal((PyTypeObject *)self, secdesc);228 return pytalloc_steal((PyTypeObject *)self, secdesc); 224 229 } 225 230 … … 228 233 struct dom_sid *sid; 229 234 PyObject *py_sid = Py_None; 230 struct security_descriptor *desc = py _talloc_get_ptr(self);235 struct security_descriptor *desc = pytalloc_get_ptr(self); 231 236 char *text; 232 237 PyObject *ret; … … 236 241 237 242 if (py_sid != Py_None) 238 sid = py _talloc_get_ptr(py_sid);243 sid = pytalloc_get_ptr(py_sid); 239 244 else 240 245 sid = NULL; … … 278 283 PyObject *py_sid; 279 284 struct dom_sid *sid; 280 struct security_token *token = py _talloc_get_ptr(self);285 struct security_token *token = pytalloc_get_ptr(self); 281 286 if (!PyArg_ParseTuple(args, "O", &py_sid)) 282 287 return NULL; 283 288 284 sid = py _talloc_get_ptr(py_sid);289 sid = pytalloc_get_ptr(py_sid); 285 290 286 291 return PyBool_FromLong(security_token_is_sid(token, sid)); … … 291 296 PyObject *py_sid; 292 297 struct dom_sid *sid; 293 struct security_token *token = py _talloc_get_ptr(self);298 struct security_token *token = pytalloc_get_ptr(self); 294 299 if (!PyArg_ParseTuple(args, "O", &py_sid)) 295 300 return NULL; 296 301 297 sid = py _talloc_get_ptr(py_sid);302 sid = pytalloc_get_ptr(py_sid); 298 303 299 304 return PyBool_FromLong(security_token_has_sid(token, sid)); … … 302 307 static PyObject *py_token_is_anonymous(PyObject *self) 303 308 { 304 struct security_token *token = py _talloc_get_ptr(self);309 struct security_token *token = pytalloc_get_ptr(self); 305 310 306 311 return PyBool_FromLong(security_token_is_anonymous(token)); … … 309 314 static PyObject *py_token_is_system(PyObject *self) 310 315 { 311 struct security_token *token = py _talloc_get_ptr(self);316 struct security_token *token = pytalloc_get_ptr(self); 312 317 313 318 return PyBool_FromLong(security_token_is_system(token)); … … 316 321 static PyObject *py_token_has_builtin_administrators(PyObject *self) 317 322 { 318 struct security_token *token = py _talloc_get_ptr(self);323 struct security_token *token = pytalloc_get_ptr(self); 319 324 320 325 return PyBool_FromLong(security_token_has_builtin_administrators(token)); … … 323 328 static PyObject *py_token_has_nt_authenticated_users(PyObject *self) 324 329 { 325 struct security_token *token = py _talloc_get_ptr(self);330 struct security_token *token = pytalloc_get_ptr(self); 326 331 327 332 return PyBool_FromLong(security_token_has_nt_authenticated_users(token)); … … 331 336 { 332 337 int priv; 333 struct security_token *token = py _talloc_get_ptr(self);338 struct security_token *token = pytalloc_get_ptr(self); 334 339 335 340 if (!PyArg_ParseTuple(args, "i", &priv)) … … 342 347 { 343 348 int priv; 344 struct security_token *token = py _talloc_get_ptr(self);349 struct security_token *token = pytalloc_get_ptr(self); 345 350 346 351 if (!PyArg_ParseTuple(args, "i", &priv)) … … 353 358 static PyObject *py_token_new(PyTypeObject *self, PyObject *args, PyObject *kwargs) 354 359 { 355 return py _talloc_steal(self, security_token_initialise(NULL));360 return pytalloc_steal(self, security_token_initialise(NULL)); 356 361 } 357 362 … … 415 420 sid = dom_sid_parse_talloc(NULL, str); 416 421 talloc_free(str); 417 ret = py _talloc_steal(&dom_sid_Type, sid);422 ret = pytalloc_steal(&dom_sid_Type, sid); 418 423 return ret; 419 424 } -
vendor/current/source4/librpc/ndr/py_xattr.c
r740 r988 19 19 20 20 #include <Python.h> 21 22 #ifndef Py_RETURN_NONE23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None24 #endif25 21 26 22 static void PyType_AddMethods(PyTypeObject *type, PyMethodDef *methods) … … 64 60 static PyObject *py_ntacl_print(PyObject *self, PyObject *args) 65 61 { 66 struct xattr_NTACL *ntacl = py _talloc_get_ptr(self);62 struct xattr_NTACL *ntacl = pytalloc_get_ptr(self); 67 63 struct ndr_print *pr; 68 64 TALLOC_CTX *mem_ctx;
Note:
See TracChangeset
for help on using the changeset viewer.