summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-08-30 10:51:19 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-09-02 09:58:29 -0400
commit9d3d669cc353475cfe023c2a20cc51fd07428b82 (patch)
tree400a35dcfc2703d22d91a31b3baacacfbd097743 /src/monitor
parentb4378a86e669f3136c71c409c692302517b3474e (diff)
downloadsssd-9d3d669cc353475cfe023c2a20cc51fd07428b82.tar.gz
sssd-9d3d669cc353475cfe023c2a20cc51fd07428b82.tar.xz
sssd-9d3d669cc353475cfe023c2a20cc51fd07428b82.zip
Add option to specify the kerberos replay cache dir
Adds a configure option to set the distribution default as well as an sssd.conf option to override it. https://fedorahosted.org/sssd/ticket/980
Diffstat (limited to 'src/monitor')
-rw-r--r--src/monitor/monitor.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 2e2478204..431b875cc 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -57,6 +57,11 @@
* monitor will get crazy hammering children with messages */
#define MONITOR_DEF_PING_TIME 10
+/* Special value to leave the Kerberos Replay Cache set to use
+ * the libkrb5 defaults
+ */
+#define KRB5_RCACHE_DIR_DISABLE "__LIBKRB5_DEFAULTS__"
+
struct svc_spy;
struct mt_svc {
@@ -1871,8 +1876,34 @@ int monitor_process_init(struct mt_ctx *ctx,
struct sysdb_ctx_list *db_list;
struct tevent_signal *tes;
struct sss_domain_info *dom;
+ char *rcachedir;
int num_providers;
int ret;
+ int error;
+
+ /* Set up the environment variable for the Kerberos Replay Cache */
+ ret = confdb_get_string(ctx->cdb, ctx,
+ CONFDB_MONITOR_CONF_ENTRY,
+ CONFDB_MONITOR_KRB5_RCACHEDIR,
+ KRB5_RCACHE_DIR,
+ &rcachedir);
+ if (ret != EOK) {
+ return ret;
+ }
+
+ if (strcmp(rcachedir, KRB5_RCACHE_DIR_DISABLE) != 0)
+ {
+ errno = 0;
+ ret = setenv("KRB5RCACHEDIR", rcachedir, 1);
+ if (ret < 0) {
+ error = errno;
+ DEBUG(1,
+ ("Unable to set KRB5RCACHEDIR: %s."
+ "Will attempt to use libkrb5 defaults\n",
+ strerror(error)));
+ }
+ talloc_zfree(rcachedir);
+ }
/* Set up an event handler for a SIGHUP */
tes = tevent_add_signal(ctx->ev, ctx, SIGHUP, 0,