Name

ap_os_canonical_filename — convert a filename to its canonical form

Synopsis

char *ap_os_canonical_filename(pool *pPool, const char *szFile)

Returns a canonical form of a filename. This is needed because some operating systems will accept more than one string for the same file. Win32, for example, is case blind, ignores trailing dots and spaces, and so on.[3] This function is generally used before checking a filename against a pattern or other similar operations.

[3] In fact, exactly what Windows does with filenames is very poorly documented and is a seemingly endless source of security holes.

Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.