diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-05-07 17:13:21 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-29 11:37:17 -0400 |
commit | 04491e79dafde97824baa2cdb19e19dbf14d980a (patch) | |
tree | e9aeb83a5c9c7e68ca3415dcbeaa0dfb50da8193 /src/providers/ldap/sdap_sudo.c | |
parent | f143937efc6cbb1eb84042979c83dd5b3f23a40c (diff) | |
download | sssd-04491e79dafde97824baa2cdb19e19dbf14d980a.tar.gz sssd-04491e79dafde97824baa2cdb19e19dbf14d980a.tar.bz2 sssd-04491e79dafde97824baa2cdb19e19dbf14d980a.zip |
sudo ldap provider: add sdap_sudo_set_usn()
Diffstat (limited to 'src/providers/ldap/sdap_sudo.c')
-rw-r--r-- | src/providers/ldap/sdap_sudo.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c index 8ce33a08..72ed3b63 100644 --- a/src/providers/ldap/sdap_sudo.c +++ b/src/providers/ldap/sdap_sudo.c @@ -163,6 +163,28 @@ int sdap_sudo_setup_periodical_full_refresh(struct sdap_id_ctx *id_ctx) return EOK; } +static void sdap_sudo_set_usn(struct sdap_server_opts *srv_opts, char *usn) +{ + unsigned int usn_number; + char *endptr = NULL; + + if (srv_opts != NULL && usn != NULL) { + talloc_zfree(srv_opts->max_sudo_value); + srv_opts->max_sudo_value = talloc_steal(srv_opts, usn); + + usn_number = strtoul(usn, &endptr, 10); + if ((endptr == NULL || (*endptr == '\0' && endptr != usn)) + && (usn_number > srv_opts->last_usn)) { + srv_opts->last_usn = usn_number; + } + + DEBUG(SSSDBG_FUNC_DATA, ("SUDO higher USN value: [%s]\n", + srv_opts->max_sudo_value)); + } else { + DEBUG(SSSDBG_TRACE_FUNC, ("srv_opts is NULL\n")); + } +} + static void sdap_sudo_reply(struct tevent_req *req) { struct be_req *be_req = NULL; |