This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.7: Setting noacl (or how do I get modified files to not become executable)

On Feb  3 17:17, Edward Lam wrote:
> Dear Cygwin gurus,
> I'm hoping to find some solution to the problem where if a file is
> modified by a native Windows application, it becomes "executable"
> according to cygwin.
> After some searching, it appears that the only way to do this is by
> setting the noacl mount option by appropriately manipulating
> /etc/fstab.

No, you got that wrong.  The "noacl" option avoids that Cygwin sets
POSIX options on files and directories.  Rather it just ignores the
ACLs entirely and goes with what the underlying Windows deems right
when creating files or directories.

However, reagrdless what you do in /etc/fstab, it will *not* affect
native Win32 applications for hopefully obvious reasons.  The mount
points have no meaning for WIn32 apps, only for Cygwin apps, since the
entire mount point handling is encapsulated within the Cygwin DLL.

> However, I can't seem do it such that it works when I cd
> to /home/user or /tmp.
> Here's my mount output:
>   $ mount -m
>   none / cygdrive binary,noacl,posix=0,user 0 0
>   $ mount
>   C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
>   C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
>   C:/cygwin on / type ntfs (binary,auto)
>   C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
> What am I doing wrong? What's the right /etc/fstab entry to modify
> "/" to use noacl?

Read again,
especially the stuff about the "override" option.  Given that
the "noacl" option will not do as you want anyway, just don't do it.

What you want can only be influenced by changing the ACL of the
parent directories in which you're working.  Directory ACLs
have default entries which determine what permissions a native
Windows application will set on files or directories created in
this directory.  You can influence them using setfacl:

  $ getfacl .
  # file: .
  # owner: corinna
  # group: vinschen
  $ setfacl -m d:u::rw-,d:g::r--,d:o:r-- .

Subsequently added files and directories created by non-Cygwin
applications will not have execute permissions.  If you want to
keep execute permissions for directories, you have to use a 
Windows tool like cacls or icacls or even the GUI dialog to
set different default permissions for files and directories.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]