pamsrv.c revision 71cd2f7ce705561d8d8f3cb7f385a57bedad1ef1
/*
SSSD
PAM Responder
Copyright (C) Simo Sorce <ssorce@redhat.com> 2009
Copyright (C) Sumit Bose <sbose@redhat.com> 2009
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 "providers/data_provider.h"
#include "monitor/monitor_interfaces.h"
#include "sbus/sbus_client.h"
#define SSS_PAM_SBUS_SERVICE_VERSION 0x0001
#define SSS_PAM_SBUS_SERVICE_NAME "pam"
struct sbus_method monitor_pam_methods[] = {
};
struct sbus_interface monitor_pam_interface = {
};
static struct sbus_method pam_dp_methods[] = {
};
struct sbus_interface pam_dp_interface = {
};
{
int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Identify ourselves to the data provider */
"PAM");
/* all fine */
}
/* Handle failure */
DEBUG(0, ("Could not reconnect to %s provider.\n",
/* FIXME: kill the frontend and let the monitor restart it ? */
/* pam_shutdown(rctx); */
}
struct confdb_ctx *cdb)
{
&pctx->cred_expiration);
return ret;
}
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
struct sss_cmd_table *pam_cmds;
int ret, max_retries;
if (!pctx) {
return ENOMEM;
}
pam_cmds = get_pam_cmds();
"PAM", &pam_dp_interface,
return ret;
}
/* Enable automatic reconnection to the Data Provider */
/* FIXME: "retries" is too generic, either get it from a global config
* or specify these retries are about the sbus connections to DP */
DEBUG(0, ("Failed to set up automatic reconnection\n"));
return ret;
}
}
return EOK;
}
{
int opt;
struct main_context *main_ctx;
int ret;
struct poptOption long_options[] = {
{ NULL }
};
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc... */
debug_log_file = "sssd_pam";
ret = die_if_parent_died();
/* This is not fatal, don't return */
}
/* loop on main */
return 0;
}