summaryrefslogtreecommitdiffstats
path: root/src/responder/sudo/sudosrv_dp.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-01-23 15:32:08 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-01-27 09:10:37 -0500
commitc47e9d522f0d87259e5074ea643daaa3dfcb8d92 (patch)
tree24390543639333fce8becd6beb8af9b3153112e5 /src/responder/sudo/sudosrv_dp.c
parent7a571a9d9be35360cc0f283fcd8124bda11ebf51 (diff)
downloadsssd-c47e9d522f0d87259e5074ea643daaa3dfcb8d92.tar.gz
sssd-c47e9d522f0d87259e5074ea643daaa3dfcb8d92.tar.xz
sssd-c47e9d522f0d87259e5074ea643daaa3dfcb8d92.zip
SUDO Integration - responder command for cn=defaults
https://fedorahosted.org/sssd/ticket/1143
Diffstat (limited to 'src/responder/sudo/sudosrv_dp.c')
-rw-r--r--src/responder/sudo/sudosrv_dp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c
index 4002955bd..4d0082ffe 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;