Windows 8 group won't respect /etc/passwd or /etc/group
John Smith
john@whitelancer.com
Fri Jan 10 14:32:00 GMT 2014
Well, actually, I take that back. Today I'm still having the same
issue. :frustrated:
If I ever figure it out I'll let you know. Maybe it's just Sublime Text
that is the issue and I'll just have to use something else.
On 1/8/2014 12:49 PM, Corinna Vinschen wrote:
> On Jan 8 12:07, John Smith wrote:
>>> That's not how it works for me, even with Notepad. It only changes
>>> the file content, not the ownership.
>>
>> If you create a file outside of cygwin, you should see it as a group
>> of none, correct? Then if you update that file's group using cygwin
>> to "chgrp Users", cygwin reports that file correctly changed groups.
>> But the problem comes now when I that file again outside of cygwin,
>> then look at the file again in cygwin, the group has once again
>> reverted to ?????. I don't recall seeing this happen on a previous
>> install (I've used cygwin for years) but some new things for me is
>> that I'm running Win 8.1 (user is that windows live account) and I'm
>> also trying out cygwin64.
>>
>> Are you able to test this
>
> Almost. I'm using a domain user account but the mechanism is the same.
>
>> and say you are not seeing this?
>
> I'm not seeing this. Creating the file with Notepad sets user and group
> to myself and my primary domain group. `Chgrp Users' on that file
> changes the group to the group Users, which is a local (==non-domain)
> predefined group, which is confirmed by ls -l. Then I start Notepad
> on the same file again, change it, and save the changes. Afterwards,
> the file's group is still "Users".
>
>>>> In *nix, once you change a group, just editing a file won't change
>>>> the group back to something else.
>>>
>>> That doesn't happen on Cygwin, too.
>>
>> This is the behavior I'm seeing -- so maybe cygwin isn't really able
>> to change the group, then?
>
> Yes, it can. Changing the group does change the security descriptor on
> disk. The effect you're seeing is weird, but it's not how Cygwin
> usually works.
>
>> But again once I
>> edit that file the group reverts to ???? and I lose group
>> permissions again. I don't get it.
>
> Me neither. But see below.
>
>> My apologies, I was just thinking that if I could get my programs to
>> open up and make them set the default group to Users whenever they
>> add/edit/update/etc a file that might solve the issue, but I am not
>> sure that will at this point. And I'd have to find some way to do
>> that across the board, which I think you said wouldn't work.
>
> It works for Cygwin and non-Cygwin processes started from a Cygwin process.
> It does not work for processes started from explorer.
>
> OTOH, I don't understand what you're trying to accomplish. You can just
> change the name of the "none" (or "HomeUser", see below) group in
> /etc/group and be happy. The group membership doesn't really matter on
> a non-domain standalone system anyway.
>
>>> Try the icacls command on a file to see
>>> what it prints and compare the info with your passwd and group files.
>>
>> I'm not sure how to read this. It's giving me a list of
>> permissions, but how do I know what group cygwin sees?
>
> You don't. Windows doesn't use the primary group field for any
> purpose, so there's no reason for a WIndows tool to print the
> primary group. At least, so far Windows never used the primary
> group for any purpose, but see below.
>
>> I can
>> understand this is the hierarchy of permissions, but I don't see a
>> "none" group anywhere --
>
> It's not a hirarchy. It's just a list. And, yes, the None group
> is missing. But here I'm wondering. Do you have the HomeUsers
> group in /etc/group? If not, add it.
>
> I can't be sure, but it seems that Windows uses that group as primary
> group if you're using the HomeGroup sharing stuff, which I have no
> experience with. I tried to reproduce this, but this is apparently not
> enabled on enterprise systems. But I read a bit about it, and it
> seems to have a life on its own, for instance:
>
> http://www.tomshardware.co.uk/forum/27119-63-remove-user-homeusers-win7
> http://social.technet.microsoft.com/Forums/windows/en-US/4d059295-838e-4e81-9658-823897a5bda2/
>
> Probably best not to use it and only use normal workgroup sharing.
>
>> icacls cc.txt
>> cc.txt WHITELANCER\John:(RX)
>> Whitelancer\HomeUsers:(I)(RX)
>> BUILTIN\Administrators:(I)(F)
>> NT AUTHORITY\SYSTEM:(I)(F)
>> WHITELANCER\John:(I)(F)
>> Everyone:(I)(RX)
>>
>> If that is the case, how do I make a manual entry in my /etc/group
>> for a "John" group?
>
> Don't. That's your user account. It doesn't belong into /etc/group.
>
>
> Corinna
>
--
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
More information about the Cygwin
mailing list