public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Warren Young <wyml@etr-usa.com>
To: cygwin@cygwin.com
Subject: Re: wget 1.17.x creates odd permissions on downloaded files
Date: Thu, 23 Jun 2016 18:20:00 -0000	[thread overview]
Message-ID: <C474BEF7-8A4B-4CB8-8612-9554AA65CC9F@etr-usa.com> (raw)
In-Reply-To: <1326055565.20160623132132@yandex.ru>

On Jun 23, 2016, at 4:21 AM, Andrey Repin <anrdaemon@yandex.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

  reply	other threads:[~2016-06-23 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 19:05 Zube
2016-06-22 19:36 ` Larry Hall (Cygwin)
2016-06-22 20:39   ` Zube
2016-06-22 19:43 ` Warren Young
2016-06-23 10:54   ` Andrey Repin
2016-06-23 18:20     ` Warren Young [this message]
2016-06-23 19:37       ` Andrey Repin
2016-06-24  3:23         ` Warren Young
2016-06-25 12:37           ` Andrey Repin
2016-06-23 11:32 ` Andrey Repin
2016-06-23 11:55   ` Zube
2016-06-23 13:05     ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C474BEF7-8A4B-4CB8-8612-9554AA65CC9F@etr-usa.com \
    --to=wyml@etr-usa.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).