Cygwin mkdir makes directory I don't have permissions to
The excess of DENY showed by icacls can be caused by the recent changes in cygwin dll (between 2.3 and current 2.5) . It took some round to be right and could have left files or directory with puzzling ACL.
To sanitize the ACLs, a -b
switch was added to setfacl
setfacl -b foo
For reference https://cygwin.com/cygwin-ug-net/ov-new.html#ov-new2.4s
Related videos on Youtube
M.M
Professional C programmer for 16 years, mostly on embedded systems. Some Windows C++ development also.
Updated on September 18, 2022Comments
-
M.M over 1 year
Using latest version of cygwin64 in Windows 10. I have managed to get a directory
foo
that has something strange about its permissions. I'm not quite sure how this happened but here are the symptoms:$ cd /f/temp/foo $ ls -lad . drwxrwx---+ 1 Mm None 0 Jun 16 14:03 . $ mkdir bar $ ls -lad bar d---rwx---+ 1 Mm None 0 Jun 16 14:17 . $ cd bar Permission denied $ umask 0022
This doesn't happen for other directories, e.g.
/f/temp/ok
. Usingls
switches I cannot see any difference betweenf/temp/ok
and/f/temp/foo
.If I do
chmod 775 bar
then I can enterbar
, but then making a directory underbar
has the same problem. So this problem is stopping me doinggit init
in/f/temp/foo
. Doingchown -R Mm *
in the parent makes no difference.My question is: What is causing this problem and what is the proper fix?
There are some differences visible with
icacls
but I'm not sure how to interpret them:$ cd /f/temp $ icacls ok >ok.txt $ icacls foo >foo.txt $ diff -b ok.txt foo.txt 1c1 < ok NULL SID:(DENY)(Rc,S,REA,WEA,X,DC) --- > foo NULL SID:(DENY)(Rc,S,REA,WEA,X,DC) 3c3 < DESKTOP-AO2AIEC\None:(RX) --- > DESKTOP-AO2AIEC\None:(Rc,S,RA) 8c8 < Everyone:(RX) --- > Everyone:(Rc,S,RA) 10,11c10,12 < CREATOR OWNER:(OI)(CI)(IO)(F) < CREATOR GROUP:(OI)(CI)(IO)(RX) --- > CREATOR OWNER:(OI)(CI)(IO)(DENY)(S,RD,WD,AD,REA,WEA,X,DC) > CREATOR OWNER:(OI)(CI)(IO)(D,Rc,WDAC,WO,RA,WA) > CREATOR GROUP:(OI)(CI)(IO)(Rc,S,RA) 16c17 < Everyone:(OI)(CI)(IO)(RX) --- > Everyone:(OI)(CI)(IO)(Rc,S,RA)
I have got a workaround for now: make another directory under
/f/temp
, then usecp -r
to copy all the files out offoo
into the new directory, then deletefoo
and rename the new directory. If I usecp -a
instead ofcp -r
the problem persists.-
Admin almost 8 yearstry
setfacl -b foo
-
Admin almost 8 years@matzeri that seemed to work - if you can write up an answer with an explanation i'll vote and accept
-
Admin over 2 yearsThis happened to me; turned out to be an issue with Windows permissions. I'm not sure what started it but I corrected the permissions in Windows and then creating a dir in cygwin terminal worked correctly.
-
-
M.M almost 8 yearsThe problem originated when I unzipped some files that were created by someone with a different version of cygwin, so that explanation makes sense