Fixup format strings
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 21 Jan 2014 22:33:20 +0000 (22:33 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 21 Jan 2014 22:37:59 +0000 (22:37 +0000)
src/main/process.c
src/modules/rlm_eap/eap.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_ldap/ldap.c
src/modules/rlm_mschap/opendir.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_rest/rest.c

index 29d0fee..9224233 100644 (file)
@@ -312,12 +312,12 @@ static void debug_packet(REQUEST *request, RADIUS_PACKET *packet, int direction)
         *      This really belongs in a utility library
         */
        if ((packet->code > 0) && (packet->code < FR_MAX_PACKET_CODE)) {
-               RDEBUG("%s %s packet %s host %s port %d, id=%d, length=%d",
+               RDEBUG("%s %s packet %s host %s port %i, id=%i, length=%zu",
                       received, fr_packet_codes[packet->code], from,
                       inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)),
                       port, packet->id, packet->data_len);
        } else {
-               RDEBUG("%s packet %s host %s port %d code=%d, id=%d, length=%d",
+               RDEBUG("%s packet %s host %s port %d code=%d, id=%d, length=%zu",
                       received, from,
                       inet_ntop(ip->af, &ip->ipaddr, buffer, sizeof(buffer)),
                       port,
index 4822094..4ccae69 100644 (file)
@@ -783,7 +783,7 @@ int eap_start(rlm_eap_t *inst, REQUEST *request)
            (eap_msg->vp_octets[0] >= PW_EAP_MAX_CODES)) {
                RDEBUG2("Unknown EAP packet");
        } else {
-               RDEBUG2("EAP packet type %s id %d length %d",
+               RDEBUG2("EAP packet type %s id %d length %zu",
                       eap_codes[eap_msg->vp_octets[0]],
                       eap_msg->vp_octets[1],
                       eap_msg->length);
index dd5e81b..dc2fa2a 100644 (file)
@@ -668,7 +668,7 @@ static rlm_rcode_t mod_post_proxy(void *inst, REQUEST *request)
         *      The format is very specific.
         */
        if (vp->length != (17 + 34)) {
-               RDEBUG2("Cisco-AVPair with leap:session-key has incorrect length %d: Expected %d",
+               RDEBUG2("Cisco-AVPair with leap:session-key has incorrect length %zu: Expected %d",
                       vp->length, 17 + 34);
                return RLM_MODULE_NOOP;
        }
index 3a96e89..4d282ad 100644 (file)
@@ -957,7 +957,8 @@ rlm_rcode_t rlm_ldap_check_access(ldap_instance_t const *inst, REQUEST *request,
        if (vals) {
                if (inst->access_positive) {
                        if (strncasecmp(vals[0], "false", 5) == 0) {
-                               RDEBUG("\"%s\" attribute exists but is set to 'false' - user locked out");
+                               RDEBUG("\"%s\" attribute exists but is set to 'false' - user locked out",
+                                      inst->userobj_access_attr);
                                rcode = RLM_MODULE_USERLOCK;
                        }
                        /* RLM_MODULE_OK set above... */
index f9202d9..924724b 100644 (file)
@@ -366,7 +366,7 @@ rlm_rcode_t od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR *
                                 pStepBuff, NULL);
        if (status == eDSNoErr) {
                if (pStepBuff->fBufferLength > 4) {
-                       uint32_t len;
+                       size_t len;
 
                        memcpy(&len, pStepBuff->fBufferData, sizeof(len));
                        if (len == 40) {
@@ -379,7 +379,7 @@ rlm_rcode_t od_mschap_auth(REQUEST *request, VALUE_PAIR *challenge, VALUE_PAIR *
                                                 *response->vp_strvalue,
                                                 "MS-CHAP2-Success",
                                                 mschap_reply, len+2);
-                               RDEBUG2("dsDoDirNodeAuth returns stepbuff: %s (len=%ld)\n", mschap_reply, len);
+                               RDEBUG2("dsDoDirNodeAuth returns stepbuff: %s (len=%zu)\n", mschap_reply, len);
                        }
                }
        }
index 8ac9207..3677b87 100644 (file)
@@ -912,7 +912,7 @@ ntlm_auth_err:
                 * if not, crypto has probably gone wrong
                 */
                if (passlen > 512) {
-                       RDEBUG2("Decrypted new password blob claims length %u > 512 - probably an invalid NT-Password", passlen);
+                       RDEBUG2("Decrypted new password blob claims length %zu > 512 - probably an invalid NT-Password", passlen);
                        return -1;
                }
 
@@ -971,14 +971,14 @@ ntlm_auth_err:
                        if (c < 0x7f) {
                                /* ascii char */
                                if (new_pass->length >= 253) {
-                                       RDEBUG("Ran out of room turning new password into utf8 at %d - cleartext will be truncated!", i);
+                                       RDEBUG("Ran out of room turning new password into utf8 at %zu - cleartext will be truncated!", i);
                                        break;
                                }
                                x[new_pass->length++] = c;
                        } else if (c < 0x7ff) {
                                /* 2-byte */
                                if (new_pass->length >= 252) {
-                                       RDEBUG("Ran out of room turning new password into utf8 at %d - cleartext will be truncated!", i);
+                                       RDEBUG("Ran out of room turning new password into utf8 at %zu - cleartext will be truncated!", i);
                                        break;
                                }
                                x[new_pass->length++] = 0xc0 + (c >> 6);
@@ -986,7 +986,7 @@ ntlm_auth_err:
                        } else {
                                /* 3-byte */
                                if (new_pass->length >= 251) {
-                                       RDEBUG("Ran out of room turning new password into utf8 at %d - cleartext will be truncated!", i);
+                                       RDEBUG("Ran out of room turning new password into utf8 at %zu - cleartext will be truncated!", i);
                                        break;
                                }
                                x[new_pass->length++] = 0xe0 + (c >> 12);
@@ -1458,10 +1458,10 @@ static rlm_rcode_t mod_authenticate(void * instance, REQUEST *request)
                RDEBUG("MS-CHAPv2 password change request received");
 
                if (cpw->length != 68) {
-                       RDEBUG2("MS-CHAP2-CPW has the wrong format - length %d!=68", cpw->length);
+                       RDEBUG2("MS-CHAP2-CPW has the wrong format - length %zu != 68", cpw->length);
                        return RLM_MODULE_INVALID;
                } else if (cpw->vp_octets[0]!=7) {
-                       RDEBUG2("MS-CHAP2-CPW has the wrong format - code %d!=7", cpw->vp_octets[0]);
+                       RDEBUG2("MS-CHAP2-CPW has the wrong format - code %d != 7", cpw->vp_octets[0]);
                        return RLM_MODULE_INVALID;
                }
 
index c5ce2b9..91666f2 100644 (file)
@@ -505,7 +505,7 @@ static size_t rest_encode_post(void *ptr, size_t size, size_t nmemb,
 
                curl_free(escaped);
 
-               RDEBUG("\tLength : %i", len);
+               RDEBUG("\tLength : %zd", len);
                RDEBUG("\tValue  : %s", p);
 
                p += len;
@@ -529,7 +529,7 @@ static size_t rest_encode_post(void *ptr, size_t size, size_t nmemb,
        len = p - (char*)ptr;
 
        RDEBUG2("POST Data: %s", (char*) ptr);
-       RDEBUG2("Returning %i bytes of POST data", len);
+       RDEBUG2("Returning %zd bytes of POST data", len);
 
        return len;
 
@@ -550,7 +550,7 @@ static size_t rest_encode_post(void *ptr, size_t size, size_t nmemb,
        if (!len) {
                REDEBUG("AVP exceeds buffer length or chunk");
        } else {
-               RDEBUG2("Returning %i bytes of POST data (buffer full or chunk exceeded)", len);
+               RDEBUG2("Returning %zd bytes of POST data (buffer full or chunk exceeded)", len);
        }
 
        return len;
@@ -672,7 +672,7 @@ static size_t rest_encode_json(void *ptr, size_t size, size_t nmemb,
                        /*
                         *      Show actual value length minus quotes
                         */
-                       RDEBUG2("\tLength : %i", (*p == '"') ? (len - 2) : len);
+                       RDEBUG2("\tLength : %zu", (size_t) (*p == '"') ? (len - 2) : len);
                        RDEBUG2("\tValue  : %s", p);
 
                        p += len;
@@ -719,7 +719,7 @@ static size_t rest_encode_json(void *ptr, size_t size, size_t nmemb,
        len = p - (char*)ptr;
 
        RDEBUG2("JSON Data: %s", (char*) ptr);
-       RDEBUG2("Returning %i bytes of JSON data", len);
+       RDEBUG2("Returning %zd bytes of JSON data", len);
 
        return len;
 
@@ -740,7 +740,7 @@ static size_t rest_encode_json(void *ptr, size_t size, size_t nmemb,
        if (!len) {
                REDEBUG("AVP exceeds buffer length or chunk");
        } else {
-               RDEBUG2("Returning %i bytes of JSON data (buffer full or chunk exceeded)", len);
+               RDEBUG2("Returning %zd bytes of JSON data (buffer full or chunk exceeded)", len);
        }
 
        return len;