httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@leland.Stanford.EDU>
Subject Re: win32 os_stat question
Date Fri, 10 Jul 1998 18:20:38 GMT
On Fri, 10 Jul 1998, Ben Laurie wrote:

[...]

> It is the general style of Apache to not assert at all. But the point in
> this case is that you shouldn't call os_stat with a not-fully-qualified
> path. The error checking should go elsewhere, IMO.

An assert should only be used to verify things we know to be true. Or
expect to be true. When it is possible - and legal - for the user to
configure the server in a certain way that we don't like, asserts are not
a valid way to handle the situation.

I much perfer

if (szPath[1] != ':' && szPath[1] != '/') {
     fprintf(stderr, "httpd: Illegal path name %s", szPath);
     exit(1);
}

to

ap_assert(szPath[1] == ':' || szPath[1] == '/');

The latter is meaningless to users.

[...]

> > Why is /apache incorrect?  The docs say it should work, it works fine for
> > me if I remove the assert.  It was only broken when you added stuff to
> > deal with UNCs.
> 
> a) it is incorrect because it doesn't specify which drive you are on. If
> you are happy to have it choose from various drives at random, by all
> means deem it to be correct.
> 
> b) So what if it was broken when I added UNCs?

For the reasons Marc specified. I know it worked fine last summer.
Although I am confused - os_canonical_filename() is supposed to fix this
(that's the reason for the GetFullPathName() call - one of its features is
that it adds drive letters to paths without them), so why is os_stat
getting such a filename?

[...]

> > Yea, but I have this odd idea that the config files as shipped should
> > work.
> 
> I never use the shipped config files. They are completely stupid:

Regardless, Marc is correct. If Apache, as shipped, does not work with the
config files, as shipped, then one of the two must be fixed. I consider
this sufficient cause to hold up a release.

P.S. The docs/config file comments are wrong, in any case, since AFAIK,
they still don't mention that all filenames should be in all-lowercase.

-- Alexei Kosut <akosut@stanford.edu> <http://www.stanford.edu/~akosut/>
   Stanford University, Class of 2001 * Apache <http://www.apache.org> *



Mime
View raw message