Bug 1068795

Summary: rlm_perl attribute values truncated
Product: [Fedora] Fedora Reporter: John Dennis <jdennis>
Component: freeradiusAssignee: John Dennis <jdennis>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: jdennis, lemenkov, nikolai.kondrashov
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: freeradius-3.0.1-4.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1068798 (view as bug list) Environment:
Last Closed: 2014-03-09 04:37:21 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:    
Bug Blocks: 1068798    

Description John Dennis 2014-02-21 22:07:09 UTC
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.

Comment 1 John Dennis 2014-02-21 22:13:55 UTC
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 2 Fedora Update System 2014-02-22 03:33:23 UTC
freeradius-3.0.1-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/freeradius-3.0.1-3.fc20

Comment 3 Fedora Update System 2014-02-22 18:21:32 UTC
Package freeradius-3.0.1-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing freeradius-3.0.1-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2964/freeradius-3.0.1-3.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-02-26 19:51:54 UTC
freeradius-3.0.1-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/freeradius-3.0.1-4.fc20

Comment 5 Fedora Update System 2014-03-09 04:37:21 UTC
freeradius-3.0.1-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.