Re: [users@httpd] negative regex in SetEnvIf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9 juin 06, at 14:32, Joshua Slive wrote:

# will not work...
BrowserMatch !Firefox not_fx

There is no direct support for this, but you can often reverse the
logic and cause the regex to unset and env variable instead and then
use the lack of the variable as a trigger for whatever you were trying
to do.

Yes, we've explored this a little bit yesterday with the syntax:

SetEnvIf Request_URI .* GoAway=1
BrowserMatch .+ !GoAway
SetEnvIf Referer .+ !GoAway
Deny from env=GoAway

that means "deny every client that comes with blank user-agent AND with blank referer" (do no deny every client that comes either with a non-blank client, or with a non-blank referer)

It's easy, because ".+" is the negation of "^$", so I don't have to use something like "!^$" (which wouldn't work) I think it's becoming more complicated if I want the opposite of a particular value.

for example: "deny every client that comes with Firefox AND with blank referer" (do no deny every client that comes either with a non- firefox client, or with a non-blank referer)

may be I'm missing something obvious...

Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux