Changed behaviour in v3.x
Hi, In my post-auth section, I get the exact date and time in a specific format using /bin/date, and feed that back into an attribute. I've noticed though that now the back-tick exec appends a '\n' (a carriage return) to the end, which it did not do in FR2. Is that now correct (and expected) behaviour? The code in my post-auth: update control { Tmp-String-1 := `/bin/date -u +%%FT%%TZ` } FR 3 output: (20) update control { (20) Executing: "/bin/date -u +%%FT%%TZ" (20) expand: "+%%FT%%TZ" -> '+%FT%TZ' (20) Program returned code (0): 2014-01-27T17:20:42Z (20) Tmp-String-1 := '2014-01-27T17:20:42Z\n' (20) } # update control = noop FR 2 output: expand: +%%FT%%TZ -> +%FT%TZ Exec-Program output: 2014-01-27T17:35:00Z Exec-Program-Wait: plaintext: 2014-01-27T17:35:00Z Exec-Program: returned: 0 +++[control] returns noop When I then re-use the Tmp-String-1 attribute for a reply attribute I'm building, I end up with a CR in the reply attribute, which is then considered invalid (because it contains a CR). If the appended CR is now accepted behaviour, how do I remove it? With Regards Stefan Paetow Software Engineer +44 1235 778812 Diamond Light Source Ltd. Diamond House, Harwell Science and Innovation Campus Didcot, Oxfordshire, OX11 0DE -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
On 27 Jan 2014, at 17:50, <stefan.paetow@diamond.ac.uk> <stefan.paetow@diamond.ac.uk> wrote:
Hi,
In my post-auth section, I get the exact date and time in a specific format using /bin/date, and feed that back into an attribute. I've noticed though that now the back-tick exec appends a '\n' (a carriage return) to the end, which it did not do in FR2. Is that now correct (and expected) behaviour?
Ah I figured that was expected behaviour. You can after all write a script which does not output a trailing \n. I'll poke it to strip off the whitespace and update the tests. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
On 27 Jan 2014, at 18:01, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 27 Jan 2014, at 17:50, <stefan.paetow@diamond.ac.uk> <stefan.paetow@diamond.ac.uk> wrote:
Hi,
In my post-auth section, I get the exact date and time in a specific format using /bin/date, and feed that back into an attribute. I've noticed though that now the back-tick exec appends a '\n' (a carriage return) to the end, which it did not do in FR2. Is that now correct (and expected) behaviour?
Ah I figured that was expected behaviour. You can after all write a script which does not output a trailing \n.
I'll poke it to strip off the whitespace and update the tests.
Done. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Thanks Arran, I'll apply that tomorrow and retry it. I hope I can persuade RedHat to pop that into their version of 3.0.1 as well ;-) Stefan ________________________________________ From: Arran Cudbard-Bell [a.cudbardb@freeradius.org] Sent: Monday, January 27, 2014 6:17 PM To: FreeRadius users mailing list Subject: Re: Changed behaviour in v3.x On 27 Jan 2014, at 18:01, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 27 Jan 2014, at 17:50, <stefan.paetow@diamond.ac.uk> <stefan.paetow@diamond.ac.uk> wrote:
Hi,
In my post-auth section, I get the exact date and time in a specific format using /bin/date, and feed that back into an attribute. I've noticed though that now the back-tick exec appends a '\n' (a carriage return) to the end, which it did not do in FR2. Is that now correct (and expected) behaviour?
Ah I figured that was expected behaviour. You can after all write a script which does not output a trailing \n.
I'll poke it to strip off the whitespace and update the tests.
Done. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
On 01/27/2014 06:10 PM, stefan.paetow@diamond.ac.uk wrote:
Thanks Arran,
I'll apply that tomorrow and retry it.
I hope I can persuade RedHat to pop that into their version of 3.0.1 as well ;-)
We can certainly get it into the Fedora version. But getting it into RHEL-7 is uncertain, we're at the stage in RHEL-7 prep where things are supposed to be stable, going forward any changes are going to require management sign-off backed by strong customer need. Please file a bug against the freeradius package for Fedora 20 (the only Fedora release at the moment which has 3.x). That bugzilla will make sure it gets fixed in Fedora and then I can clone Fedora bugzilla into RHEL-7 bugs where it will await management consideration. Use this URL to file the bug: https://bugzilla.redhat.com/enter_bug.cgi?component=freeradius&product=Fedor... -- John
Just an update on this...
Ah I figured that was expected behaviour. You can after all write a script which does not output a trailing \n.
I'll poke it to strip off the whitespace and update the tests.
As a(n ugly) workaround I've used this: # %S = "YYYY-MM-DD HH:MM:ss" if ("%S" =~ /^([^ ]+)([ ]*)([^ ]+)([ ]*)$/) { update control { # returns SAML-style "YYYY-MM-DDTHH:MM:ss" Tmp-String-1 := "%{1}T%{3}" } } It does the trick and returns what I want it to do. Not ideal, but hey :-) Viva unlang. Stefan -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
Ah I figured that was expected behaviour. You can after all write a script which does not output a trailing \n.
I'll poke it to strip off the whitespace and update the tests.
*PHEW* Thank you very much. :-) Stefan -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
participants (3)
-
Arran Cudbard-Bell -
John Dennis -
stefan.paetow@diamond.ac.uk