responder_common.c revision 41e9e8b60e3bed0159914e755aa05df9a2448470
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen Common Responder methods
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen This program is free software; you can redistribute it and/or modify
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen it under the terms of the GNU General Public License as published by
a22c03355b9c4c8e1655250e216a4ce66d49de7cTimo Sirainen the Free Software Foundation; either version 3 of the License, or
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen (at your option) any later version.
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen This program is distributed in the hope that it will be useful,
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen but WITHOUT ANY WARRANTY; without even the implied warranty of
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen GNU General Public License for more details.
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen You should have received a copy of the GNU General Public License
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <popt.h>
#include "util/strtonum.h"
#include "sbus/sssd_dbus.h"
#include "responder/common/responder.h"
#include "responder/common/responder_packet.h"
#include "providers/data_provider.h"
#include "monitor/monitor_interfaces.h"
#include "sbus/sbus_client.h"
#include "util/util_creds.h"
#ifdef HAVE_SYSTEMD
int ferr;
errno = 0;
if (ferr < 0) {
return error;
return EOK;
void *ptr)
int ret;
#ifdef HAVE_UCRED
return ret;
return ENOMSG;
if (ret != 0) {
return ret;
size_t c;
return EINVAL;
for (c = 0; c < allowed_uids_count; c++) {
return EOK;
return EACCES;
bool allow_sss_loop,
int ret;
size_t c;
int list_size;
char *endptr;
goto done;
goto done;
if (allow_sss_loop) {
for (c = 0; c < list_size; c++) {
errno = 0;
goto done;
list[c]);
goto done;
goto done;
done:
return ret;
int ret;
int ret;
switch (ret) {
case EOK:
case EAGAIN:
case EINVAL:
case ENODATA:
struct accept_fd_ctx {
bool is_private;
int ret;
int client_fd;
if (!cctx) {
cctx);
return EOK;
void *data)
const char *cli_name,
int ret;
return ret;
return ret;
return ret;
return ret;
return EOK;
int fd;
return EIO;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
char *default_pipe;
int ret;
if (!default_pipe) {
return ENOMEM;
return ret;
if (!default_pipe) {
return ENOMEM;
return ret;
return ret;
goto failed;
goto failed;
goto failed;
return EOK;
return EIO;
int ret;
#ifdef HAVE_SYSTEMD
if (ret < 0) {
goto done;
if (ret < 0) {
goto done;
if (ret < 0) {
goto done;
goto done;
done:
return ret;
return ENOMEM;
return EOK;
int tmp_value;
int ret;
goto done;
if (tmp_value < 0) {
goto done;
0, &tmp_value);
goto done;
if (tmp_value < 0) {
goto done;
goto done;
done:
return ret;
const char *sss_pipe_name,
int pipe_fd,
const char *sss_priv_pipe_name,
int priv_pipe_fd,
const char *confdb_service_path,
const char *svc_name,
const char *cli_name,
int ret;
if (!rctx) {
return ENOMEM;
goto fail;
goto fail;
goto fail;
goto fail;
&tmp);
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
return EOK;
fail:
return ret;
return EOK;
struct sss_domain_info *
if (!ret_dom) {
return ret_dom;
int ret;
return EINVAL;
goto done;
done:
return ret;
int limret;
if (limret == 0) {
if (limret == 0) {
if (limret == 0) {