Apparently I just can't get this one thing right. I introduced another
run-time bug when SSSD is built --without-sudo.

A patch is attached. Sorry for the breakage (again).
From ad2c8c1ef1c33878adfb1ebf30cc8f1e072182bd Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Sun, 5 Feb 2012 17:00:32 +0100
Subject: [PATCH] Do not call sudo functions if built without-sudo

---
 src/providers/ldap/ldap_init.c |    8 +++++++-
 src/providers/ldap/sdap_sudo.c |    6 ------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 
8c98c8eaa80ac9864f96687a568d2d604d15db03..cb50caf06d7f91e6b75e928eaf08bd168dbea44a
 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -392,6 +392,7 @@ int sssm_ldap_sudo_init(struct be_ctx *be_ctx,
                         struct bet_ops **ops,
                         void **pvt_data)
 {
+#ifdef BUILD_SUDO
     struct sdap_id_ctx *id_ctx;
     void *data;
     int ret;
@@ -409,7 +410,12 @@ int sssm_ldap_sudo_init(struct be_ctx *be_ctx,
         return EIO;
     }
 
-    return sdap_sudo_init(be_ctx, id_ctx, ops, &data);
+    return sdap_sudo_init(be_ctx, id_ctx, ops, &pvt_data);
+#else
+    DEBUG(SSSDBG_MINOR_FAILURE, ("Sudo init handler called but SSSD is "
+                                 "built without sudo support, ignoring\n"));
+    return EOK;
+#endif
 }
 
 int sssm_ldap_autofs_init(struct be_ctx *be_ctx,
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c
index 
24425834a2a0dba4eab3cc1985a311c54e46ccf0..5c7448f9685d7a47534e7c5e123ef853a21ea9a5
 100644
--- a/src/providers/ldap/sdap_sudo.c
+++ b/src/providers/ldap/sdap_sudo.c
@@ -49,7 +49,6 @@ int sdap_sudo_init(struct be_ctx *be_ctx,
                    struct bet_ops **ops,
                    void **pvt_data)
 {
-#ifdef BUILD_SUDO
     int ret;
 
     DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing sudo LDAP back end\n"));
@@ -73,11 +72,6 @@ int sdap_sudo_init(struct be_ctx *be_ctx,
     }
 
     return EOK;
-#else
-    DEBUG(SSSDBG_MINOR_FAILURE, ("Sudo init handler called but SSSD is "
-                                 "built without sudo support, ignoring\n"));
-    return EOK;
-#endif
 }
 
 int sdap_sudo_setup_tasks(struct sdap_id_ctx *id_ctx)
-- 
1.7.7.6

_______________________________________________
sssd-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to