Bug 23850 - Allow from at times need /32
Summary: Allow from at times need /32
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: Auth/Access (show other bugs)
Version: 1.3.27
Hardware: Sun Solaris
: P3 blocker (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2003-10-15 21:11 UTC by TTSG Internet Services, Inc.
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description TTSG Internet Services, Inc. 2003-10-15 21:11:26 UTC
1) Create directory off root of server
2) Put in following .htaccess

AuthType Basic 
AuthName Restricted
Satisfy Any

AuthDBMUserFile /local/server/.htpasswd

<Limit GET POST>
order deny,allow
deny from all
allow from
allow from

require valid-user 

3) Access from, requests a password
4) Access from, doesn't request a password
5) Put change statement to "allow from"
6) Access from no longer asks for password
7) Add "Allow from" (Out of the /19 that the server
and are in, but still advertised via BGP locally) and can't
access. Use "Allow from", can.

Why does it seem like if the IP is in a network local we have to put /32 on it,
and if its remote it works ok?
Comment 1 Joshua Slive 2003-10-17 14:20:11 UTC
I'm very skeptical you've identified a bug here for several reasons:

1. I've never heard of any problem remotely like this before,
and these features are used frequently.

2. The fact that you are using <Limit GET POST> shows that you
are not following recommended practices for apache configuration,
and therefore there could be many other things wrong with your config.

I suggest you start with an absolutely default install of apache
with no extra modules and no config modifications except the
ones you suggest below.  If it still doesn't work, you can reopen
this bug, but be sure to provide more details about what is
in your logs, the exact OS version, etc.

Thanks for using Apache!
Comment 2 TTSG Internet Services, Inc. 2003-11-02 01:25:05 UTC

Ok, we did some investigation. 

1) Download/uncompress/untar source
2) Compile with gcc 3.2.3 with just ./configure;make;make install
3) Create a directory under htdocs called testing, put in an .htaccess of :

AuthDBMUserFile /local/wwwcust/passes/sample
AuthDBMGroupFile /dev/null
AuthName Members_Only
AuthType Basic
 Satisfy Any
 order deny,allow
 deny from all
 allow from
 allow from 202.139.152
 allow from 210.80.149
 allow from
 allow from
 allow from
 allow from 209.135.126
 allow from 64.8.218
 allow from 63.201.23
 allow from
 allow from 62.39.85
 allow from
require valid-user

4) Edit the stock httpd.conf where it depicts the default document root like
<Directory /usr/local/etc/httpd/htdocs> and change the "AllowOverride None" to
"AllowOverride All". Start server
5) From attempt to access the directory, it will ask for an id/pass
6) Change it to, it works.

Delete all directories and configs. 

Start the instructions again, except in step 2 , change it to "CC=gcc -m32"
infront of the ./configure;make;make install
At step 5, it will let you in immediately.

So, it seems, in 64 bit mode it has issues, but not 32 bit.

We can reproduce this on mutiple machine that we own, and others own.
Comment 3 Joshua Slive 2003-11-02 03:03:29 UTC
Interesting.  I assume that it doesn't matter if you remove the
Auth*/Require/Satisfy directives and just test mod_access?

I don't have a solaris system handy to test on, but if someone does,
I'm sure they'd be interested in your exact OS/patch level.
Comment 4 TTSG Internet Services, Inc. 2003-11-02 20:31:00 UTC
With only the following in .htaccess:

order deny,allow
deny from all
allow from
allow from

I see the same symptoms, coming from the 24.* address I get in (Outside our
network) , from 216.* (local subnet) I get forbidden, if I add the /32 it works

This server is running Solaris 9, kernel patch level 112233-07, apache 1.3.28
compiled with 64-bit gcc3.2.3 with a standard build , using gnu make 3.80 (also
built 64-bit).
Comment 5 Joe Orton 2003-11-02 23:01:52 UTC
What's the result of running:

$ cd srclib/apr/test
$ make testall
$ ./testall -v testipsub

from the 64-bit build tree?
Comment 6 TTSG Internet Services, Inc. 2003-11-02 23:19:20 UTC

I find no "apr" directory anywhere in the Apache 1.3.X tree when I untar it.

Thanks, Tuc/TTSG Internet Services, Inc.
Comment 7 Joe Orton 2004-03-07 22:11:04 UTC
This was found and fixed independently by Henning Brauer from the OpenBSD team;
the fix is checked in here for the next 1.3 release; thanks for the report.