Re: Do NOT add a slash at the end of the directory path.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 7, 2008 at 4:29 PM, Lloyd Parkes <Lloyd.Parkes@xxxxxxxxxxx> wrote:
> solprovider@xxxxxxxxxx wrote:
>  > Input validation is typically handled with something like:
>  > if(ServerRoot ends with slash) ServerRoot = ServerRootWithFinalSlashRemoved;
>  I must confess that I thought this was the normal way to do things as well.
>
>  Of course, one problem is that removing a trailing slash may not be the right
>  thing to do because Apache runs on more than just Unix. Windows is probably easy
>  to handle compared with NetWare and mainframes.
>  Lloyd Parkes

The directory separator depends on the OS: slash (*nix and others),
backslash (MS), and colon (Apple).  The period was used by at least
one OS. Most programming languages have a method for discovering the
proper separator e.g. File.separator in Java.  The difficulty is not
discovering the separator character, but handling multibyte
characters.  The final byte may match the separator while part of a
multibyte character so removing that byte would not be correct.

My designs prefer input validation over instructions like your
objection.  I often add code to verify results from my own functions
under the assumption that I or someone else may break things someday.
My research on how httpd handles this will be delayed until next week.
I am still hoping an httpd dev will comment.

solprovider

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux