data_provider_be.c revision 2c9a76e553f9239eaa91f32ccaf18b7a68316ce5
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Data Provider Process
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster This program is free software; you can redistribute it and/or modify
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster it under the terms of the GNU General Public License as published by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster the Free Software Foundation; either version 3 of the License, or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster (at your option) any later version.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster This program is distributed in the hope that it will be useful,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster but WITHOUT ANY WARRANTY; without even the implied warranty of
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster GNU General Public License for more details.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster You should have received a copy of the GNU General Public License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster along with this program. If not, see <http://www.gnu.org/licenses/>.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster#define MSG_TARGET_NO_CONFIGURED "sssd_be: The requested target is not configured"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterstatic int data_provider_res_init(DBusMessage *message,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterstatic int data_provider_go_offline(DBusMessage *message,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterstatic int data_provider_reset_offline(DBusMessage *message,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterstatic int data_provider_logrotate(DBusMessage *message,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster { MON_CLI_METHOD_RES_INIT, data_provider_res_init },
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster { MON_CLI_METHOD_OFFLINE, data_provider_go_offline },
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster { MON_CLI_METHOD_RESET_OFFLINE, data_provider_reset_offline },
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster { MON_CLI_METHOD_ROTATE, data_provider_logrotate },
struct be_async_req {
if (!areq) {
return ENOMEM;
return EIO;
return EOK;
switch (dp_err_type) {
case DP_ERR_OK:
case DP_ERR_OFFLINE:
case DP_ERR_TIMEOUT:
case DP_ERR_FATAL:
return NULL;
int dp_err_type,
int errnum,
const char *errstr)
if (reply) {
if (errstr) {
if (!err_msg) {
if (!dbret) {
void *user_data;
char *filter;
int filter_type;
char *filter_val;
int ret;
const char *err_msg;
if (!ret) {
return EIO;
goto done;
if (filter) {
goto done;
goto done;
if (!be_req) {
goto done;
if (!req) {
goto done;
be_req);
goto done;
return EOK;
done:
if (be_req) {
if (reply) {
return EOK;
int dp_err_type,
int errnum,
const char *errstr)
if (!dbret) {
void *user_data;
if (!reply) {
return ENOMEM;
if (!be_req) {
return ENOMEM;
if (!ret) {
return EIO;
return ENOMEM;
case SSS_PAM_AUTHENTICATE:
case SSS_PAM_ACCT_MGMT:
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
case SSS_PAM_SETCRED:
case SSS_PAM_OPEN_SESSION:
case SSS_PAM_CLOSE_SESSION:
goto done;
goto done;
sizeof(MSG_TARGET_NO_CONFIGURED),
goto done;
be_req);
goto done;
return EOK;
done:
if (!ret) {
return EIO;
return EOK;
char *cli_name;
void *data;
if (!becli) {
return EINVAL;
if (!dbret) {
return EIO;
if (!reply) {
return ENOMEM;
if (!dbret) {
return EIO;
return EOK;
int ret;
return ret;
int ret;
goto done;
done:
int ret;
goto failed;
goto failed;
goto failed;
if (!becli) {
return ENOMEM;
return ENOMEM;
return EOK;
char *sbus_address;
int ret;
return ret;
return ret;
return EOK;
const char *default_mod_name)
bool already_loaded = false;
int lb=0;
void *handle;
return EINVAL;
if (!tmp_ctx) {
return ENOMEM;
&mod_name);
goto done;
if (!mod_name) {
goto done;
goto done;
goto done;
goto done;
mod_name);
goto done;
lb = 0;
already_loaded = true;
++lb;
goto done;
if (!already_loaded) {
if (!path) {
goto done;
if (!handle) {
goto done;
goto done;
goto done;
done:
return ret;
int signum,
int count,
void *siginfo,
void *private_data)
const char *be_domain,
int ret;
if (!ctx) {
return ENOMEM;
return ENOMEM;
return ret;
return ret;
return ret;
return ret;
return ret;
return ret;
return ret;
be_domain));
return ret;
return ret;
be_domain));
return EIO;
return EOK;
int opt;
char *confdb_path;
int ret;
switch(opt) {
struct be_ctx);