Bug 40079 - Server do not work under limited user account
Summary: Server do not work under limited user account
Status: RESOLVED INVALID
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Platform (show other bugs)
Version: 2.2.2
Hardware: PC Windows XP
: P4 normal with 4 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-20 14:24 UTC by Alexander Pravdin
Modified: 2007-05-12 10:54 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pravdin 2006-07-20 14:24:08 UTC
I a tried to run server under limited user account which do not have access to 
all file system except its root directory (E:\usr\local\Apache2). Server 
installed as a service. When I run it I see the error and this message in the 
system event log: 

httpd.exe: Could not open configuration file bin/conf/httpd.conf: path not found

Conf file located in /conf subdirectory of the server root directory. 
Winternals FileMon show the httpd.exe tried to open D:\WINDOWS\System32
\bin\conf\httpd.cfg only, without searching in other directories from the Path 
environment variable, only in first, with 'bin'. Okay, I put the key -
d "E:\usr\local\Apache2" into the command line of service execution. After this 
apache found the httpd.conf file but do not start. EventLog now has another 
error: 

httpd.exe: Syntax error on line 4 of E:\\usr\\local\\Apache2/conf/httpd.conf: 
ServerRoot must be a valid directory

In line 4 I have this string: 'ServerRoot "E:/usr/local/Apache2"'. Then I tried 
to comment it but have same error in another line. And this error continues 
with all paths in the config.

BUT! If I run the service under system account - I have no errors, without 
changes of anything. All works fine.

Limited user account have full access to the E:/usr/local/Apache2 directory.
Comment 1 William A. Rowe Jr. 2006-07-20 21:17:13 UTC
Interesting; this bug should not be closed until we determine why exactly
the -d argument was required in your specific case if you had a valid -f.
That said...

"Limited user account have full access to the E:/usr/local/Apache2 directory."

In order to prevent directory and configuration paths from being confused and
ignored, Apache will FindFile to obtain the 'true' directory name all the way
from the root drive letter, up to the path.  This means your limited user acct
MUST have permission to list files and get the directory permissions info in 
e:\, e:\usr, e:\usr\local, e:\usr\local\apache2.  That is, every directory
that your configuration implies.

It doesn't need read access to the actual files in those higher-level dirs,
just what unix would call '555' access.  On windows, this is "Read and Execute"
al la Traverse Folder, List Folder, Read Attribs, Read Extended Attribs, and
and Read Permissions.

Keep us informed of your progress!

Keep us informed of your efforts.
Comment 2 Alexander Pravdin 2006-07-21 01:04:31 UTC
Is it riquired to list up-level directories? Why server can not "live" only in 
its directory? Why not only check given path exists, without listing of parent 
directories?
Comment 3 Alexander Pravdin 2006-07-21 01:23:26 UTC
You was right. I permit the apache user to list directories and server started 
successfully. But I do not want permit apache look anywhere instead of its root 
directory. I am programmer, and I do not see any reason to list parent 
directories.

>> why exactly the -d argument was required in your specific case if you had a 
>> valid -f

The apache service runs with this command: 

"E:\usr\local\Apache2\bin\httpd.exe" -k runservice

In my first post I wrote Apache can not find its config. Then I modified this 
command to 

"E:\usr\local\Apache2\bin\httpd.exe" -k runservice -d "E:\usr\local\Apache2"

And Apache found its config. So, I think this is a bug, but from a few another 
case.
Comment 4 William A. Rowe Jr. 2006-12-07 11:48:00 UTC
"Is it riquired to list up-level directories? Why server can not "live" only in 
its directory? Why not only check given path exists, without listing of parent 
directories?"

Because Apache cannot be permitted to confuse e:\Apache2Server with e:\Apache~1
or the HOST of various conflicts which can occur because windows chooses to be
CAST INSENSITIVE, but moreso because it's also NOT CANONICAL.  The file path
"e:\Apache2Server\" is equivilant to "e:\Apache2Server.", for example.

Therefore we **INSIST** on canonicalizing the path.  If we have nothing but list
access to see dir FOO exists, this isn't a security problem.  If we accept both
e:\Apache~1\ and e:\Apache2Server as two different names, there IS A HUGE
security problem.

Marked as invalid.  Parent directories must be list/traverse accessible to
differentiate them on Win32.
Comment 5 Alexander Alfimov 2007-05-12 10:54:21 UTC
(In reply to comment #4)
> Because Apache cannot be permitted to confuse e:\Apache2Server with 
e:\Apache~1
> or the HOST of various conflicts which can occur because windows chooses to be
> CAST INSENSITIVE, but moreso because it's also NOT CANONICAL.  The file path
> "e:\Apache2Server\" is equivilant to "e:\Apache2Server.", for example.
> 
> Therefore we **INSIST** on canonicalizing the path.  If we have nothing but 
list
> access to see dir FOO exists, this isn't a security problem.  If we accept 
both
> e:\Apache~1\ and e:\Apache2Server as two different names, there IS A HUGE
> security problem.
> 
> Marked as invalid.  Parent directories must be list/traverse accessible to
> differentiate them on Win32.

Is this statement true for both, windows and unix? Or for windows only?

Thanks.