From 78e77f2d1ee0017e1e1c0bf5efe0e94a70930980 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 30 Jun 2012 11:04:31 -0400 Subject: 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. --- src/providers/ldap/sdap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit