public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ls not in sync with chmod (weird problems with file permissions)
@ 2015-02-09 15:37 diod lightbulb
  2015-02-09 16:26 ` Corinna Vinschen
  2015-02-09 20:29 ` Thomas Wolff
  0 siblings, 2 replies; 8+ messages in thread
From: diod lightbulb @ 2015-02-09 15:37 UTC (permalink / raw)
  To: cygwin

HI all,

Maybe this is a regression. This is linked to the problem reported in
this other thread https://cygwin.com/ml/cygwin/2015-02/msg00100.html .
I took notice of
it right after I updated cygwin (setup.exe 2.867) today.

My umask is 022. The drives are NTFS. CYGWIN is set to ntsec even if I
just saw today that it is obsolete by now (I also tried setting acl in
/etc/fstab but it didn't change the weird behavior described below).


1-  For pre-existing files/directories under /cygdrive/d and /cygdrive/e
All my file permissions that were correctly reported by ls -l as
rw-r--r-- became all of a sudden -rw-rwxr--+ ??? The same for
directories where all previously 755 dirs came back as drwxrwxr-x+


2- I tried to see what happened with a newly created file

% cygcheck --version
cygcheck (cygwin) 1.7.34

% cd /cygdrive/d/foo
% touch buggy
% ls -l buggy
-rw-rwxr--+ 1 green Users 0 Feb  7 20:07 buggy*
% stat -c " %a %u %g" buggy
 " buggy 674 1000 545

What the hell? I expected 644.

% chmod 644 buggy
% stat -c " %a %u %g" buggy
 " buggy 674 1000 545

Oooch, no change??? chmod used to work before today (BTW, same
behavior for pre-existing files: chmod has no effect).


Worse, using secaudit, I now get

% secaudit -v buggy
secaudit 1.4.1 : NTFS security data auditing
[snip]
Interpreted Unix owner 1000, group 0, mode 0777

What? 0777 ????

Bizarrely:
% chmod g-w buggy; secaudit -v buggy reported 0677 while ls -l
reported no change whatsoever!!


3- Under my home directory (which is also on the D: drive), everything
seems to be fine (for both pre-existing files/directories and newly
created files)

% cd ~; touch doinfine; ls -l doinfine reports rw-r--r-- and secaudit
as well as stat report a 644 mode.

So I still have the expected (and desired behavior) right under my
home directory but nowhere else (even on the same drive).

This is really annoying, hope someone can investigate into this.

Regards,
Green

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 15:37 ls not in sync with chmod (weird problems with file permissions) diod lightbulb
@ 2015-02-09 16:26 ` Corinna Vinschen
  2015-02-09 21:01   ` diod lightbulb
  2015-02-09 20:29 ` Thomas Wolff
  1 sibling, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2015-02-09 16:26 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

On Feb  9 16:37, diod lightbulb wrote:
> HI all,
> 
> Maybe this is a regression. This is linked to the problem reported in
> this other thread https://cygwin.com/ml/cygwin/2015-02/msg00100.html .
> I took notice of
> it right after I updated cygwin (setup.exe 2.867) today.

Does https://cygwin.com/faq/faq.html#faq.using.ssh-pubkey-stops-working
help?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 15:37 ls not in sync with chmod (weird problems with file permissions) diod lightbulb
  2015-02-09 16:26 ` Corinna Vinschen
@ 2015-02-09 20:29 ` Thomas Wolff
  2015-02-09 21:50   ` diod lightbulb
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Wolff @ 2015-02-09 20:29 UTC (permalink / raw)
  To: cygwin

Am 09.02.2015 um 16:37 schrieb diod lightbulb:
> ...
>
> 1-  For pre-existing files/directories under /cygdrive/d and /cygdrive/e
> All my file permissions that were correctly reported by ls -l as
> rw-r--r-- became all of a sudden -rw-rwxr--+ ??? The same for
> directories where all previously 755 dirs came back as drwxrwxr-x+
>
>
> ...
> % chmod 644 buggy
> % stat -c " %a %u %g" buggy
>   " buggy 674 1000 545
>
> Oooch, no change??? chmod used to work before today (BTW, same
> behavior for pre-existing files: chmod has no effect).
> ...
See my mail about "group permissions". This would resolve nicely if 
chmod gets changed to behave like on Linux.
------
Thomas

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 16:26 ` Corinna Vinschen
@ 2015-02-09 21:01   ` diod lightbulb
  2015-02-10  0:05     ` Andrey Repin
  2015-02-10  9:32     ` Corinna Vinschen
  0 siblings, 2 replies; 8+ messages in thread
From: diod lightbulb @ 2015-02-09 21:01 UTC (permalink / raw)
  To: cygwin

On 9 February 2015 at 17:26, Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> On Feb  9 16:37, diod lightbulb wrote:
>> HI all,
>>
>> Maybe this is a regression. This is linked to the problem reported in
>> this other thread https://cygwin.com/ml/cygwin/2015-02/msg00100.html .
>> I took notice of
>> it right after I updated cygwin (setup.exe 2.867) today.
>
> Does https://cygwin.com/faq/faq.html#faq.using.ssh-pubkey-stops-working
> help?
>
>
> Corinna
>

Hi, Corinna,

Sorry, I didn't get the time to completely check the other thread as I
had a lot of troubles subscribing to the mailing list, your answer was
already there.Thank you, this answer is spot on.

To sum up (please correct me if I'm wrong), here is how I understand
what happened:
a- the Posix file permissions under my home directory remained pretty
much the same as those files/directories were created by
cygwin-related apps
b- After your fix, the ACLs struck back in non-cygwin generated files.
Unfortunately, even if I took care chmod'ing (644) nearly all my
files, the ACLs got rid of all that.

All I can do now is apparently to run all my pre-existing files thru
setfacl -b (I like to keep my files with 644 permissions) followed by
chmod. I just have to figure out how to retain the execution bit for
the few select executables that need it.

However, I'd like to ask somthing else, is there a way to make newly
created files outside my home to respect my umask? I just tried touch
still buggy; ll stillbuggy reports -rw-rwxr--+ while  stat -c " %a %u
%g" stillbuggy     gives back " stillbuggy 674 1000 545. So ACL still
seems in effect on both my D: and E: drives except my cygwin home
directory. Any hint welcome.

Regards,
Green

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 20:29 ` Thomas Wolff
@ 2015-02-09 21:50   ` diod lightbulb
  2015-02-10  9:35     ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: diod lightbulb @ 2015-02-09 21:50 UTC (permalink / raw)
  To: cygwin

On 9 February 2015 at 21:28, Thomas Wolff <towo@towo.net> wrote:
> Am 09.02.2015 um 16:37 schrieb diod lightbulb:
>>
>> ...
>>
>> 1-  For pre-existing files/directories under /cygdrive/d and /cygdrive/e
>> All my file permissions that were correctly reported by ls -l as
>> rw-r--r-- became all of a sudden -rw-rwxr--+ ??? The same for
>> directories where all previously 755 dirs came back as drwxrwxr-x+
>>
>>
>> ...
>> % chmod 644 buggy
>> % stat -c " %a %u %g" buggy
>>   " buggy 674 1000 545
>>
>> Oooch, no change??? chmod used to work before today (BTW, same
>> behavior for pre-existing files: chmod has no effect).
>> ...
>
> See my mail about "group permissions". This would resolve nicely if chmod
> gets changed to behave like on Linux.
> ------
> Thomas

Hi Thomas,

Maybe so, I really didn't see the point of ACLs before, I'm just happy
with (used to?) plain POSIX. And up until now, the cygwin behavior was
OK with me. I must say (a somewhat big inconvenience but I didn't
complain) that I routinely chmod 644 all new files created by
non-cygwin apps (say new files downloaded with Mozilla). That's why I
asked earlier if there's an easy way to enforce file permissions 644
for any newly created file. Maybe through Windows but then what would
be the right corresponding Windows permissions to ensure them?

It's important for me that the files I care for are in Group Users as
my use case on this box is a Debian/Windows 7 dual-boot.  I have a
UserMapping file for drives D: and E: to try to get consistent
ownership on both. Another inconvenience right now is that the Group
given to newly created files from non-cygwin apps (again, one example
is a Mozilla downloaded file, another one is a Gimp newly created
file) seems to be None instead of Users for cygwin apps. I routinely
chgrp them. Is there a way to make sure that they belong to the Users
group from the start?

Regards,
Green

--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 21:01   ` diod lightbulb
@ 2015-02-10  0:05     ` Andrey Repin
  2015-02-10  9:32     ` Corinna Vinschen
  1 sibling, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2015-02-10  0:05 UTC (permalink / raw)
  To: diod lightbulb, cygwin

Greetings, diod lightbulb!

> All I can do now is apparently to run all my pre-existing files thru
> setfacl -b (I like to keep my files with 644 permissions) followed by
> chmod. I just have to figure out how to retain the execution bit for
> the few select executables that need it.

> However, I'd like to ask somthing else, is there a way to make newly
> created files outside my home to respect my umask? I just tried touch
> still buggy; ll stillbuggy reports -rw-rwxr--+ while  stat -c " %a %u
> %g" stillbuggy     gives back " stillbuggy 674 1000 545. So ACL still
> seems in effect on both my D: and E: drives except my cygwin home
> directory. Any hint welcome.

Hint: don't bother with it.
You're trying to create a lot of trouble for yourself with very little gain.
Only look for POSIX permissions, where you absolutely MUST have them literal
(i.e. where you have to cater to buggy software that don't properly understand
ACL's).


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 10.02.2015, <02:44>

Sorry for my terrible english...


--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 21:01   ` diod lightbulb
  2015-02-10  0:05     ` Andrey Repin
@ 2015-02-10  9:32     ` Corinna Vinschen
  1 sibling, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2015-02-10  9:32 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

On Feb  9 22:00, diod lightbulb wrote:
> However, I'd like to ask somthing else, is there a way to make newly
> created files outside my home to respect my umask? I just tried touch
> still buggy; ll stillbuggy reports -rw-rwxr--+ while  stat -c " %a %u
> %g" stillbuggy     gives back " stillbuggy 674 1000 545. So ACL still
> seems in effect on both my D: and E: drives except my cygwin home
> directory. Any hint welcome.

The default ACL entries of the parent directories are the problem.
Have a look with getfacl on a parent dir.  Try the new setfacl -k
option on dirs you desire POSIX perms in.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ls not in sync with chmod (weird problems with file permissions)
  2015-02-09 21:50   ` diod lightbulb
@ 2015-02-10  9:35     ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2015-02-10  9:35 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2654 bytes --]

On Feb  9 22:50, diod lightbulb wrote:
> On 9 February 2015 at 21:28, Thomas Wolff <towo@towo.net> wrote:
> > Am 09.02.2015 um 16:37 schrieb diod lightbulb:
> >>
> >> ...
> >>
> >> 1-  For pre-existing files/directories under /cygdrive/d and /cygdrive/e
> >> All my file permissions that were correctly reported by ls -l as
> >> rw-r--r-- became all of a sudden -rw-rwxr--+ ??? The same for
> >> directories where all previously 755 dirs came back as drwxrwxr-x+
> >>
> >>
> >> ...
> >> % chmod 644 buggy
> >> % stat -c " %a %u %g" buggy
> >>   " buggy 674 1000 545
> >>
> >> Oooch, no change??? chmod used to work before today (BTW, same
> >> behavior for pre-existing files: chmod has no effect).
> >> ...
> >
> > See my mail about "group permissions". This would resolve nicely if chmod
> > gets changed to behave like on Linux.
> > ------
> > Thomas
> 
> Hi Thomas,
> 
> Maybe so, I really didn't see the point of ACLs before, I'm just happy
> with (used to?) plain POSIX. And up until now, the cygwin behavior was
> OK with me. I must say (a somewhat big inconvenience but I didn't
> complain) that I routinely chmod 644 all new files created by
> non-cygwin apps (say new files downloaded with Mozilla). That's why I
> asked earlier if there's an easy way to enforce file permissions 644
> for any newly created file. Maybe through Windows but then what would
> be the right corresponding Windows permissions to ensure them?
> 
> It's important for me that the files I care for are in Group Users as
> my use case on this box is a Debian/Windows 7 dual-boot.  I have a
> UserMapping file for drives D: and E: to try to get consistent
> ownership on both. Another inconvenience right now is that the Group
> given to newly created files from non-cygwin apps (again, one example
> is a Mozilla downloaded file, another one is a Gimp newly created
> file) seems to be None instead of Users for cygwin apps. I routinely
> chgrp them. Is there a way to make sure that they belong to the Users
> group from the start?

Guys, I'm aware that the new ACL group/mask behaviour gives a little
trouble.  Before you turn your Windows system upside down, let's
discuss how to go forward.  See my mail at

  https://cygwin.com/ml/cygwin/2015-02/msg00197.html

and chime in so we can puzzle out the best solution for the future.
Ideally I(*) only have to implement this once ;)


Corinna


(*) Well, ideally somebody takes a heart and helps coding...


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-10  9:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-09 15:37 ls not in sync with chmod (weird problems with file permissions) diod lightbulb
2015-02-09 16:26 ` Corinna Vinschen
2015-02-09 21:01   ` diod lightbulb
2015-02-10  0:05     ` Andrey Repin
2015-02-10  9:32     ` Corinna Vinschen
2015-02-09 20:29 ` Thomas Wolff
2015-02-09 21:50   ` diod lightbulb
2015-02-10  9:35     ` Corinna Vinschen

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).