pacsrv.c revision 2d257ccf620ce1b611f89cec8f0a94c88c2f2881
/*
SSSD
PAC Responder
Copyright (C) Sumit Bose <sbose@redhat.com> 2011
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 "sbus/sssd_dbus.h"
#include "responder/common/responder_packet.h"
#include "responder/common/responder.h"
#include "providers/data_provider.h"
#include "monitor/monitor_interfaces.h"
#include "sbus/sbus_client.h"
#define SSS_PAC_PIPE_NAME "pac"
#define DEFAULT_PAC_FD_LIMIT 8192
#define DEFAULT_ALLOWED_UIDS "0"
struct sbus_method monitor_pac_methods[] = {
};
struct sbus_interface monitor_pac_interface = {
};
static struct sbus_method pac_dp_methods[] = {
};
struct sbus_interface pac_dp_interface = {
};
/* TODO: check if this can be made generic for all responders */
{
int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Identify ourselves to the data provider */
"PAC");
/* all fine */
return;
}
}
/* Failed to reconnect */
/* FIXME: kill the frontend and let the monitor restart it ? */
/* nss_shutdown(rctx); */
}
{
}
{
}
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
struct sss_cmd_table *pac_cmds;
int ret, max_retries;
enum idmap_error_code err;
int fd_limit;
char *uid_str;
if (!pac_ctx) {
return ENOMEM;
}
pac_cmds = get_pac_cmds();
"PAC", &pac_dp_interface,
return ret;
}
return ret;
}
return ret;
}
/* Enable automatic reconnection to the Data Provider */
3, &max_retries);
return ret;
}
}
if (err != IDMAP_SUCCESS) {
return EFAULT;
}
/* Set up file descriptor limits */
&fd_limit);
("Failed to set up file descriptor limit\n"));
return ret;
}
return EOK;
}
{
int opt;
struct main_context *main_ctx;
int ret;
struct poptOption long_options[] = {
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc... */
debug_log_file = "sssd_pac";
ret = die_if_parent_died();
/* This is not fatal, don't return */
}
/* loop on main */
return 0;
}