This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: wget 1.17.x creates odd permissions on downloaded files

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

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

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:

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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]