diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-04-23 16:37:08 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-29 11:37:17 -0400 |
commit | d16b3f456d1100f4058d9a73ee59397f964b8760 (patch) | |
tree | 867a64f4fddeb13ef774c93f4c01a4b96cdf5cc8 | |
parent | b8f6f1e105f323b0debfcf1bb09aead6b3914472 (diff) | |
download | sssd-d16b3f456d1100f4058d9a73ee59397f964b8760.tar.gz sssd-d16b3f456d1100f4058d9a73ee59397f964b8760.tar.bz2 sssd-d16b3f456d1100f4058d9a73ee59397f964b8760.zip |
sudo ldap provider: add support for on demand refresh of specific rules
-rw-r--r-- | src/providers/data_provider.h | 1 | ||||
-rw-r--r-- | src/providers/dp_backend.h | 2 | ||||
-rw-r--r-- | src/providers/ldap/sdap_sudo.c | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/providers/data_provider.h b/src/providers/data_provider.h index 93840b8c..8c46115b 100644 --- a/src/providers/data_provider.h +++ b/src/providers/data_provider.h @@ -142,6 +142,7 @@ #define BE_REQ_SUDO_DEFAULTS 0x0007 #define BE_REQ_SUDO_USER 0x0008 #define BE_REQ_SUDO_FULL 0x0100 /* todo: change it after clean up */ +#define BE_REQ_SUDO_RULES 0x0200 /* todo: change it after clean up */ #define BE_REQ_AUTOFS 0x0009 #define BE_REQ_HOST 0x0010 #define BE_REQ_FAST 0x1000 diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index c6bf2d0c..2c56f147 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -158,6 +158,8 @@ struct be_acct_req { struct be_sudo_req { uint32_t type; + char **rules; + char *username; uid_t uid; char **groups; diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c index 227d57c0..ba96f2cb 100644 --- a/src/providers/ldap/sdap_sudo.c +++ b/src/providers/ldap/sdap_sudo.c @@ -171,6 +171,9 @@ static void sdap_sudo_reply(struct tevent_req *req) case BE_REQ_SUDO_FULL: ret = sdap_sudo_full_refresh_recv(req, &dp_error, &error); break; + case BE_REQ_SUDO_RULES: + ret = sdap_sudo_rules_refresh_recv(req, &dp_error, &error); + break; default: DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", sudo_req->type)); @@ -203,6 +206,11 @@ void sdap_sudo_handler(struct be_req *be_req) DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a full refresh of sudo rules\n")); req = sdap_sudo_full_refresh_send(be_req, id_ctx); break; + case BE_REQ_SUDO_RULES: + DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a refresh of specific sudo rules\n")); + req = sdap_sudo_rules_refresh_send(be_req, id_ctx->be, id_ctx->opts, + id_ctx->conn_cache, sudo_req->rules); + break; default: DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", sudo_req->type)); |