Subject: Symlinks, executability, system attribute, etc (was Re: [ANNOUNCEMENT])
From: "Mark Hadfield" <[email-masked]>
To: <[email-masked]>
Date: Fri, 23 Feb 2001 09:44:13 +1300

From: "Christopher Faylor" <[email-masked]>
> No.  Cygwin only does symlink tests on files which have the system
attribute
> set.  This was hashed, rehashed and bitterly noted in a recent thread
here.
> It does open the file to see if it has a '#!', marking it executable if
so.
>
> [and later...] You could solve this by either reading the code or paying
> attention to the mailing list...

Thanks for the clarification. I did see several messages at the end of that
thread but I failed to see the relevance.

I apologise for not doing more thinking/research on this before bringing it
to the list. I was planning on leaving it for a few weeks but I was stung
into action by Corinna's announcement .

> Possibly setting CYGWIN=ntsec will avoid this overhead.  Mounting the
directory
> with the '-x' flag will certainly avoid it at the expense of having cygwin
> think that every file in the directory is executable.

Yes, "mount -x" works but is a bit drastic as you say. Another solution that
would fit my needs in this particular case better (but is even more drastic)
is to have a mount option guaranteeing that NONE of the files in the
directory are executable. Just a thought.

Another thought about symlinks, executability etc. IF a change like
Corinna's proposal is adopted and IF some time in the future support for
current-style symlinks is dropped (or can be turned off optionally) then
Cygwin will know that all symlinks have the extension .lnk and it will no
longer need to use the system attribute for that purpose. Could the Windows
system attribute then be used to indicate executability,i.e. the rule would
be that a file is executable if the extension is .exe etc OR the system
attribute is set. Voila, no need to look inside files for #!

I don't think there are any particularly serious consequences about having
the system attribute set on script files. On the Unix machines I deal with,
Samba maps the executable attribute on the Unix host to the system attribute
on the Windows client. I deal with such files all the time via Windows
software and have had only minor problems: Explorer asks for confirmation
before I delete them and my text editor (PFE) clears the system attribute
when it changes the file.

Of course, if consistency between Windows & Cygwin paths inside a .lnk file
is considered to be too problematic, then Cygwin symlinks could be
identified by some other extension.

---
Mark Hadfield
[email-masked]  http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple