13 May
2008
13 May
'08
9:54 a.m.
Norbert Wegener wrote:
I don't want the module saneusername to be executed, when the username either contains "HOST" or ends with ".net" or contains "@". Therefore in 2.0.4 I have this code in sites-available/default:
authorize {
if (!( "%{User-Name}" =~ /HOST/ || "%{User-Name}" =~ /.net/ || "%{User-Name}" =~ /@/ )) {
But brackets around everything. The parser is *horrible*. if (!((User-Name =~ /HOST/) || (User-Name =~ /\.net$/) || (User-Name =~ /@/))) { i.e. all on one line, which brackets around every condition. This should also work: if (User-Name !~ /HOST|\.net$|@/) {
What do I have to change to make it work as expected?
Brackets. The parser really needs to be updated to use something sane... like yacc. Alan DeKok.