Can't use list qualifiers in attribute strings output from an exec'd program #1860

Open
arr2036 opened this Issue Nov 25, 2016 · 0 comments

Projects

None yet

1 participant

@arr2036
Member
arr2036 commented Nov 25, 2016 edited

Issue type

  • [ x ] Feature request.

Defect/Feature description

It's because fr_pair_list_afrom_str needs rewriting to use tmpl functions for string parsing.

Described here: http://stackoverflow.com/questions/40803060/freeradius-receive-data-from-external-script

How to reproduce issue

update request {
	control: += `/bin/bash -c "echo reply:Reply-Message = \'hello\'"`
}

Or uncomment the equivalent lines in the backticks_list.unlang file in src/tests/modules/backticks_list.unlang.

Output of [radiusd|freeradius] -X showing issue occurring

Fri Nov 25 17:07:31 2016 : Debug : (0)      update request {
Fri Nov 25 17:07:31 2016 : Debug : (0)          Executing: /bin/bash -c "echo reply:Reply-Message = \'hello\'"
Fri Nov 25 17:07:31 2016 : Debug : arg[0] /bin/bash
Fri Nov 25 17:07:31 2016 : Debug : arg[1] -c
Fri Nov 25 17:07:31 2016 : Debug : arg[2] echo reply:Reply-Message = \'hello\'
Fri Nov 25 17:07:31 2016 : Debug : export USER_NAME="tony"
Fri Nov 25 17:07:31 2016 : Debug : export USER_PASSWORD="taponi"
Fri Nov 25 17:07:31 2016 : Debug : export TMP_STRING_0="hello"
Fri Nov 25 17:07:31 2016 : ERROR : ERROR: (0)          Failed parsing output from: /bin/bash -c "echo reply:Reply-Message = \'hello\'": Expecting operator
Fri Nov 25 17:07:31 2016 : ERROR : ERROR: (0)          Program returned code (0) and output "reply:Reply-Message = 'hello'"
Fri Nov 25 17:07:31 2016 : Debug : (0)      } # update request (fail)
Fri Nov 25 17:07:31 2016 : Debug : (0)    } # authorize (fail)
Fri Nov 25 17:07:31 2016 : Debug : (0)    Using Post-Auth-Type Reject
Fri Nov 25 17:07:31 2016 : Debug : (0)    Empty post-auth section in virtual server "default".  Using default return value noop.
Fri Nov 25 17:07:31 2016 : Debug : (0)  } # server default
Fri Nov 25 17:07:31 2016 : Debug : (0)  Virtual server sending reply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment