Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

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  
    22   Unix SMB/CIFS implementation.
    33   Samba utility functions
     4
    45   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
    56   
     
    2021#include "librpc/gen_ndr/misc.h"
    2122
    22 #ifndef Py_RETURN_NONE
    23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
    24 #endif
    25 
    2623static int py_GUID_cmp(PyObject *py_self, PyObject *py_other)
    2724{
    2825        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);
    3128        if (other == NULL)
    3229                return -1;
     
    4441static PyObject *py_GUID_str(PyObject *py_self)
    4542{
    46         struct GUID *self = py_talloc_get_ptr(py_self);
     43        struct GUID *self = pytalloc_get_ptr(py_self);
    4744        char *str = GUID_string(NULL, self);
    4845        PyObject *ret = PyString_FromString(str);
     
    5350static PyObject *py_GUID_repr(PyObject *py_self)
    5451{
    55         struct GUID *self = py_talloc_get_ptr(py_self);
     52        struct GUID *self = pytalloc_get_ptr(py_self);
    5653        char *str = GUID_string(NULL, self);
    5754        PyObject *ret = PyString_FromFormat("GUID('%s')", str);
     
    6461        PyObject *str = NULL;
    6562        NTSTATUS status;
    66         struct GUID *guid = py_talloc_get_ptr(self);
     63        struct GUID *guid = pytalloc_get_ptr(self);
    6764        const char *kwnames[] = { "str", NULL };
    6865
     
    103100        char *str = NULL;
    104101        NTSTATUS status;
    105         struct policy_handle *handle = py_talloc_get_ptr(self);
     102        struct policy_handle *handle = pytalloc_get_ptr(self);
    106103        const char *kwnames[] = { "uuid", "type", NULL };
    107104
     
    122119static PyObject *py_policy_handle_repr(PyObject *py_self)
    123120{
    124         struct policy_handle *self = py_talloc_get_ptr(py_self);
     121        struct policy_handle *self = pytalloc_get_ptr(py_self);
    125122        char *uuid_str = GUID_string(NULL, &self->uuid);
    126123        PyObject *ret = PyString_FromFormat("policy_handle(%d, '%s')", self->handle_type, uuid_str);
     
    131128static PyObject *py_policy_handle_str(PyObject *py_self)
    132129{
    133         struct policy_handle *self = py_talloc_get_ptr(py_self);
     130        struct policy_handle *self = pytalloc_get_ptr(py_self);
    134131        char *uuid_str = GUID_string(NULL, &self->uuid);
    135132        PyObject *ret = PyString_FromFormat("%d, %s", self->handle_type, uuid_str);
  • vendor/current/source4/librpc/ndr/py_security.c

    r740 r988  
    22   Unix SMB/CIFS implementation.
    33   Samba utility functions
    4    Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
     4
     5   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008-2010
    56   
    67   This program is free software; you can redistribute it and/or modify
     
    2021#include "libcli/security/security.h"
    2122
    22 #ifndef Py_RETURN_NONE
    23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
    24 #endif
    25 
    2623static void PyType_AddMethods(PyTypeObject *type, PyMethodDef *methods)
    2724{
     
    4441static PyObject *py_dom_sid_split(PyObject *py_self, PyObject *args)
    4542{
    46         struct dom_sid *self = py_talloc_get_ptr(py_self);
     43        struct dom_sid *self = pytalloc_get_ptr(py_self);
    4744        struct dom_sid *domain_sid;
    4845        TALLOC_CTX *mem_ctx;
     
    6461        }
    6562
    66         py_domain_sid = py_talloc_steal(&dom_sid_Type, domain_sid);
     63        py_domain_sid = pytalloc_steal(&dom_sid_Type, domain_sid);
    6764        talloc_free(mem_ctx);
    6865        return Py_BuildValue("(OI)", py_domain_sid, rid);
     
    7168static int py_dom_sid_cmp(PyObject *py_self, PyObject *py_other)
    7269{
    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);
    7574        if (other == NULL)
    7675                return -1;
    7776
    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;
    7984}
    8085
    8186static PyObject *py_dom_sid_str(PyObject *py_self)
    8287{
    83         struct dom_sid *self = py_talloc_get_ptr(py_self);
     88        struct dom_sid *self = pytalloc_get_ptr(py_self);
    8489        char *str = dom_sid_string(NULL, self);
    8590        PyObject *ret = PyString_FromString(str);
     
    9095static PyObject *py_dom_sid_repr(PyObject *py_self)
    9196{
    92         struct dom_sid *self = py_talloc_get_ptr(py_self);
     97        struct dom_sid *self = pytalloc_get_ptr(py_self);
    9398        char *str = dom_sid_string(NULL, self);
    9499        PyObject *ret = PyString_FromFormat("dom_sid('%s')", str);
     
    100105{
    101106        char *str = NULL;
    102         struct dom_sid *sid = py_talloc_get_ptr(self);
     107        struct dom_sid *sid = pytalloc_get_ptr(self);
    103108        const char *kwnames[] = { "str", NULL };
    104109
     
    135140static PyObject *py_descriptor_sacl_add(PyObject *self, PyObject *args)
    136141{
    137         struct security_descriptor *desc = py_talloc_get_ptr(self);
     142        struct security_descriptor *desc = pytalloc_get_ptr(self);
    138143        NTSTATUS status;
    139144        struct security_ace *ace;
     
    143148                return NULL;
    144149
    145         ace = py_talloc_get_ptr(py_ace);
     150        ace = pytalloc_get_ptr(py_ace);
    146151        status = security_descriptor_sacl_add(desc, ace);
    147152        PyErr_NTSTATUS_IS_ERR_RAISE(status);
     
    151156static PyObject *py_descriptor_dacl_add(PyObject *self, PyObject *args)
    152157{
    153         struct security_descriptor *desc = py_talloc_get_ptr(self);
     158        struct security_descriptor *desc = pytalloc_get_ptr(self);
    154159        NTSTATUS status;
    155160        struct security_ace *ace;
     
    159164                return NULL;
    160165
    161         ace = py_talloc_get_ptr(py_ace);
     166        ace = pytalloc_get_ptr(py_ace);
    162167
    163168        status = security_descriptor_dacl_add(desc, ace);
     
    168173static PyObject *py_descriptor_dacl_del(PyObject *self, PyObject *args)
    169174{
    170         struct security_descriptor *desc = py_talloc_get_ptr(self);
     175        struct security_descriptor *desc = pytalloc_get_ptr(self);
    171176        NTSTATUS status;
    172177        struct dom_sid *sid;
     
    176181                return NULL;
    177182
    178         sid = py_talloc_get_ptr(py_sid);
     183        sid = pytalloc_get_ptr(py_sid);
    179184        status = security_descriptor_dacl_del(desc, sid);
    180185        PyErr_NTSTATUS_IS_ERR_RAISE(status);
     
    184189static PyObject *py_descriptor_sacl_del(PyObject *self, PyObject *args)
    185190{
    186         struct security_descriptor *desc = py_talloc_get_ptr(self);
     191        struct security_descriptor *desc = pytalloc_get_ptr(self);
    187192        NTSTATUS status;
    188193        struct dom_sid *sid;
     
    192197                return NULL;
    193198
    194         sid = py_talloc_get_ptr(py_sid);
     199        sid = pytalloc_get_ptr(py_sid);
    195200        status = security_descriptor_sacl_del(desc, sid);
    196201        PyErr_NTSTATUS_IS_ERR_RAISE(status);
     
    200205static PyObject *py_descriptor_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
    201206{
    202         return py_talloc_steal(self, security_descriptor_initialise(NULL));
     207        return pytalloc_steal(self, security_descriptor_initialise(NULL));
    203208}
    204209
     
    213218                return NULL;
    214219
    215         sid = py_talloc_get_ptr(py_sid);
     220        sid = pytalloc_get_ptr(py_sid);
    216221
    217222        secdesc = sddl_decode(NULL, sddl, sid);
     
    221226        }
    222227
    223         return py_talloc_steal((PyTypeObject *)self, secdesc);
     228        return pytalloc_steal((PyTypeObject *)self, secdesc);
    224229}
    225230
     
    228233        struct dom_sid *sid;
    229234        PyObject *py_sid = Py_None;
    230         struct security_descriptor *desc = py_talloc_get_ptr(self);
     235        struct security_descriptor *desc = pytalloc_get_ptr(self);
    231236        char *text;
    232237        PyObject *ret;
     
    236241
    237242        if (py_sid != Py_None)
    238                 sid = py_talloc_get_ptr(py_sid);
     243                sid = pytalloc_get_ptr(py_sid);
    239244        else
    240245                sid = NULL;
     
    278283        PyObject *py_sid;
    279284        struct dom_sid *sid;
    280         struct security_token *token = py_talloc_get_ptr(self);
     285        struct security_token *token = pytalloc_get_ptr(self);
    281286        if (!PyArg_ParseTuple(args, "O", &py_sid))
    282287                return NULL;
    283288
    284         sid = py_talloc_get_ptr(py_sid);
     289        sid = pytalloc_get_ptr(py_sid);
    285290
    286291        return PyBool_FromLong(security_token_is_sid(token, sid));
     
    291296        PyObject *py_sid;
    292297        struct dom_sid *sid;
    293         struct security_token *token = py_talloc_get_ptr(self);
     298        struct security_token *token = pytalloc_get_ptr(self);
    294299        if (!PyArg_ParseTuple(args, "O", &py_sid))
    295300                return NULL;
    296301
    297         sid = py_talloc_get_ptr(py_sid);
     302        sid = pytalloc_get_ptr(py_sid);
    298303
    299304        return PyBool_FromLong(security_token_has_sid(token, sid));
     
    302307static PyObject *py_token_is_anonymous(PyObject *self)
    303308{
    304         struct security_token *token = py_talloc_get_ptr(self);
     309        struct security_token *token = pytalloc_get_ptr(self);
    305310       
    306311        return PyBool_FromLong(security_token_is_anonymous(token));
     
    309314static PyObject *py_token_is_system(PyObject *self)
    310315{
    311         struct security_token *token = py_talloc_get_ptr(self);
     316        struct security_token *token = pytalloc_get_ptr(self);
    312317       
    313318        return PyBool_FromLong(security_token_is_system(token));
     
    316321static PyObject *py_token_has_builtin_administrators(PyObject *self)
    317322{
    318         struct security_token *token = py_talloc_get_ptr(self);
     323        struct security_token *token = pytalloc_get_ptr(self);
    319324       
    320325        return PyBool_FromLong(security_token_has_builtin_administrators(token));
     
    323328static PyObject *py_token_has_nt_authenticated_users(PyObject *self)
    324329{
    325         struct security_token *token = py_talloc_get_ptr(self);
     330        struct security_token *token = pytalloc_get_ptr(self);
    326331       
    327332        return PyBool_FromLong(security_token_has_nt_authenticated_users(token));
     
    331336{
    332337        int priv;
    333         struct security_token *token = py_talloc_get_ptr(self);
     338        struct security_token *token = pytalloc_get_ptr(self);
    334339
    335340        if (!PyArg_ParseTuple(args, "i", &priv))
     
    342347{
    343348        int priv;
    344         struct security_token *token = py_talloc_get_ptr(self);
     349        struct security_token *token = pytalloc_get_ptr(self);
    345350
    346351        if (!PyArg_ParseTuple(args, "i", &priv))
     
    353358static PyObject *py_token_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
    354359{
    355         return py_talloc_steal(self, security_token_initialise(NULL));
     360        return pytalloc_steal(self, security_token_initialise(NULL));
    356361}       
    357362
     
    415420        sid = dom_sid_parse_talloc(NULL, str);
    416421        talloc_free(str);
    417         ret = py_talloc_steal(&dom_sid_Type, sid);
     422        ret = pytalloc_steal(&dom_sid_Type, sid);
    418423        return ret;
    419424}
  • vendor/current/source4/librpc/ndr/py_xattr.c

    r740 r988  
    1919
    2020#include <Python.h>
    21 
    22 #ifndef Py_RETURN_NONE
    23 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
    24 #endif
    2521
    2622static void PyType_AddMethods(PyTypeObject *type, PyMethodDef *methods)
     
    6460static PyObject *py_ntacl_print(PyObject *self, PyObject *args)
    6561{
    66         struct xattr_NTACL *ntacl = py_talloc_get_ptr(self);
     62        struct xattr_NTACL *ntacl = pytalloc_get_ptr(self);
    6763        struct ndr_print *pr;
    6864        TALLOC_CTX *mem_ctx;
Note: See TracChangeset for help on using the changeset viewer.