/*
SSSD
Data Provider Process
Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <dlfcn.h>
#include <popt.h>
#include <signal.h>
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#include "util/sss_utf8.h"
#include "sbus/sssd_dbus.h"
#include "providers/fail_over.h"
#include "providers/be_refresh.h"
#include "providers/be_ptask.h"
#include "util/child_common.h"
#include "resolv/async_resolv.h"
#include "monitor/monitor_interfaces.h"
{ &mon_cli_iface_meta, 0 },
.clearMemcache = NULL,
.clearEnumCache = NULL,
.sysbusReconnect = NULL,
};
{
}
static errno_t
struct tevent_context *ev,
void *be_ctx_void)
{
return EOK;
}
{
int offline_timeout;
"Failed to get offline_timeout from confdb. "
"Will use 60 seconds.\n");
offline_timeout = 60;
}
return offline_timeout;
}
{
int offline_timeout;
ctx->run_online_cb = true;
/* This is the first time we go offline - create a periodic task
* to check if we can switch to online. */
3600 /* max_backoff */,
ctx, "Check if online (periodic)",
"be_ptask_create_sync failed [%d]: %s\n",
}
} else {
/* Periodic task was already created. Just enable it. */
}
}
struct tevent_timer *te,
struct timeval current_time,
void *pvt)
{
struct sss_domain_info);
}
{
int reset_status_timeout;
case DOM_INCONSISTENT:
case DOM_DISABLED:
"Won't touch disabled or inconsistent subdomain\n");
return;
case DOM_INACTIVE:
return;
case DOM_ACTIVE:
break;
}
return;
}
}
{
if (IS_SUBDOMAIN(dom) == false) {
} else {
}
}
{
}
}
}
{
}
{
return ENOMEM;
}
return EOK;
}
{
goto done;
}
case DP_ERR_OK:
}
break;
case DP_ERR_OFFLINE:
}
break;
default:
break;
}
goto done;
}
return;
}
done:
be_ctx->check_online_ref_count = 0;
}
}
}
{
if (!be_is_offline(be_ctx)) {
"Backend is already online, nothing to do.\n");
return;
}
/* Make sure nobody tries to go online while we are checking */
"There is an online check already running.\n");
return;
}
"ID providers does not provide a check_online method.\n");
goto failed;
}
goto failed;
}
return;
if (be_ctx->check_online_ref_count == 0) {
}
return;
}
struct tevent_signal *se,
int signum,
int count,
void *siginfo,
void *private_data)
{
}
struct tevent_signal *se,
int signum,
int count,
void *siginfo,
void *private_data)
{
}
const char *be_domain,
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
return ENOMEM;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
/* We need this for subdomains support, as they have to store fully
* qualified user and group names for now. */
goto done;
}
/* Read the global override_space option, for output name formatting */
&str);
"Cannot get the space substitution character [%d]: %s\n",
goto done;
}
"only the first character %c will be used\n",
}
}
/* Read session_recording section */
"Failed loading session recording configuration: %s\n",
goto done;
}
/* Initialize be_refresh periodic task. */
goto done;
}
if (refresh_interval > 0) {
"Unable to initialize refresh periodic task\n");
goto done;
}
}
goto done;
}
/* Handle SIGUSR1 to force offline behavior */
BlockSignals(false, SIGUSR1);
goto done;
}
/* Handle SIGUSR2 to force going online */
BlockSignals(false, SIGUSR2);
goto done;
}
done:
}
return ret;
}
#ifndef UNIT_TESTING
{
int opt;
char *confdb_path;
int ret;
_("Domain of the information provider (mandatory)"), NULL },
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
return 1;
}
/* set up things like debug, signals, daemonization, etc. */
if (!debug_log_file) return 2;
if (!srv_name) return 2;
if (!confdb_path) return 2;
return 2;
}
if (ret != 0) {
"logging might not work as expected\n");
}
ret = die_if_parent_died();
/* This is not fatal, don't return */
"Could not set up to exit when parent process does\n");
}
return 3;
}
"Cannot chown the debug files, debugging might not work!\n");
}
return ret;
}
/* loop on main */
return 0;
}
#endif
{
}
{
}
{
}
{
}