[v4.0.x] fr_pair_list_afrom_file is broken (dhcpclient, radclient)
Hello, v4.0.x dhcpclient is currently broken (most likely radclient is too). When reading value pairs from stdin or a file (function fr_pair_list_afrom_file), only the first value pair is returned. (It does parse all the vps though, because if I try an invalid attribute name, an error is returned.) It worked not long ago (May 22nd). Maybe this change is the culprit? https://github.com/FreeRADIUS/freeradius-server/commit/22ffa0f79ce480ec681e1... Regards, Nicolas. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On Jun 5, 2018, at 9:33 AM, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
v4.0.x dhcpclient is currently broken (most likely radclient is too).
When reading value pairs from stdin or a file (function fr_pair_list_afrom_file), only the first value pair is returned. (It does parse all the vps though, because if I try an invalid attribute name, an error is returned.)
It worked not long ago (May 22nd).
Yes. Arran has been refactoring some code, and things have been broken.
Maybe this change is the culprit?
https://github.com/FreeRADIUS/freeradius-server/commit/22ffa0f79ce480ec681e1...
That was a fix for some of the other breakages. The real fix is to call fr_radius_init() in radclient. I've pushed a fix which works for me. Alan DeKok.
That was a fix for some of the other breakages.
The real fix is to call fr_radius_init() in radclient. I've pushed a fix which works for me.
What about dhcpclient ? It already calls fr_dhcpv4_init (which I assume is the equivalent of fr_radius_init for DHCPv4). Is there something more required ? This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On Jun 5, 2018, at 10:20 AM, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
What about dhcpclient ?
It already calls fr_dhcpv4_init (which I assume is the equivalent of fr_radius_init for DHCPv4).
Yes.
Is there something more required ?
There shouldn't be. It works for me in the latest v4.0.x HEAD. Alan DeKok.
I think the following code is wrong: https://github.com/FreeRADIUS/freeradius-server/blob/v4.0.x/src/lib/util/pai... do { fr_cursor_append(&cursor, vp); } while (vp->next && (vp = vp->next));
From what I understand, fr_cursor_append allows to add a single item at the end of the list. But here, vp can be a list of vps (multiple vps can be passed in on a single line).
So what happens is we only get the first value pair of the line. I tried to write all vps each on a separate line. In this case, it works. Regards, Nicolas. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On Jun 5, 2018, at 11:40 AM, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
I think the following code is wrong:
https://github.com/FreeRADIUS/freeradius-server/blob/v4.0.x/src/lib/util/pai...
do { fr_cursor_append(&cursor, vp); } while (vp->next && (vp = vp->next));
From what I understand, fr_cursor_append allows to add a single item at the end of the list. But here, vp can be a list of vps (multiple vps can be passed in on a single line).
Yeah, I pushed a fix. Alan DeKok.
It works again. 😊 Thanks!
From what I understand, fr_cursor_append allows to add a single item at the end of the list. But here, vp can be a list of vps (multiple vps can be passed in on a single line).
Yeah, I pushed a fix.
Alan DeKok.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
participants (2)
-
Alan DeKok -
Chaigneau, Nicolas