]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use native data types for 20+ year-old versions of OSX
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2025 14:25:04 +0000 (10:25 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2025 14:25:04 +0000 (10:25 -0400)
src/modules/rlm_mschap/opendir.c

index b3fd9fff437f3d39350c3c6986260d0df7ad4e7e..011c63e04e0a1289921a550f0692bd9a0a0e9ed5 100644 (file)
@@ -55,14 +55,11 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out
        char const              *what           = NULL;
        char                    *status_name    = NULL;
        tContextData            context         = 0;
-       uint32_t                nodeCount       = 0;
-       uint32_t                attrIndex       = 0;
        tDataList              *nodeName        = NULL;
        tAttributeEntryPtr      pAttrEntry      = NULL;
        tDataList              *pRecName        = NULL;
        tDataList              *pRecType        = NULL;
        tDataList              *pAttrType       = NULL;
-       uint32_t                recCount        = 0;
        tRecordEntry            *pRecEntry      = NULL;
        tAttributeListRef       attrListRef     = 0;
        char                    *pUserLocation  = NULL;
@@ -70,6 +67,17 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out
        tDataList              *pUserNode       = NULL;
        rlm_rcode_t             result          = RLM_MODULE_FAIL;
 
+       /*
+        *      These variables are passed to OSX APIs, which need
+        *      UInt32.  And helpfully, the OSX headers define UInt32
+        *      differently, depending on the platform.  As a result,
+        *      we can't assume that uint32_t and UInt32 are
+        *      compatible.  Thanks, Apple.
+        */
+       UInt32                  nodeCount       = 0;
+       UInt32                  recCount        = 0;
+       UInt32                  attrIndex       = 0;
+
        if (!inUserName) {
                ERROR("rlm_mschap: getUserNodeRef(): no username");
                return RLM_MODULE_FAIL;