Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <428BC5AC.74E4385E@dessent.net>
Date: Wed, 18 May 2005 15:46:04 -0700
From: Brian Dessent <brian@dessent.net>
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: create new file from bash: with DACL, owner, & group as windows   would
References: <200505182013.j4IKDBcF012257@tigris.pounder.sol.net> <428BA6E2.70B95230@dessent.net> <200505182118.j4ILIx7q012492@tigris.pounder.sol.net> <200505182230.j4IMUAZY012847@tigris.pounder.sol.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

Tom Rodman wrote:

> wtouch()
> {
>   local file=$1
>   CYGWIN=nontsec touch "$file"
>   setacl -on "$(cygpath -aw "$file")" -ot file \
>     -actn setowner -ownr "n:Administrators;s:n" \
>     -actn setgroup -grp  "n:None;s:n" \
>     -silent || echo $FUNCNAME:setacl failed
>     # see http://setacl.sourceforge.net/html/doc-reference.html
> }
> 
> I'm usually an admin, hence the setacl.  The advantage of
> setacl over chown is that the setacl above has no impact on the
> DACL.

BTW, you're probably aware of this but you can bring the behavior of the
two more into line by setting a GPO.  Change "Default owner for objects
created by members of the Administrators group" to "Object creator"
instead of "Administrators group".  Files created in both Cygwin and
Windows will then be owned by the user account and not the
Administrators group.  Unless of course that's what you want.

Brian

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

