Bug 1068798

Summary: rlm_perl attribute values truncated
Product: Red Hat Enterprise Linux 7 Reporter: John Dennis <jdennis>
Component: freeradiusAssignee: John Dennis <jdennis>
Status: CLOSED CURRENTRELEASE QA Contact: David Spurek <dspurek>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dpal, dspurek, ebenes, jdennis, ksrot, lemenkov, nikolai.kondrashov
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: freeradius-3.0.1-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1068795 Environment:
Last Closed: 2014-06-13 10:48:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1068795    
Bug Blocks:    

Description John Dennis 2014-02-21 22:14:35 UTC
+++ This bug was initially created as a clone of Bug #1068795 +++

Attribute values passed into rlm_perl are truncated.

rad_recv: Access-Request packet from host 127.0.0.1 port 43312, id=164, length=77
	User-Name = 'baduser'
	User-Password = 'password'
	NAS-IP-Address = 127.0.0.1
	NAS-Port = 0
	Message-Authenticator = 0xe2fd6fe6902a551f5dcb8e603b6d981d

rlm_perl: RAD_REQUEST: User-Name = badu
rlm_perl: RAD_REQUEST: User-Password = pass
rlm_perl: RAD_REQUEST: NAS-Port = 0
rlm_perl: RAD_REQUEST: NAS-IP-Address = 127.0.0.1
rlm_perl: RAD_REQUEST: Message-Authenticator = xe2fd6fe6902a551f5dcb8e603b6d981d


The string values are truncated to 4 characters.

--- Additional comment from John Dennis on 2014-02-21 17:13:55 EST ---

in src/lib/print.c the vp_prints_value function is defined like this:

size_t vp_prints_value(char *out, size_t outlen, VALUE_PAIR const *vp, int8_t quote)

which at some point does this:

return fr_print_string(vp->vp_strvalue, vp->length, out, sizeof(out));

Note the length field of fr_print_string is passed as sizeof(out),
but out is a pointer, on a system whose pointers are 4 bytes the maximum
string emitted will be 4 characters.

The correct length to pass is the outlen parameter.

Comment 7 Ludek Smid 2014-06-13 10:48:38 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.