"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/providers/ldap/sdap_sudo_shared.c" between
sssd-2.4.1.tar.gz and sssd-2.4.2.tar.gz

About: SSSD is a system daemon to manage identity, authentication and authorization for centrally-managed systems. It provides several interfaces, including NSS and PAM modules or a D-Bus interface.

sdap_sudo_shared.c  (sssd-2.4.1):sdap_sudo_shared.c  (sssd-2.4.2)
skipping to change at line 132 skipping to change at line 132
return ret; return ret;
} }
} }
return EOK; return EOK;
} }
static char * static char *
sdap_sudo_new_usn(TALLOC_CTX *mem_ctx, sdap_sudo_new_usn(TALLOC_CTX *mem_ctx,
unsigned long usn, unsigned long usn,
const char *leftover, const char *leftover)
bool supports_usn)
{ {
const char *str = leftover == NULL ? "" : leftover; const char *str = leftover == NULL ? "" : leftover;
char *newusn; char *newusn;
/* This is a fresh start and server uses modifyTimestamp. We need to /* Current largest USN is unknown so we keep "0" to indicate it. */
* provide proper datetime value. */ if (usn == 0) {
if (!supports_usn && usn == 0) { return talloc_strdup(mem_ctx, "0");
newusn = talloc_strdup(mem_ctx, "00000101000000Z");
if (newusn == NULL) {
DEBUG(SSSDBG_MINOR_FAILURE, "Unable to change USN value (OOM)!\n");
return NULL;
}
return newusn;
} }
/* We increment USN number so that we can later use simplify filter /* We increment USN number so that we can later use simplified filter
* (just usn >= last+1 instead of usn >= last && usn != last). * (just usn >= last+1 instead of usn >= last && usn != last).
*/ */
usn++; usn++;
/* Convert back to string appending non-converted values since it /* Convert back to string appending non-converted values since it
* is an indicator that modifyTimestamp is used instead of entryUSN. * is an indicator that modifyTimestamp is used instead of entryUSN.
* modifyTimestamp contains also timezone specification, usually Z. * modifyTimestamp contains also timezone specification, usually Z.
* We can't really handle any errors here so we just use what we got. */ * We can't really handle any errors here so we just use what we got. */
newusn = talloc_asprintf(mem_ctx, "%lu%s", usn, str); newusn = talloc_asprintf(mem_ctx, "%lu%s", usn, str);
if (newusn == NULL) { if (newusn == NULL) {
skipping to change at line 222 skipping to change at line 214
DEBUG(SSSDBG_MINOR_FAILURE, "Unable to convert USN %s [%d]: %s\n", DEBUG(SSSDBG_MINOR_FAILURE, "Unable to convert USN %s [%d]: %s\n",
usn, ret, sss_strerror(ret)); usn, ret, sss_strerror(ret));
return; return;
} }
} }
if (usn_number > srv_opts->last_usn) { if (usn_number > srv_opts->last_usn) {
srv_opts->last_usn = usn_number; srv_opts->last_usn = usn_number;
} }
newusn = sdap_sudo_new_usn(srv_opts, srv_opts->last_usn, timezone, newusn = sdap_sudo_new_usn(srv_opts, srv_opts->last_usn, timezone);
srv_opts->supports_usn);
if (newusn == NULL) { if (newusn == NULL) {
return; return;
} }
talloc_zfree(srv_opts->max_sudo_value); talloc_zfree(srv_opts->max_sudo_value);
srv_opts->max_sudo_value = newusn; srv_opts->max_sudo_value = newusn;
DEBUG(SSSDBG_FUNC_DATA, "SUDO higher USN value: [%s]\n", DEBUG(SSSDBG_FUNC_DATA, "SUDO higher USN value: [%s]\n",
srv_opts->max_sudo_value); srv_opts->max_sudo_value);
} }
 End of changes. 4 change blocks. 
15 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)