/*
posix1e - a python module exposing the posix acl functions
- Copyright (C) 2002-2009 Iustin Pop <iusty@k1024.org>
+ Copyright (C) 2002-2009, 2012 Iustin Pop <iusty@k1024.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
}
ret = PyBytes_FromString(text);
if(acl_free(text) != 0) {
- Py_DECREF(ret);
+ Py_XDECREF(ret);
return PyErr_SetFromErrno(PyExc_IOError);
}
return ret;
}
ret = PyBytes_FromString(text);
if(acl_free(text) != 0) {
- Py_DECREF(ret);
+ Py_XDECREF(ret);
return PyErr_SetFromErrno(PyExc_IOError);
}
return ret;
Py_INCREF(Py_False);
return Py_False;
}
- return PyTuple_Pack(2, PyInt_FromLong(result), PyInt_FromLong(eindex));
+ return Py_BuildValue("(ii)", result, eindex);
}
/* Implementation of the rich compare for ACLs */
return NULL;
}
- if (!PyArg_ParseTuple(args, "|O!", &Entry_Type, &oldentry))
+ if (!PyArg_ParseTuple(args, "|O!", &Entry_Type, &oldentry)) {
+ Py_DECREF(newentry);
return NULL;
+ }
nret = acl_create_entry(&self->acl, &newentry->entry);
if(nret == -1) {
} else {
kind = PyBytes_FromString("UNKNOWN_TAG_TYPE!");
}
- if (kind == NULL)
+ if (kind == NULL) {
+ Py_DECREF(format);
return NULL;
+ }
PyBytes_ConcatAndDel(&format, kind);
- Py_DECREF(format);
return format;
}
ps = (Permset_Object*)p;
if(acl_get_permset(self->entry, &ps->permset) == -1) {
PyErr_SetFromErrno(PyExc_IOError);
+ Py_DECREF(p);
return NULL;
}
ps->parent_entry = obj;