Project

General

Profile

Actions

Bug #1312

closed

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

Added by Anonymous over 17 years ago. Updated over 16 years ago.

Status:
Invalid
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by darix over 17 years ago

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.

Actions #2

Updated by jan over 17 years ago

Yep, this is a duplicate of #41

Close as duplicate when done.

Actions #3

Updated by Anonymous over 17 years ago

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

-- john.eckerdal

Actions #4

Updated by darix over 17 years ago

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

closing as of last comment.

Actions #5

Updated by Anonymous about 17 years ago

  • 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/" )
$HTTP[[url]] =~ "/cgi-bin/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" )
}
}

-- ruben

Actions #6

Updated by Anonymous about 17 years ago

hy,

still the same Problem in

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

all unmodified Debian packages.

-- ruben

Actions #7

Updated by stbuehler about 17 years ago

  • 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.

Actions #8

Updated by stbuehler over 16 years ago

  • Status changed from Fixed to Invalid
Actions

Also available in: Atom