nsssrv.c revision a56cdc811fec8d2c0e69fce3970a1032d1e3d2a8
/*
SSSD
NSS Responder
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 "popt.h"
#include "responder/common/negcache.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_NSS_PIPE_NAME "nss"
#define DEFAULT_PWFIELD "*"
struct sbus_method monitor_nss_methods[] = {
};
struct sbus_interface monitor_nss_interface = {
};
struct confdb_ctx *cdb)
{
int ret;
&nctx->neg_timeout);
if (nctx->cache_refresh_percent < 0 ||
DEBUG(0,("Configuration error: entry_cache_nowait_percentage is"
"invalid. Disabling feature.\n"));
nctx->cache_refresh_percent = 0;
}
goto done;
}
ret = 0;
done:
return ret;
}
static struct sbus_method nss_dp_methods[] = {
};
struct sbus_interface nss_dp_interface = {
};
{
int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Identify ourselves to the data provider */
"NSS");
/* all fine */
}
/* Failed to reconnect */
DEBUG(0, ("Could not reconnect to %s provider.\n",
/* 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 *nss_cmds;
int ret, max_retries;
if (!nctx) {
DEBUG(0, ("fatal error initializing nss_ctx\n"));
return ENOMEM;
}
DEBUG(0, ("fatal error initializing negative cache\n"));
return ret;
}
nss_cmds = get_nss_cmds();
"NSS", &nss_dp_interface,
return ret;
}
DEBUG(0, ("fatal error getting nss config\n"));
return ret;
}
/* Enable automatic reconnection to the Data Provider */
3, &max_retries);
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[] = {
};
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc... */
debug_log_file = "sssd_nss";
ret = die_if_parent_died();
/* This is not fatal, don't return */
}
/* loop on main */
return 0;
}