]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Return updated from rlm_ldap when we update things
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 11 Apr 2024 21:24:14 +0000 (15:24 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 11 Apr 2024 21:24:14 +0000 (15:24 -0600)
src/modules/rlm_ldap/rlm_ldap.c

index 8c16ac53ec7e593763da21b21c5a67c398a18dad..502ffc5f447784896be6d1932552b7038d08886b 100644 (file)
@@ -27,7 +27,6 @@
  * @copyright 2012 Alan DeKok (aland@freeradius.org)
  * @copyright 1999-2013 The FreeRADIUS Server Project.
  */
-#include "lib/util/value.h"
 RCSID("$Id$")
 
 USES_APPLE_DEPRECATED_API
@@ -42,6 +41,7 @@ USES_APPLE_DEPRECATED_API
 
 #include <freeradius-devel/server/map_proc.h>
 #include <freeradius-devel/server/module_rlm.h>
+#include <freeradius-devel/server/rcode.h>
 
 #include <freeradius-devel/unlang/xlat_func.h>
 #include <freeradius-devel/unlang/action.h>
@@ -1685,6 +1685,12 @@ static unlang_action_t mod_authorize_resume(rlm_rcode_t *p_result, UNUSED int *p
                FALL_THROUGH;
 
        case LDAP_AUTZ_POST_DEFAULT_PROFILE:
+               /*
+                *      Did we jump back her after applying the default profile?
+                */
+               if (autz_ctx->status == LDAP_AUTZ_POST_DEFAULT_PROFILE) {
+                       rcode = RLM_MODULE_UPDATED;
+               }
                /*
                 *      Apply a SET of user profiles.
                 */
@@ -1739,7 +1745,10 @@ static unlang_action_t mod_authorize_resume(rlm_rcode_t *p_result, UNUSED int *p
                 *      After each profile has been applied, execution will restart here.
                 *      Start by clearing the previously used value.
                 */
-               TALLOC_FREE(autz_ctx->profile_value);
+               if (autz_ctx->profile_value) {
+                       TALLOC_FREE(autz_ctx->profile_value);
+                       rcode = RLM_MODULE_UPDATED;     /* We're back here after applying a profile successfully */
+               }
 
                if (autz_ctx->profile_values && autz_ctx->profile_values[autz_ctx->value_idx]) {
                        unlang_action_t ret;
@@ -1761,6 +1770,7 @@ static unlang_action_t mod_authorize_resume(rlm_rcode_t *p_result, UNUSED int *p
                                break;
                        }
                }
+               break;
        }
 
 finish: