delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/23/12:02:53

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=P8eZf93uYiQgXUkGSwYh7hO4PQbK
mjGnODmkGkqjVxRCVn+CHzq80x7StYh2wXvs8j9m3YKMjqkLxMfS84BRmHuBFf6g
eEHMfSIpJA/ljdcAp5m6bQC/7JgRXXzX1iFebc3N9smJEtGlMSMy91RMzhXcTPlP
BukXwNsMpQlCoNw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; s=default; bh=7chJl3QwyOh3PoATlhLJyD6sR+w=; b=JB
r9+CSDj/R6hbt4MjWbQS+EcytgLcT6q2ZSiiBbktv/syDsNCuERxgjwHrnceNUSo
ANcvBaqYb+v/RvbLDIQGunD/OjFRsPOXyWZs+7s+GJqHb5iD2JAJC+6UUbOUczdc
ywCdSzzli2XAs6RsfmBu0G2FXptsStfm3sdydF/eo=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Admin, H*f:sk:1C7B904, H*MI:sk:1C7B904, Administrator
X-HELO: etr-usa.com
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: wget 1.17.x creates odd permissions on downloaded files
From: Warren Young <wyml AT etr-usa DOT com>
In-Reply-To: <1326055565.20160623132132@yandex.ru>
Date: Thu, 23 Jun 2016 10:02:23 -0600
Message-Id: <C474BEF7-8A4B-4CB8-8612-9554AA65CC9F@etr-usa.com>
References: <20160622184015 DOT GA73575 AT quantum DOT stat DOT colostate DOT edu> <1C7B9046-3261-4D73-8A92-7F46B86E5A0F AT etr-usa DOT com> <1326055565 DOT 20160623132132 AT yandex DOT ru>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u5NG2lPe008646

On Jun 23, 2016, at 4:21 AM, Andrey Repin <anrdaemon AT yandex DOT ru> wrote:
> 
> Greetings, Warren Young!
> 
>>> 2) Examining the permissions on putty.exe, the first thing that
>>> comes up is an error that reads:
>>> 
>>> "The permissions on putty.exe are incorrectly ordered, which may
>>> cause some entries to be ineffective.”
> 
>> That’s Explorer saying that, not Cygwin, right?  Let Explorer fix it.
> 
> Do NOT do that. It'll screw Cygwin permission handling.

Not necessarily.

If you can restrict Cygwin to a known set of directories, you can use Cygwin-only permissions in those directories and let Windows do whatever it wants with everything else.

Here’s my fixperms script, which keeps both sides happy:

    #!/bin/bash
    if [ -z "$1" ]
    then
    	for d in /usr/local ~/bin ~/tmp
    	do
    		echo Fixing permissions in $d...
    		chown -R $(id -nu) "$d"
    		find "$d" -exec "$0" {} \;
    	done
    elif ! setfacl -kb "$1"
    then
    	echo "   ...in $1"
    fi

Modify the list of Cygwin-only directories at the top of the script to suit your local situation.

I don’t bother doing this to the entirety of c:\cygwin*.  I only include directories I’m likely to open in both Cygwin and Explorer in that list.

You might have to run it a few times to fix everything, due to the way Windows permission inheritance works.  (I prefer that to the alternative, which is the breadth-first find(1) hacks: http://stackoverflow.com/q/1086907)

You’ll probably also need to run it as Administrator, at least the first time.  After that, new permission changes should be ones your user has the ability to revert without Admin level privileges.

If you’ve set your Cygwin HOME directory to be the same as your Windows user profile directory, be sure NOT to include ~ in the list of directories you modify with this script.  There are files under %APPDATA% at the very least that will break horribly if you run this on them.  Do this only on files that your user personally owns and uses, not files owned and used by Windows on your user’s behalf.

Directories you run this script on do not show the “incorrectly ordered” symptom in Explorer.
--
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