pamsrv.c revision 6c9fe712447b4b868c9fe3e1d91df174485d0ada
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync PAM Responder
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync Copyright (C) Simo Sorce <ssorce@redhat.com> 2009
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync Copyright (C) Sumit Bose <sbose@redhat.com> 2009
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync This program is free software; you can redistribute it and/or modify
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync it under the terms of the GNU General Public License as published by
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync the Free Software Foundation; either version 3 of the License, or
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync (at your option) any later version.
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync This program is distributed in the hope that it will be useful,
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync but WITHOUT ANY WARRANTY; without even the implied warranty of
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync GNU General Public License for more details.
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync You should have received a copy of the GNU General Public License
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync along with this program. If not, see <http://www.gnu.org/licenses/>.
404df8b2baf3f931a57bffd773b093d0fe40cd50vboxsyncstatic int service_reload(DBusMessage *message, struct sbus_connection *conn);
404df8b2baf3f931a57bffd773b093d0fe40cd50vboxsync { MON_CLI_METHOD_RES_INIT, monitor_common_res_init },
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsyncstatic int service_reload(DBusMessage *message, struct sbus_connection *conn) {
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsync /* Monitor calls this function when we need to reload
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsync * our configuration information. Perform whatever steps
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsync * are needed to update the configuration objects.
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsync /* Send an empty reply to acknowledge receipt */
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsyncstatic void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void *pvt)
f6f1d32779a2a6a1a4579c3bf6ff3aa0c37f0823vboxsync struct be_conn *be_conn = talloc_get_type(pvt, struct be_conn);
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* Did we reconnect successfully? */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* Identify ourselves to the data provider */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* all fine */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* Handle failure */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* FIXME: kill the frontend and let the monitor restart it ? */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync /* pam_shutdown(rctx); */
4e38f78b4916ef128a3902ed2a8d7e8d7f947d8dvboxsync ret = confdb_get_int(cdb, pctx, CONFDB_PAM_CONF_ENTRY,
43af8389304c77c3d4db525de8907cb74207c380vboxsync ret = pam_get_config(pctx, pctx->rctx, pctx->rctx->cdb);
43af8389304c77c3d4db525de8907cb74207c380vboxsync /* Enable automatic reconnection to the Data Provider */
43af8389304c77c3d4db525de8907cb74207c380vboxsync /* FIXME: "retries" is too generic, either get it from a global config
43af8389304c77c3d4db525de8907cb74207c380vboxsync * or specify these retries are about the sbus connections to DP */
43af8389304c77c3d4db525de8907cb74207c380vboxsync ret = confdb_get_int(pctx->rctx->cdb, pctx->rctx, CONFDB_PAM_CONF_ENTRY,
43af8389304c77c3d4db525de8907cb74207c380vboxsync DEBUG(0, ("Failed to set up automatic reconnection\n"));
43af8389304c77c3d4db525de8907cb74207c380vboxsync for (iter = pctx->rctx->be_conns; iter; iter = iter->next) {
43af8389304c77c3d4db525de8907cb74207c380vboxsync pc = poptGetContext(argv[0], argc, argv, long_options, 0);
43af8389304c77c3d4db525de8907cb74207c380vboxsync /* set up things like debug, signals, daemonization, etc... */
43af8389304c77c3d4db525de8907cb74207c380vboxsync ret = server_setup("sssd[pam]", 0, CONFDB_PAM_CONF_ENTRY, &main_ctx);
43af8389304c77c3d4db525de8907cb74207c380vboxsync /* This is not fatal, don't return */
43af8389304c77c3d4db525de8907cb74207c380vboxsync DEBUG(2, ("Could not set up to exit when parent process does\n"));
43af8389304c77c3d4db525de8907cb74207c380vboxsync /* loop on main */