/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2013 Red Hat
InfoPipe responder: the responder server
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 <popt.h>
#include "util/strtonum.h"
#include "sbus/sssd_dbus.h"
#include "monitor/monitor_interfaces.h"
#include "responder/ifp/ifp_private.h"
#include "responder/ifp/ifp_domains.h"
#include "responder/ifp/ifp_components.h"
#include "responder/common/responder_sbus.h"
{ &mon_cli_iface_meta, 0 },
.resetOffline = NULL,
};
{
{ SSS_CLI_NULL, NULL}
};
return ifp_cmds;
}
{
int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Identify ourselves to the data provider */
/* all fine */
return;
}
}
/* Failed to reconnect */
}
static errno_t
struct tevent_context *ev,
const char *dbus_name,
void *pvt,
struct sysbus_ctx **sysbus)
{
if (system_bus == NULL) {
return ENOMEM;
}
/* Connect to the well-known system bus */
"Failed to connect to D-BUS system bus: [%s]\n",
ret = ERR_NO_SYSBUS;
goto fail;
}
/* We want exclusive access */
&dbus_error);
if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
/* We were unable to register on the system bus */
"Unable to request name on the system bus: [%s]\n",
goto fail;
}
/* Integrate with tevent loop */
&system_bus->conn);
"Could not integrate D-BUS into mainloop.\n");
goto fail;
}
goto fail;
}
*sysbus = system_bus;
return EOK;
fail:
if (dbus_error_is_set(&dbus_error)) {
}
return ret;
}
{
goto done;
}
/* Connect to the D-BUS system bus and set up methods */
if (ret == ERR_NO_SYSBUS) {
"The system bus is not available..\n");
goto done;
"Failed to connect to the system message bus\n");
return ret;
}
done:
}
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
int ret;
int max_retries;
char *uid_str;
char *attr_list_str;
char *wildcard_limit_str;
ifp_cmds = get_ifp_cmds();
"InfoPipe",
NULL,
&rctx);
return ret;
}
goto fail;
}
"(?P<name>[^@]+)@?(?P<domain>[^@]*$)",
goto fail;
}
goto fail;
}
goto fail;
}
NULL, &attr_list_str);
goto fail;
}
"Failed to parse the allowed attribute list\n");
goto fail;
}
/* Enable automatic reconnection to the Data Provider */
3, &max_retries);
"Failed to set up automatic reconnection\n");
goto fail;
}
/* A bit convoluted way until we have a confdb_get_uint32 */
NULL, /* no limit by default */
"Failed to retrieve limit for a wildcard search\n");
goto fail;
}
if (wildcard_limit_str) {
goto fail;
}
}
}
/* Connect to the D-BUS system bus and set up methods */
if (ret == ERR_NO_SYSBUS) {
"The system bus is not available..\n");
/* Explicitly ignore, the D-Bus daemon will start us */
"Failed to connect to the system message bus\n");
return EIO;
}
"schedule_get_domains_tasks failed.\n");
goto fail;
}
return EOK;
fail:
return ret;
}
{
int opt;
int ret;
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc... */
debug_log_file = "sssd_ifp";
ret = die_if_parent_died();
/* This is not fatal, don't return */
"Could not set up to exit when parent process does\n");
}
/* loop on main */
return 0;
}