diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index a22bee621..75d6ae185 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,7 @@ +2009-01-24 Corinna Vinschen + + * pathnames.sgml: Add section about accessing /etc files. + 2009-01-21 Corinna Vinschen * cygserver.sgml: Remove the "How to use the Cygserver services" diff --git a/winsup/doc/pathnames.sgml b/winsup/doc/pathnames.sgml index e2991544e..845c4fbbe 100644 --- a/winsup/doc/pathnames.sgml +++ b/winsup/doc/pathnames.sgml @@ -225,8 +225,46 @@ not by default, for example). Special filenames - -DOS devices +Special files in /etc + +Certain files in Cygwin's /etc directory are +read by Cygwin before the mount table has been established. The list +of files is + + + /etc/fstab + /etc/fstab.d/$USER + /etc/passwd + /etc/group + + +These file are read using native Windows NT functions which have +no notion of Cygwin symlinks or POSIX paths. For that reason +there are a few requirements as far as /etc is +concerned. + +To access these files, the Cygwin DLL evaluates it's own full +Windows path, strips off the innermost directory component and adds +"\etc". Let's assume the Cygwin DLL is installed as +C:\cygwin\bin\cygwin1.dll. First the DLL name as +well as the innermost directory (bin) is stripped +off: C:\cygwin\. Then "etc" and the filename to +look for is attached: C:\cygwin\etc\fstab. So the +/etc directory must be parallel to the directory in which the cygwn1.dll +exists and /etc must not be a Cygwin symlink +pointing to another directory. Consequentially none of the files from +the above list, including the directory +/etc/fstab.dis allowed to be a Cygwin symlink +either. + +However, native NTFS symlinks and reparse points are transparent +when accessing the above files so all these files as well as +/etc itself may be NTFS symlinks or reparse +points. + + + +DOS devices Filenames invalid under Win32 are not necessarily invalid under Cygwin since release 1.7.0. There are a couple of rules which