DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.
[ira/wip.git] / source4 / librpc / ndr / py_security.c
index 43c1d50d666ac764db66cbf1b31123fb2f8841fd..8ab790d4701b95af3c227e39f799daf16b99b819 100644 (file)
@@ -163,7 +163,7 @@ static PyObject *py_descriptor_sacl_del(PyObject *self, PyObject *args)
 
 static PyObject *py_descriptor_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
 {
-       return py_talloc_import(self, security_descriptor_initialise(NULL));
+       return py_talloc_steal(self, security_descriptor_initialise(NULL));
 }
 
 static PyObject *py_descriptor_from_sddl(PyObject *self, PyObject *args)
@@ -184,7 +184,7 @@ static PyObject *py_descriptor_from_sddl(PyObject *self, PyObject *args)
                return NULL;
        }
 
-       return py_talloc_import((PyTypeObject *)self, secdesc);
+       return py_talloc_steal((PyTypeObject *)self, secdesc);
 }
 
 static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
@@ -198,7 +198,7 @@ static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "|O", &py_sid))
                return NULL;
 
-       if (py_sid == Py_None)
+       if (py_sid != Py_None)
                sid = py_talloc_get_ptr(py_sid);
        else
                sid = NULL;
@@ -316,7 +316,7 @@ static PyObject *py_token_set_privilege(PyObject *self, PyObject *args)
 
 static PyObject *py_token_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
 {
-       return py_talloc_import(self, security_token_initialise(NULL));
+       return py_talloc_steal(self, security_token_initialise(NULL));
 }      
 
 static PyMethodDef py_token_extra_methods[] = {
@@ -378,8 +378,7 @@ static PyObject *py_random_sid(PyObject *self)
 
         sid = dom_sid_parse_talloc(NULL, str);
        talloc_free(str);
-       ret = py_talloc_import(&dom_sid_Type, sid);
-       talloc_free(sid);
+       ret = py_talloc_steal(&dom_sid_Type, sid);
        return ret;
 }