diff options
-rw-r--r-- | src/providers/data_provider_be.c | 7 | ||||
-rw-r--r-- | src/providers/dp_backend.h | 1 | ||||
-rw-r--r-- | src/providers/ldap/sdap_autofs.c | 8 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index da319ffa..5208b48c 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -1491,6 +1491,13 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) goto done; } + /* If a request for auto.master comes in, the automounter deamon + * has been reloaded. Expire all autofs maps to force reload + */ + if (strcmp(be_autofs_req->mapname, "auto.master") == 0) { + be_autofs_req->invalidate = true; + } + be_req->req_data = be_autofs_req; if (!be_cli->bectx->bet_info[BET_AUTOFS].bet_ops) { diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index 357d5891..58a9b749 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -169,6 +169,7 @@ struct be_sudo_req { struct be_autofs_req { char *mapname; + bool invalidate; }; struct be_subdom_req { diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c index 5e3e3320..7e6f3ecf 100644 --- a/src/providers/ldap/sdap_autofs.c +++ b/src/providers/ldap/sdap_autofs.c @@ -97,6 +97,14 @@ void sdap_autofs_handler(struct be_req *be_req) DEBUG(SSSDBG_FUNC_DATA, ("Requested refresh for: %s\n", autofs_req->mapname ? autofs_req->mapname : "<ALL>\n")); + if (autofs_req->invalidate) { + ret = sysdb_invalidate_autofs_maps(id_ctx->be->sysdb); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, ("Could not invalidate autofs maps, " + "backend might return stale entries\n")); + } + } + req = sdap_autofs_get_map_send(be_req, be_req->be_ctx->ev, id_ctx, autofs_req->mapname); if (!req) { |