Visible symlinks under Windows

Corinna Vinschen corinna at
Wed Feb 6 11:27:07 GMT 2008


as Cygwin developer, it's sort of frustrating that there isn't a way to
identify symlinks on Samba shares from a Windows user space application
for what they really are.

While most Windws applications have no idea how to handle symlinks,
that's obviously not the case for a Linux emulator.  However, right now,
due to the fact that Cygwin has no idea how to create a symlink on a
Samba share, it always creates fake symlinks on a Samba share which only
work in the Windws environment, and it only recognizes symlinks as files
or directories, depending on the target of the symlink.

If there would be a way to identify a symlink and to create real
symlinks on a Samba share, Cygwin would happily handle them.

So I'm wondering, is there any interest to implement another extension
along the lines of the changes to the SMB_FS_OBJECTID_INFORMATION reply,
which would allow a "knowing" Win32 application to retrieve the actual
symlink file information as well as allowing it to create real symlinks?

If so, the question is, how could that be done?  I had the following idea:

We could fake an Extended Attribute which contain the symlink information. 

When requesting a symlink's file information, it could return an EA
called, say, ".smb.symlink".  The EA value consists of the relevant
parts of the content of the stat buffer returned by lstat, plus the
target path of the symlink in UNIX path notation.

Creating a symlink could work by creating a simple file with an
EA in the EA list, called, say, ".smb.symlink.create".  The value is
the target path in UNIX path notation.  Given that ZwCreateFile (and its
SMB protocol counterpart) allows to define EAs at file creation time,
creating a symlink would be a simple one step operation.

Would a patch to accomplish that have a chance to be included in Samba?


More information about the samba-technical mailing list