diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-05-07 16:12:18 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-29 11:37:17 -0400 |
commit | c8704f06db6dbbe39f50dfb35f20cdf27cf1f087 (patch) | |
tree | 5b2525bddb9ed2bd6ecc2639d59f9de402933e1e /src | |
parent | 015882243625e51595423da929a2f72cd23c75ba (diff) | |
download | sssd-c8704f06db6dbbe39f50dfb35f20cdf27cf1f087.tar.gz sssd-c8704f06db6dbbe39f50dfb35f20cdf27cf1f087.tar.bz2 sssd-c8704f06db6dbbe39f50dfb35f20cdf27cf1f087.zip |
ldap provider: add sudo usn value
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ldap/ldap_id.c | 2 | ||||
-rw-r--r-- | src/providers/ldap/ldap_opts.h | 1 | ||||
-rw-r--r-- | src/providers/ldap/sdap.c | 5 | ||||
-rw-r--r-- | src/providers/ldap/sdap.h | 2 | ||||
-rw-r--r-- | src/providers/ldap/sdap_id_op.c | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index 889fbddc..9515219c 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -821,12 +821,14 @@ static void sdap_check_online_done(struct tevent_req *req) srv_opts->max_user_value = 0; srv_opts->max_group_value = 0; srv_opts->max_service_value = 0; + srv_opts->max_sudo_value = 0; } else if (strcmp(srv_opts->server_id, check_ctx->id_ctx->srv_opts->server_id) == 0 && srv_opts->supports_usn && check_ctx->id_ctx->srv_opts->last_usn > srv_opts->last_usn) { check_ctx->id_ctx->srv_opts->max_user_value = 0; check_ctx->id_ctx->srv_opts->max_group_value = 0; check_ctx->id_ctx->srv_opts->max_service_value = 0; + check_ctx->id_ctx->srv_opts->max_sudo_value = 0; check_ctx->id_ctx->srv_opts->last_usn = srv_opts->last_usn; } diff --git a/src/providers/ldap/ldap_opts.h b/src/providers/ldap/ldap_opts.h index c81b0b1e..d925851d 100644 --- a/src/providers/ldap/ldap_opts.h +++ b/src/providers/ldap/ldap_opts.h @@ -305,6 +305,7 @@ struct sdap_attr_map native_sudorule_map[] = { { "ldap_sudorule_notbefore", "sudoNotBefore", SYSDB_SUDO_CACHE_AT_NOTBEFORE, NULL }, { "ldap_sudorule_notafter", "sudoNotAfter", SYSDB_SUDO_CACHE_AT_NOTAFTER, NULL }, { "ldap_sudorule_order", "sudoOrder", SYSDB_SUDO_CACHE_AT_ORDER, NULL }, + { "ldap_sudorule_entry_usn", NULL, SYSDB_USN, NULL }, SDAP_ATTR_MAP_TERMINATOR }; diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index 325825e2..cc073412 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -994,6 +994,11 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, talloc_strdup(opts->service_map, opts->gen_map[SDAP_AT_ENTRY_USN].name); } + if (!opts->sudorule_map[SDAP_AT_SUDO_USN].name) { + opts->sudorule_map[SDAP_AT_SUDO_USN].name = + talloc_strdup(opts->sudorule_map, + opts->gen_map[SDAP_AT_ENTRY_USN].name); + } *srv_opts = so; return EOK; diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h index 68acf2cc..a178b8ce 100644 --- a/src/providers/ldap/sdap.h +++ b/src/providers/ldap/sdap.h @@ -312,6 +312,7 @@ enum sdap_sudorule_attrs { SDAP_AT_SUDO_NOTBEFORE, SDAP_AT_SUDO_NOTAFTER, SDAP_AT_SUDO_ORDER, + SDAP_AT_SUDO_USN, SDAP_OPTS_SUDO /* attrs counter */ }; @@ -396,6 +397,7 @@ struct sdap_server_opts { char *max_user_value; char *max_group_value; char *max_service_value; + char *max_sudo_value; }; struct sdap_id_ctx; diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index 539f26f0..d4f6fe34 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -542,6 +542,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) current_srv_opts->max_user_value = 0; current_srv_opts->max_group_value = 0; current_srv_opts->max_service_value = 0; + current_srv_opts->max_sudo_value = 0; current_srv_opts->last_usn = srv_opts->last_usn; } } |