Bug #1312

$HTTP["remoteip"] compared to subnet does not work

Added by Anonymous 504 days ago. Updated 89 days ago.

Status:Invalid Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:core
Target version:-
Pending:

No

Resolution:

invalid

Patch available:


Description

I use lighttpd as a personal webserver and on this server I also have a wiki. I want to block access to the wiki directory for all computers not belonging to my subnet. In lighttpd 1.4.14 and earlier the following worked:


$HTTP["remoteip"] != "192.168.0.0/8" {
  $HTTP["url"] =~ "^/wiki/" {
    url.access-deny = ( "" )
  }
}

But that does no longer work in lighttpd 1.4.16

If I rewrite the check to something like this it will work:


$HTTP["remoteip"] != "192.168.0.20" {
  $HTTP["url"] =~ "^/wiki/" {
    url.access-deny = ( "" )
  }
}

The operating system is Linux 2.6.21.3 running on an AMD64.

-- john.eckerdal

History

08/22/2007 05:44 PM - darix

can you please test if http://zen.sh.nu/~darix/lighttpd-1.4.17.r1956.tar.gz
fixes your problem? this is a 1.4.17 release candidate.

08/23/2007 12:10 PM - jan

Yep, this is a duplicate of #41

Close as duplicate when done.

08/23/2007 04:47 PM - Anonymous

With the 1.4.17 release candidate it seems to work as expected.

-- john.eckerdal

08/23/2007 05:20 PM - darix

  • Status changed from New to Fixed
  • Resolution set to fixed

closing as of last comment.

03/19/2008 09:58 AM - Anonymous

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (fixed)

hy,

here in :

ii lighttpd 1.4.18-1+b1 A fast webserver with minimal memory footprint

the matching on subnets doesn's work

$HTTPremoteip =~ "192.168.0.0/24" { }

alias.url += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )
$HTTPurl =~ "/cgi-bin/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" )
}

-- ruben

03/19/2008 10:07 AM - Anonymous

hy,

still the same Problem in

ii lighttpd 1.4.19-1 A fast webserver with minimal memory footprint

all unmodified Debian packages.

-- ruben

03/25/2008 10:28 PM - stbuehler

  • Status changed from Need Feedback to Fixed
  • Resolution set to invalid

You cannot check a subnet mask as a regular expression; use "==" or "!=" to match against subnets.

10/10/2008 06:54 PM - stbuehler

  • Status changed from Fixed to Invalid

Also available in: Atom PDF