summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-12-15 16:50:31 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-12-18 17:29:59 +0100
commit10bfd01ca80d7df4f3988782ac9a08fc621d5cd1 (patch)
tree97c1f286ab744d11fcd7a074b759ba2b63a72b36 /src/responder
parentc65afc26d85589ab58d31878559d6c0bc4139f73 (diff)
downloadsssd-10bfd01ca80d7df4f3988782ac9a08fc621d5cd1.tar.gz
sssd-10bfd01ca80d7df4f3988782ac9a08fc621d5cd1.tar.xz
sssd-10bfd01ca80d7df4f3988782ac9a08fc621d5cd1.zip
AUTOFS: Clear enum cache if a request comes in from the sss_cache
In order for sss_cache to work correctly, we must also signal the autofs responder to invalidate the hash table requests.
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/autofs/autofssrv.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index 055896929..228a8ed3e 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -29,10 +29,14 @@
#include "providers/data_provider.h"
#include "responder/autofs/autofs_private.h"
+static int autofs_clean_hash_table(DBusMessage *message,
+ struct sbus_connection *conn);
+
struct sbus_method monitor_autofs_methods[] = {
{ MON_CLI_METHOD_PING, monitor_common_pong },
{ MON_CLI_METHOD_RES_INIT, monitor_common_res_init },
{ MON_CLI_METHOD_ROTATE, responder_logrotate },
+ { MON_CLI_METHOD_CLEAR_ENUM_CACHE, autofs_clean_hash_table },
{ NULL, NULL }
};
@@ -101,6 +105,24 @@ autofs_dp_reconnect_init(struct sbus_connection *conn,
be_conn->domain->name));
}
+static int autofs_clean_hash_table(DBusMessage *message,
+ struct sbus_connection *conn)
+{
+ struct resp_ctx *rctx = talloc_get_type(sbus_conn_get_private_data(conn),
+ struct resp_ctx);
+ struct autofs_ctx *actx =
+ talloc_get_type(rctx->pvt_ctx, struct autofs_ctx);
+ errno_t ret;
+
+ ret = autofs_orphan_maps(actx);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_OP_FAILURE, ("Could not invalidate maps\n"));
+ return ret;
+ }
+
+ return monitor_common_pong(message, conn);
+}
+
static int
autofs_process_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,