www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/07/31/16:15:14

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Message-ID: <3B6711C9.6050700@ece.gatech.edu>
Date: Tue, 31 Jul 2001 16:15:05 -0400
From: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010713
X-Accept-Language: en-us
MIME-Version: 1.0
To: Charles Wilson <cwilson AT ece DOT gatech DOT edu>
CC: cygwin-developers AT sources DOT redhat DOT com
Subject: Re: Problems with autoconf-2.52 testsuite using current CVS Cygwin
References: <996329431 DOT 27668 DOT ezmlm AT sources DOT redhat DOT com> <3B63432E DOT 6050309 AT ece DOT gatech DOT edu> <3B649305 DOT 2090302 AT ece DOT gatech DOT edu> <3B64C0A9 DOT 1080700 AT ece DOT gatech DOT edu> <3B64F567 DOT 6060304 AT ece DOT gatech DOT edu> <3B65835C DOT 9000001 AT ece DOT gatech DOT edu> <3B65A2B8 DOT 90702 AT ece DOT gatech DOT edu> <3B66CC47 DOT 8040704 AT ece DOT gatech DOT edu>

> On Tue, Jul 31, 2001 at 11:18:31AM -0400, Charles Wilson wrote:
>> I could probably whip up a perl (or shell) script to 
>> do this -- but: what cygwin command can I use to turn off "inherit from 
>> parent" or "propagate to child" behavior on an existing directory?  Not 
>> "chmod 0xxx" is it?
> 
> It would be a combination of a chmod which changes the permissions
> to _anything_ different to the current setting and then a chmod
> which reverts to the current setting. As I mentioned, that's
> needed due to the fact that chmod is so _incredible_ clever.


so the following *should* do the trick (assuming mktemp exists, of 
course).  I'm only concerned with removing "inheritance" from a single 
parent directory.

#!/bin/sh
foo=`mktemp -d /tmp/ggXXXXXX`
if [ -d ${foo} ] ; then
   if [ -d $1 ] ; then
     chmod --reference=$1 ${foo} # save old value
     chmod 0777 $1               # hopefully this is different
     chmod --reference=${foo} $1 # restore old value
   fi
   rmdir ${foo}
fi

--Chuck







- Raw text -


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