[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: non-unix help needed: valid filename characters?

Hallvard B Furuseth wrote:
Which characters one can safely use in filenames on at least the
platforms OpenLDAP is ported to: Unix, Windows (cygwin), IBM zOS and
MacOS X according to ANNOUNCEMENT?  In particular Windows, since
that's the most common non-Unix platform.

MacOSX supports both BSD UFS and Mac HFS(+). In UFS a forward slash is reserved as a path separator, while in HFS the colon serves that purpose. MacOSX swaps the two whenever they appear in the wrong filesystem.

E.g., a file named "foo:bar" stored on UFS will be named "foo/bar" if it's copied to HFS. Currently the MacOSX FileManager will always display paths with "/" as the separator, so it's simplest to treat MacOSX the same as Unix/POSIX.

http://developer.apple.com/qa/qa2006/qa1392.html (Note that we only use BSD APIs...)

HFS also shares the Windows characteristic of being case-preserving but otherwise case-insensitive. I think we can ignore this and just tell people to use UFS if they want to use back-ldif.

IBM z/OS is supported using their UNIX System Services environment. In that environment, regular Unix file conventions apply.


Building OpenLDAP as a Cygwin app is not recommended and I see no reason to make any special effort to support it.

For native Windows, the forbidden characters are listed here

  < > : " / \ | ? *

Windows has a lot of problems, period. I don't think it's worth spending much effort on this platform.

E.g. http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx
you can create legal file names/paths that the Windows desktop cannot manipulate... We're only using Win32 APIs (and AFAIK the POSIX subsystem was deprecated anyway) so it shouldn't be an issue for us.

I only know Unix filenames.  Googling around I've found a plethora of
conflicting info.

It's for a naming scheme for back-ldif filenames that will let back-ldif
work as a general backend, and hopefully won't conflict with its current
names for the config database.  ITS#5408.

Currently back-ldif takes the RDN and escapes the directory separator as
"\hex", which doesn't work on Windows where \ is a directory separator.

Some other notes:

- Don't need really general filenames.  OpenLDAP does in any case assume
   Unix/Windows/URL-style pathnames: root to the left, leaf to the
   right, a single directory separator character.

Every supported platform works that way.

- Hopefully the characters "=-{}" can be used, since database config
   uses those characters.  E.g. olcDatabase={-1}frontend,cn=config.
   ",+" would be nice too, as separators in and between RDNs.

- Need some escape character.  Howard suggested % as in URL-escaping.
   First that sounded nice, but on second thought such a filename is
   not a valid file:// URL component for that file - the '%' must be
   URL-escaped again to access the file as an URL.  Not sure if that's
   a good argument either way.

OK. It was just an idea, we can use something else instead.

   Full URL-escaping also escapes {} which is unfortunate (see point 1).

- For real paranoia, might escape uppercase characters in case-sensitive
   attribute types too.  I won't bother unless someone disagrees,
   both case-sensitive DNs and the use of back-ldif as a general database
   are fairly rare.

Ignore that. back-ldif should never be used as a general database. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/