[tac_plus] Escaping special characters within double quotes

john heasley heas at shrubbery.net
Wed Nov 6 02:12:00 UTC 2019


Fri, Sep 13, 2019 at 12:06:06AM +0000, Viswanathan, Vasanth:
> Hi,
> 
> I am using tac_plus version F4.0.4.28. tac_plus man page suggests to use double-quotes when a string has white spaces. Here is an example of command authorization in tac_plus.conf file –
> 
> cmd = ping {
>     permit “10\.10\.10\.[2-9]+ -c 10” # allow 10 pings
>     deny “10\.10\.10\.[2-9]+ -c 100” # don’t allow 100 pings
> }
> 
> I have to enclose the regex in double-quotes because it has multiple arguments. But this causes tac_plus to not start due to parsing error.
> However this works (without double-quotes) –
> 
> cmd = ping {
>     permit 10\.10\.10\.[2-9]+
>     deny 10\.10\.10\.[20-30]+
> }
> 
> I looked the source code and it seems like tac_plus only allows backslash/quote/newline character after a backslash within a double-quoted string. I am trying to understand why we have this restriction.
> 
> Thanks!
> Vasanth
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.shrubbery.net/pipermail/tac_plus/attachments/20190913/dbc324c2/attachment.html>
> _______________________________________________
> tac_plus mailing list
> tac_plus at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/tac_plus

there was an error in the error reporting.  fixed in the attached diff.

and, the whitespace in a quoted string was not handled, nor was backslash-
quoting the whitespace or any of the regex atoms.  In the diff I've also
changed this to only treat \" specially; anything else is just copied.  I
struggled with this decision, but I think it is acceptable.

Please report if there are problems.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tacparse.diff
Type: text/x-diff
Size: 1463 bytes
Desc: not available
URL: <http://www.shrubbery.net/pipermail/tac_plus/attachments/20191106/0c6fbcb5/attachment.diff>


More information about the tac_plus mailing list