]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only one more bad use of vp_strvalue to go...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 4 Nov 2019 14:23:27 +0000 (08:23 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 4 Nov 2019 14:23:35 +0000 (08:23 -0600)
15 files changed:
src/lib/server/paircmp.c
src/lib/tls/session.c
src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c
src/modules/rlm_example/rlm_example.c
src/modules/rlm_ldap/groups.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_logintime/rlm_logintime.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_test/rlm_test.c
src/modules/rlm_wimax/rlm_wimax.c
src/modules/rlm_winbind/rlm_winbind.c
src/modules/rlm_yubikey/rlm_yubikey.c

index b420044696f5a0130ca34576b8fd7ee5ef0d3973..2d71ad475e4defa25b69d05727fa9c5e82a0dae6 100644 (file)
@@ -137,7 +137,7 @@ static int prefix_suffix_cmp(UNUSED void *instance,
 
        name = username->vp_strvalue;
 
-       RDEBUG3("Comparing name \"%s\" and check value \"%s\"", name, check->vp_strvalue);
+       RDEBUG3("Comparing name \"%s\" and check value \"%pV\"", name, &check->data);
 
        len = strlen(check->vp_strvalue);
 
index efeb3a5aaccad6df161993fecb12335d95351811..11e9b931e38c46f6970993a813638cae33c12f7e 100644 (file)
@@ -1434,7 +1434,7 @@ int tls_session_handshake(REQUEST *request, tls_session_t *session)
                        fr_pair_value_strcpy(vp,  SSL_CIPHER_get_name(cipher));
                        fr_pair_add(&request->state, vp);
                        RINDENT();
-                       RDEBUG2("&session-state:TLS-Session-Cipher-Suite := \"%s\"", vp->vp_strvalue);
+                       RDEBUG2("&session-state:%pP", vp);
                        REXDENT();
                }
 
@@ -1762,7 +1762,7 @@ tls_session_t *tls_session_init_server(TALLOC_CTX *ctx, fr_tls_conf_t *conf, REQ
         */
        vp = fr_pair_find_by_da(request->control, attr_tls_session_cert_file, TAG_ANY);
        if (vp) {
-               RDEBUG2("Loading TLS session certificate \"%s\"", vp->vp_strvalue);
+               RDEBUG2("Loading TLS session certificate \"%pV\"", &vp->data);
 
                if (SSL_use_certificate_file(session->ssl, vp->vp_strvalue, SSL_FILETYPE_PEM) != 1) {
                        tls_log_error(request, "Failed loading TLS session certificate \"%s\"",
index b0daadffb8e6bc5962612854964657b69dccbc23..a6c6422750ff5fd6068dde81aaa64ee5a1007bcd 100644 (file)
@@ -377,7 +377,7 @@ static rlm_rcode_t mschap_finalize(REQUEST *request, rlm_eap_mschapv2_t *inst,
 
                        VP_VERIFY(response);
 
-                       RDEBUG2("MSCHAP-Error: %s", response->vp_strvalue);
+                       RDEBUG2("MSCHAP-Error: %pV", &response->data);
 
                        /*
                         *      Parse the new challenge out of the
index e2359314a3a3422416bbc87355cf6e1a19ec4c2b..3d3cd132216e52c9ef4d72b06cc68135422738b2 100644 (file)
@@ -722,7 +722,7 @@ rlm_rcode_t eap_peap_process(REQUEST *request, eap_session_t *eap_session, tls_s
 
                        fr_pair_value_bstrncpy(t->username, data + 1, data_len - 1);
 
-                       RDEBUG2("Got tunneled identity of %s", t->username->vp_strvalue);
+                       RDEBUG2("Got tunneled identity of %pV", &t->username->data);
                }
        } /* else there WAS a t->username */
 
index 3fe0a248cd42c36f0623f4cea0d2b63a08997c31..08513eec6524cfa30de4a1d8952d2d6835086909 100644 (file)
@@ -151,7 +151,7 @@ static rlm_rcode_t eap_tls_virtual_server(rlm_eap_tls_t *inst, REQUEST *request,
        if (vp) {
                server_cs = virtual_server_find(vp->vp_strvalue);
                if (!server_cs) {
-                       REDEBUG2("Virtual server \"%s\" not found", vp->vp_strvalue);
+                       REDEBUG2("Virtual server \"%pV\" not found", &vp->data);
                error:
                        eap_tls_fail(request, eap_session);
                        return RLM_MODULE_INVALID;
index e88ef8795e83bdff4cc11dc9f1dd42db0cd1b4de..0a3168b65f47defbd127585d7fe81a45e472085f 100644 (file)
@@ -79,7 +79,7 @@ static int rlm_example_cmp(UNUSED void *instance, REQUEST *request, UNUSED VALUE
 {
        rad_assert(check->vp_type == FR_TYPE_STRING);
 
-       RINFO("Example-Paircmp called with \"%s\"", check->vp_strvalue);
+       RINFO("Example-Paircmp called with \"%pV\"", &check->data);
 
        if (strcmp(check->vp_strvalue, "yes") == 0) return 0;
        return 1;
index bc8bfbd5521cdf62e5eaa84be9bbc257abda58a0..e8649d197013420ac46a8c90c128d2715e3f5605 100644 (file)
@@ -799,8 +799,8 @@ rlm_rcode_t rlm_ldap_check_userobj_dynamic(rlm_ldap_t const *inst, REQUEST *requ
                            (memcmp(check->vp_strvalue, resolved, check->vp_length) == 0)) eq = true;
                        talloc_free(resolved);
                        if (eq) {
-                               RDEBUG2("User found in group \"%s\". Comparison between membership: name "
-                                      "(resolved from DN \"%s\"), check: name", check->vp_strvalue, value);
+                               RDEBUG2("User found in group \"%pV\". Comparison between membership: name "
+                                      "(resolved from DN \"%s\"), check: name", &check->data, value);
                                rcode = RLM_MODULE_OK;
 
                                goto finish;
index 1f7bac89dfff6af2698711b8b73d977f69e5d844..b5631dfd7278a9399de0996666661cd5414adc64 100644 (file)
@@ -1030,7 +1030,7 @@ static rlm_rcode_t mod_authorize(void *instance, UNUSED void *thread, REQUEST *r
                fr_pair_value_bstrncpy(vp, password, pass_size);
 
                if (RDEBUG_ENABLED3) {
-                       RDEBUG3("Added eDirectory password.  control:%s += '%s'", vp->da->name, vp->vp_strvalue);
+                       RDEBUG3("Added eDirectory password.  control:%pP", vp);
                } else {
                        RDEBUG2("Added eDirectory password");
                }
index a4cff1944e4dd805dca69ef474db7dd039f69a77..f7ea3d3ea114bde6f56c601f0785f71d2224ba1c 100644 (file)
@@ -104,7 +104,7 @@ static int time_of_day(UNUSED void *instance, REQUEST *request,
        time_t          now;
 
        if (strspn(check->vp_strvalue, "0123456789: ") != strlen(check->vp_strvalue)) {
-               RDEBUG2("Bad Time-Of-Day value \"%s\"", check->vp_strvalue);
+               RDEBUG2("Bad Time-Of-Day value \"%pV\"", &check->data);
                return -1;
        }
 
@@ -119,7 +119,7 @@ static int time_of_day(UNUSED void *instance, REQUEST *request,
        scan = atoi(p);
        p = strchr(p, ':');
        if ((scan > 23) || !p) {
-               RDEBUG2("Bad Time-Of-Day value \"%s\"", check->vp_strvalue);
+               RDEBUG2("Bad Time-Of-Day value \"%pV\"", &check->data);
                return -1;
        }
        when = scan * 3600;
@@ -127,7 +127,7 @@ static int time_of_day(UNUSED void *instance, REQUEST *request,
 
        scan = atoi(p);
        if (scan > 59) {
-               RDEBUG2("Bad Time-Of-Day value \"%s\"", check->vp_strvalue);
+               RDEBUG2("Bad Time-Of-Day value \"%pV\"", &check->data);
                return -1;
        }
        when += scan * 60;
@@ -136,7 +136,7 @@ static int time_of_day(UNUSED void *instance, REQUEST *request,
        if (p) {
                scan = atoi(p + 1);
                if (scan > 59) {
-                       RDEBUG2("Bad Time-Of-Day value \"%s\"", check->vp_strvalue);
+                       RDEBUG2("Bad Time-Of-Day value \"%pV\"", &check->data);
                        return -1;
                }
                when += scan;
index 2ac2f35c05196aa97f96c86dcbb4c272899fd830..528ebc6610003185d72811d4200747bdb6cf08e5 100644 (file)
@@ -1925,7 +1925,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                        continue;
                }
                RINDENT();
-               RDEBUG3("%s", header->vp_strvalue);
+               RDEBUG3("%pV", &header->data);
                REXDENT();
 
                ctx->headers = curl_slist_append(ctx->headers, header->vp_strvalue);
index 9a2bc588d462444c2c2b6727c6d9305840b56d32..ecea7f38e5792fe69acbbd974eea0ae577d95950 100644 (file)
@@ -656,7 +656,7 @@ int sql_set_user(rlm_sql_t const *inst, REQUEST *request, char const *username)
         */
        MEM(pair_update_request(&vp, inst->sql_user) >= 0);
        fr_pair_value_strsteal(vp, expanded);
-       RDEBUG2("SQL-User-Name set to '%s'", vp->vp_strvalue);
+       RDEBUG2("SQL-User-Name set to '%pV'", &vp->data);
 
        return 0;
 }
index 13107a32668868a31e48123967602eef12f961de..0da4a204b6b5ab3835b7ffe77e92c5bafb4ee7b5 100644 (file)
@@ -181,7 +181,7 @@ static int rlm_test_cmp(UNUSED void *instance, REQUEST *request, UNUSED VALUE_PA
 {
        rad_assert(check->vp_type == FR_TYPE_STRING);
 
-       RINFO("Test-Paircmp called with \"%s\"", check->vp_strvalue);
+       RINFO("Test-Paircmp called with \"%pV\"", &check->data);
 
        if (strcmp(check->vp_strvalue, "yes") == 0) return 0;
        return 1;
index 059238687ea95a9eea2be6e7f63f7b8d71d6ca75..3548888a8fc09ca2bafd142c39012d2551e26d90 100644 (file)
@@ -144,7 +144,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(UNUSED void *instance, UNUSED
                p[(5*3)+2] = '\0';
                fr_pair_value_strsteal(vp, p);
 
-               DEBUG2("Fixing WiMAX binary Calling-Station-Id to %s", vp->vp_strvalue);
+               DEBUG2("Fixing WiMAX binary Calling-Station-Id to %pV", &vp->data);
                return RLM_MODULE_OK;
        }
 
index eaf54e9144f08a44127b487b2e9bd04ce53d17b8..46040a76ced13033ece93132c48ab9937a0bddbd 100644 (file)
@@ -171,7 +171,7 @@ static int winbind_group_cmp(void *instance, REQUEST *request, UNUSED VALUE_PAIR
                goto error;
        }
 
-       REDEBUG2("Trying to find user \"%s\" in group \"%s\"", username, check->vp_strvalue);
+       REDEBUG2("Trying to find user \"%s\" in group \"%pV\"", username, &check->data);
 
        err = wbcCtxGetGroups(wb_ctx, username, &num_groups, &wb_groups);
        switch (err) {
index 90f09f091c835e5b17e807d6925d5a25ca9a4b14..91b728e89d326ad38c2e7fd53d958b95cc11a87c 100644 (file)
@@ -316,11 +316,11 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
 
                RINDENT();
                if (RDEBUG_ENABLED3) {
-                       RDEBUG3("&request:Yubikey-OTP := '%s'", vp->vp_strvalue);
-                       RDEBUG3("&request:User-Password := '%s'", password->vp_strvalue);
+                       RDEBUG3("&request:%pP", vp);
+                       RDEBUG3("&request:%pP", password);
                } else {
-                       RDEBUG2("&request:Yubikey-OTP := <<< secret >>>");
-                       RDEBUG2("&request:User-Password := <<< secret >>>");
+                       RDEBUG2("&request:%s := <<< secret >>>", vp->da->name);
+                       RDEBUG2("&request:%s := <<< secret >>>", password->da->name);
                }
                REXDENT();