proxy_id.c revision 29d85ae19933805622fdcead4ea43ba2d06cc3f0
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich Stephen Gallagher <sgallagh@redhat.com>
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich Copyright (C) 2010 Red Hat
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich This program is free software; you can redistribute it and/or modify
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich it under the terms of the GNU General Public License as published by
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich the Free Software Foundation; either version 3 of the License, or
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich (at your option) any later version.
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich This program is distributed in the hope that it will be useful,
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich but WITHOUT ANY WARRANTY; without even the implied warranty of
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich GNU General Public License for more details.
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich You should have received a copy of the GNU General Public License
0b60a19437c802631340d8bb5f9aaee7ba2c0a29Klaus Luettich along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util/strtonum.h"
const char *name)
char *buffer;
int ret;
bool del_user;
if (!tmpctx) {
return ENOMEM;
if (!pwd) {
goto done;
if (!buffer) {
goto done;
if (ret) {
goto done;
if (del_user) {
goto done;
if (!real_name) {
if (ret) {
goto done;
if (del_user) {
goto done;
done:
if (ret) {
return ret;
if (!del_user) {
return EINVAL;
*del_user = false;
switch (status) {
case NSS_STATUS_NOTFOUND:
*del_user = true;
case NSS_STATUS_SUCCESS:
*del_user = true;
case NSS_STATUS_UNAVAIL:
return ret;
return ret;
const char *shell;
const char *gecos;
char *lower;
const char *cased_alias;
if (!attrs) {
return ENOMEM;
if (lowercase) {
if (!lower) {
return ENOMEM;
if (ret) {
return ret;
if (alias) {
if (!cased_alias) {
return ENOMEM;
if (ret) {
return ret;
NULL,
NULL,
if (ret) {
return ret;
return EOK;
char *buffer;
bool del_user = false;
int ret;
if (!tmpctx) {
return ENOMEM;
if (!pwd) {
goto done;
if (!buffer) {
goto done;
if (ret) {
goto done;
if (del_user) {
goto done;
done:
if (ret) {
return ret;
bool in_transaction = false;
char *buffer;
char *newbuf;
int ret;
bool again;
if (!tmpctx) {
return ENOMEM;
if (!pwd) {
goto done;
if (!buffer) {
goto done;
if (ret) {
goto done;
in_transaction = true;
goto done;
again = false;
switch (status) {
case NSS_STATUS_TRYAGAIN:
if (!newbuf) {
goto done;
again = true;
case NSS_STATUS_NOTFOUND:
goto done;
in_transaction = false;
case NSS_STATUS_SUCCESS:
again = true;
if (ret) {
again = true;
case NSS_STATUS_UNAVAIL:
} while (again);
done:
if (in_transaction) {
return ret;
char *lower;
const char *cased_alias;
bool in_transaction = false;
if (!tmp_ctx) {
return ENOMEM;
goto done;
in_transaction = true;
if (!attrs) {
goto done;
if (ret) {
goto done;
goto done;
if (!attrs) {
if (!attrs) {
goto done;
if (!lower) {
goto done;
if (ret) {
goto done;
if (alias) {
if (!cased_alias) {
return ENOMEM;
if (ret) {
goto done;
now);
if (ret) {
goto done;
goto done;
in_transaction = false;
done:
if (in_transaction) {
return ret;
size_t i;
goto done;
goto done;
done:
return ret;
char *newbuf;
if (*buflen == 0) {
if (!newbuf) {
return NULL;
return *buffer;
static errno_t
bool *delete_group)
switch (status) {
case NSS_STATUS_TRYAGAIN:
return EAGAIN;
case NSS_STATUS_NOTFOUND:
*delete_group = true;
case NSS_STATUS_SUCCESS:
*delete_group = true;
case NSS_STATUS_UNAVAIL:
return ENXIO;
return EIO;
return EOK;
const char *name)
char *buffer = 0;
bool delete_group = false;
int ret;
if (!tmpctx) {
return ENOMEM;
if (!grp) {
goto done;
if (!buffer) {
goto done;
goto done;
if (!real_name) {
buflen = 0;
if (!buffer) {
goto done;
goto done;
if (delete_group) {
goto done;
if (ret) {
goto done;
done:
if (ret) {
return ret;
bool delete_group = false;
int ret;
if (!tmpctx) {
return ENOMEM;
if (!grp) {
goto done;
if (!buffer) {
goto done;
goto done;
if (delete_group) {
goto done;
if (ret) {
goto done;
done:
if (ret) {
return ret;
bool in_transaction = false;
char *buffer;
char *newbuf;
int ret;
bool again;
if (!tmpctx) {
return ENOMEM;
if (!grp) {
goto done;
if (!buffer) {
goto done;
if (ret) {
goto done;
in_transaction = true;
goto done;
again = false;
switch (status) {
case NSS_STATUS_TRYAGAIN:
if (!newbuf) {
goto done;
again = true;
case NSS_STATUS_NOTFOUND:
goto done;
in_transaction = false;
case NSS_STATUS_SUCCESS:
again = true;
if (ret) {
again = true;
case NSS_STATUS_UNAVAIL:
} while (again);
done:
if (in_transaction) {
return ret;
const char *name)
bool in_transaction = false;
char *buffer;
int ret;
bool del_user;
if (!tmpctx) {
return ENOMEM;
if (!pwd) {
goto fail;
if (!buffer) {
goto fail;
if (ret) {
goto fail;
in_transaction = true;
if (ret) {
goto fail;
if (del_user) {
if (ret) {
goto fail;
goto done;
if (!real_name) {
if (ret) {
goto done;
if (del_user) {
if (ret) {
goto fail;
goto done;
if (ret) {
goto fail;
goto fail;
done:
if (ret) {
goto fail;
in_transaction = false;
fail:
if (in_transaction) {
return ret;
long int limit;
long int size;
long int num;
long int num_gids;
int ret;
num_gids = 0;
if (!gids) {
return ENOMEM;
num_gids++;
if (!gids) {
return ENOMEM;
switch (status) {
case NSS_STATUS_NOTFOUND:
case NSS_STATUS_SUCCESS:
for (i = 0; i < num_gids; i++) {
if (ret) {
return ret;
return ret;
int ret;
char *endptr;
struct proxy_id_ctx);
case BE_FILTER_ENUM:
case BE_FILTER_NAME:
case BE_FILTER_IDNUM:
case BE_FILTER_ENUM:
case BE_FILTER_NAME:
case BE_FILTER_IDNUM:
case BE_REQ_NETGROUP:
case BE_REQ_SERVICES:
case BE_FILTER_NAME:
case BE_FILTER_IDNUM:
case BE_FILTER_ENUM:
if (ret) {