diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-15 13:20:30 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-18 20:03:27 +0100 |
commit | cf308d76dbd0ed95f00ed1e998b3f1d52f7f8e6b (patch) | |
tree | 9a455844f0f66542b4d49b53e9ab781a6a6b8935 /src/providers | |
parent | 6ed3b627441c64167efa753e917b1d448e1a2dcc (diff) | |
download | sssd-cf308d76dbd0ed95f00ed1e998b3f1d52f7f8e6b.tar.gz sssd-cf308d76dbd0ed95f00ed1e998b3f1d52f7f8e6b.tar.xz sssd-cf308d76dbd0ed95f00ed1e998b3f1d52f7f8e6b.zip |
DP: invalidate all cached maps if a request for auto.master comes in
If the Data Provider receives a request for the auto.master map, it
passes on a flag to let the actual provider let know he should
invalidate the existing maps
Diffstat (limited to 'src/providers')
-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 4749fc28c..ce16aeb69 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 357d58910..58a9b7490 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 5e3e3320c..7e6f3ecf7 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) { |