On Sun, Feb 05, 2012 at 12:13:44PM -0500, Stephen Gallagher wrote:
> On Sun, 2012-02-05 at 17:11 +0100, Jakub Hrozek wrote:
> > 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).
> 
> Nack.
> 
> You don't want to be passing the reference to pvt_data. It's already a
> (void **)

As I said, I can't get this one right. Thank you, new patch is attached.
From fc7751551c6a1534b1de939b07916dec3f364a36 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..f55e94b7484e8056d2924713d49d2afd8c65d41e
 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