From c47e9d522f0d87259e5074ea643daaa3dfcb8d92 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Mon, 23 Jan 2012 15:32:08 +0100 Subject: SUDO Integration - responder command for cn=defaults https://fedorahosted.org/sssd/ticket/1143 --- src/responder/sudo/sudosrv_dp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/responder/sudo/sudosrv_dp.c') diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c index 4002955b..4d0082ff 100644 --- a/src/responder/sudo/sudosrv_dp.c +++ b/src/responder/sudo/sudosrv_dp.c @@ -107,11 +107,24 @@ sss_dp_get_sudoers_msg(void *pvt) info = talloc_get_type(pvt, struct sss_dp_get_sudoers_info); + switch (info->type) { + case SSS_DP_SUDO_DEFAULTS: + be_type = BE_REQ_SUDO_DEFAULTS; + break; + case SSS_DP_SUDO_USER: + be_type = BE_REQ_SUDO_USER; + break; + } + if (info->fast_reply) { be_type |= BE_REQ_FAST; } - filter = talloc_asprintf(info, "name=%s", info->name); + if (info->name != NULL) { + filter = talloc_asprintf(info, "name=%s", info->name); + } else { + filter = talloc_strdup(info, ""); + } if (!filter) { DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); return NULL; -- cgit