summaryrefslogtreecommitdiff
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-08-22 13:58:27 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-26 11:53:49 +0200
commit2211abf772cb8b28356e57b8c64a4328c9b2c3dc (patch)
tree9b232ee953c9537ce4803e3e2ace14b79331fdf9 /src/providers/ldap
parent9b43a2a6462b07075d403dbd5de487cbe7ada92c (diff)
downloadsssd-2211abf772cb8b28356e57b8c64a4328c9b2c3dc.tar.gz
sssd-2211abf772cb8b28356e57b8c64a4328c9b2c3dc.tar.bz2
sssd-2211abf772cb8b28356e57b8c64a4328c9b2c3dc.zip
sudo: do not strdup usn on ENOENT
If USN attribute is not present, we call strdup on uninitialized variable. This may cause segfault, or if we are lucky and usn is NULL it will return ENOMEM.
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/sdap_sudo_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_sudo_cache.c b/src/providers/ldap/sdap_sudo_cache.c
index 5cc1dd20..de4f65c4 100644
--- a/src/providers/ldap/sdap_sudo_cache.c
+++ b/src/providers/ldap/sdap_sudo_cache.c
@@ -39,7 +39,7 @@ static errno_t sdap_sudo_get_usn(TALLOC_CTX *mem_ctx,
}
ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_USN].sys_name, &usn);
- if (ret != EOK && ret != ENOENT) {
+ if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
("Failed to retrieve USN value: [%s]\n", strerror(ret)));