delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/04/05:34:40

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 4 Feb 2011 11:34:02 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7: Setting noacl (or how do I get modified files to not become executable)
Message-ID: <20110204103402.GC19549@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4D4B2969 DOT 1020908 AT sidefx DOT com>
MIME-Version: 1.0
In-Reply-To: <4D4B2969.1020908@sidefx.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 http://cygwin.com/cygwin-ug-net/using.html#mount-table 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
  user::rwx
  group::r-x
  mask:rwx
  other:r-x
  default:user::rwx
  default:group::r-x
  default:other:r-x
  $ 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

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

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019