summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_sudo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c
index 5f87a80c..fbe7cc8c 100644
--- a/src/db/sysdb_sudo.c
+++ b/src/db/sysdb_sudo.c
@@ -71,13 +71,14 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule,
/* check for sudoNotBefore */
ret = sysdb_attrs_get_string_array(rule, SYSDB_SUDO_CACHE_AT_NOTBEFORE,
tmp_ctx, &values);
- if (ret != EOK) {
- goto done;
- } else if (ret == ENOENT) {
+ if (ret == ENOENT) {
DEBUG(SSSDBG_TRACE_LIBS,
("notBefore attribute is missing, the rule is valid\n"));
*result = true;
ret = EOK;
+ goto done;
+ } else if (ret != EOK) {
+ goto done;
}
for (i=0; values[i] ; i++) {
@@ -100,13 +101,14 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule,
/* check for sudoNotAfter */
ret = sysdb_attrs_get_string_array(rule, SYSDB_SUDO_CACHE_AT_NOTAFTER,
tmp_ctx, &values);
- if (ret != EOK) {
- goto done;
- } else if (ret == ENOENT) {
+ if (ret == ENOENT) {
DEBUG(SSSDBG_TRACE_LIBS,
("notAfter attribute is missing, the rule is valid\n"));
*result = true;
ret = EOK;
+ goto done;
+ } else if (ret != EOK) {
+ goto done;
}
for (i=0; values[i] ; i++) {