pysss.c revision d79c604c5080c5f6e2bf2d91b4ae79a562437c74
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder Jakub Hrozek <jhrozek@redhat.com>
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder Copyright (C) 2009 Red Hat
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder This program is free software; you can redistribute it and/or modify
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder it under the terms of the GNU General Public License as published by
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder the Free Software Foundation; either version 3 of the License, or
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder (at your option) any later version.
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder This program is distributed in the hope that it will be useful,
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder GNU General Public License for more details.
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder You should have received a copy of the GNU General Public License
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder along with this program. If not, see <http://www.gnu.org/licenses/>.
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder * function taken from samba sources tree as of Aug 20 2009,
b2a02ef0183a671777294e069307bba893ca3ebeChristian Maederstatic char **PyList_AsStringList(TALLOC_CTX *mem_ctx, PyObject *list,
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder ret = talloc_array(mem_ctx, char *, PyList_Size(list)+1);
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder PyErr_Format(PyExc_TypeError, "%s should be strings", paramname);
d5a8d891500a642ce629854857fc00b7c21aec47Christian Maeder ret[i] = talloc_strndup(ret, PyString_AsString(item),
b2a02ef0183a671777294e069307bba893ca3ebeChristian Maeder/* ======================= sysdb python wrappers ==========================*/
b2a02ef0183a671777294e069307bba893ca3ebeChristian Maeder * The sss.password object
int lock;
int unlock;
return NULL;
return NULL;
return tctx;
unsigned long uid = 0;
unsigned long gid = 0;
int ret;
int create_home = 0;
bool in_transaction = false;
&username,
&uid,
&gid,
&gecos,
&home,
&shell,
&skel,
&py_groups)) {
goto fail;
if (!tctx) {
return NULL;
return NULL;
skel);
goto fail;
goto fail;
in_transaction = true;
goto fail;
goto fail;
in_transaction = false;
goto fail;
goto fail;
fail:
if (in_transaction) {
return NULL;
int ret;
int remove_home = 0;
&username,
&py_force)) {
goto fail;
if (!tctx) {
return NULL;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
fail:
return NULL;
unsigned long uid = 0;
unsigned long gid = 0;
unsigned long lock = 0;
bool in_transaction = false;
&username,
&uid,
&gid,
&lock,
&gecos,
&home,
&shell,
&py_rmgroups)) {
goto fail;
if (!tctx) {
return NULL;
goto fail;
return NULL;
return NULL;
goto fail;
in_transaction = true;
goto fail;
goto fail;
in_transaction = false;
fail:
if (in_transaction) {
return NULL;
char *groupname;
unsigned long gid = 0;
bool in_transaction = false;
&gid)) {
goto fail;
if (!tctx) {
return NULL;
goto fail;
in_transaction = true;
goto fail;
goto fail;
in_transaction = false;
fail:
if (in_transaction) {
return NULL;
int ret;
goto fail;
if (!tctx) {
return NULL;
goto fail;
fail:
return NULL;
unsigned long gid = 0;
bool in_transaction = false;
&gid,
&py_rmgroups)) {
goto fail;
if (!tctx) {
return NULL;
return NULL;
return NULL;
goto fail;
in_transaction = true;
goto fail;
goto fail;
in_transaction = false;
fail:
if (in_transaction) {
return NULL;
int ngroups;
int ret;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
idx = 0;
for (i = 0; i < ngroups; i++) {
if (gr) {
idx++;
if (i != idx) {
return groups_tuple;
fail:
return NULL;
char *confdb_path;
int ret;
return NULL;
return NULL;
return NULL;
return NULL;
return NULL;
int aes_256;
int ret;
int mode;
return NULL;
if (!tctx) {
return NULL;
goto fail;
goto fail;
fail:
return retval;
int ret;
&obfpwd)) {
return NULL;
if (!tctx) {
return NULL;
goto fail;
goto fail;
fail:
return retval;
return NULL;
initpysss(void)
PyObject *m;
if (m == NULL)