diff options
author | Simo Sorce <simo@redhat.com> | 2012-06-30 11:04:31 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-06-30 11:04:31 -0400 |
commit | 78e77f2d1ee0017e1e1c0bf5efe0e94a70930980 (patch) | |
tree | 59ebb38bb53876edb3341ed87c6ca5f187fcc41f /src/providers | |
parent | e48780b854ac32b0fe35b607446d733486765fbe (diff) | |
download | sssd-78e77f2d1ee0017e1e1c0bf5efe0e94a70930980.tar.gz sssd-78e77f2d1ee0017e1e1c0bf5efe0e94a70930980.tar.bz2 sssd-78e77f2d1ee0017e1e1c0bf5efe0e94a70930980.zip |
Fix segfault when sudo is not configured.
Sudo support is optional, when it is not configured sudorules_map is not
initialized and dereferencing it will cause a segmentation fault.
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/ldap/sdap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index cc073412..65fbc8c1 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -994,7 +994,8 @@ 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) { + if (opts->sudorule_map && + !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); |