public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Windows 8 group won't respect /etc/passwd or /etc/group
@ 2014-01-08  6:18 John Smith
  2014-01-08  9:16 ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: John Smith @ 2014-01-08  6:18 UTC (permalink / raw)
  To: cygwin

Hi there,
I've been struggling with an issue trying to figure out why Windows 8.1 
won't seem to respect the trick of setting your /etc/password to use a 
default group such as users instead of 'none'.  There are a few other 
discussions on this board around changing the group to "Users" and 
modifying the /etc/passwd to have a default group.

The issue I am stumped over is that if I create a file using windows 
explorer (or anything else outside of cygwin), when I go to ls the file 
in cygwin, the group is coming back as none.  Well, technically it's 
coming back as 4294967295.  (64 bit cygwin)

Even stranger, I can change the file manually with a chgrp Users and it 
looks and acts fine, but if I go to edit the file with notepad or any 
other external application, the group gets reset back to 4294967295.

I am trying to isolate it, thinking maybe it's something to do with the 
permissions of the parent folders, but I'm seeing this behavior all over 
the machine -- in My Documents, in Windows, in a blank test folder. 
I've tried removing some groups even, thinking maybe there was some 
weird inheritance going on, but haven't had much luck.

Does anyone have any ideas?  This is driving me batty.  I even tried 
going back to cygwin 32, but it exhibits the same issue -- just using 
the "None" group instead of "???????????" group.

Thanks.

-John

--
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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-08  6:18 Windows 8 group won't respect /etc/passwd or /etc/group John Smith
@ 2014-01-08  9:16 ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2014-01-08  9:16 UTC (permalink / raw)
  To: cygwin

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

On Jan  8 01:18, John Smith wrote:
> Hi there,
> I've been struggling with an issue trying to figure out why Windows
> 8.1 won't seem to respect the trick of setting your /etc/password to
> use a default group such as users instead of 'none'.  There are a
> few other discussions on this board around changing the group to
> "Users" and modifying the /etc/passwd to have a default group.

Not sure if the User's Guide is explaining it badly or not, but "None"
*is* a group.  It's the primary (what you call "default") group for all
users on a local machine not connected to a Windows domain, and it has
the SID S-1-5-21-<xxx>-<yyy>-<zzz>-513.  If you call mkgroup -l it shows
up like this:

  None:S-1-5-21-3229976424-329291882-2774727752-513:513:

assuming you have an english system, otherwise you see a localized
group name.


> The issue I am stumped over is that if I create a file using windows
> explorer (or anything else outside of cygwin), when I go to ls the
> file in cygwin, the group is coming back as none.

Yes, of course.  Changing the primary group via /etc/passwd only
works for Cygwin processes and their child processes.  It does not
change the default user token of all processes.  How should that
work, especially since the OS itself doesn't allow to change the
primary group of local user accounts.

> Well, technically
> it's coming back as 4294967295.  (64 bit cygwin)

This can only happen if you dropped the "None" group from your
/etc/group file.  mkgroup -l > /etc/group will rectify it.



> Even stranger, I can change the file manually with a chgrp Users and
> it looks and acts fine, but if I go to edit the file with notepad or
> any other external application, the group gets reset back to
> 4294967295.

Except for the 4294967295, which is just a missing entry for "None" in
/et/cgroup, this is normal.  See above.  It's not a problem of the OS or
Cygwin, you're just misunderstanding how this works.  User tokens
are propagated from process to child process.  The parent processes
of any first Cygwin process is a native Windows process with an
unchanged user token, so it has "None" as primary group.  At startup
of the first Cygwin process, it reads /etc/passwd and /etc/group
and changes the primary group in its user token if requested by your
settings.  This changed user token will be inherited by child processes
started from this process and subsequent processes, but it does not
affect the user tokens of unrelated processes, especially not of
non-CYgwin processes started from Explorer.  If you want Notepad to
use your group setting, start it from a Cygwin process.

Btw., the name of a group is irrelevant except for printing purposes.
So you are free to change it.  Rather than switching your primary group
from 513 to 545, you can also simply change the name of the None group
to whatever you like:

  MyGroup:S-1-5-21-3229976424-329291882-2774727752-513:513:

Just keep in mind that the three numbers in the middle of the SID 
are machine specific, so don't copy/paste this line from my mail!
Run mkpasswd -l to create this line for your machine and then change
the name of the group to your liking.


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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-10 14:32       ` John Smith
@ 2014-01-11  1:48         ` Linda Walsh
  0 siblings, 0 replies; 8+ messages in thread
From: Linda Walsh @ 2014-01-11  1:48 UTC (permalink / raw)
  To: cygwin

John Smith wrote:
> Well, actually, I take that back.  Today I'm still having the same 
> issue.  :frustrated:
> 
----
Can't say I immediately know the answer to your prob, BUT,
if you have a spare computer you could run samba as a domain server
for windows.

Then you can set your group and see a bunch of the standard groups.
I also have the cygwin-lsa.dll module in my login so it can read the
group & pw file and set membership appropriately.

I think that is necessary.

Just verified -- my non-cygwin processes have the same security token
as when I am in cygwin --

***EXCEPT*** my x64 process's, right now, don't -- they are getting default
tokens because I don't have a full x64 bit setup and don't have a 64-bit
cygwin-lsa.dll .

But on x32 cygwin, in ccygwin, I see:
  id|tr "," "\n"
uid=15013(Bliss\law) gid=10201(Bliss\lawgroup) groups=10201(Bliss\lawgroup)
544(Administrators)
545(Users)
10512(Bliss\Domain Admins)
10513(Bliss\Domain Users)
10517(Bliss\Cert Publishers)
10518(Bliss\Schema Admins)
10519(Bliss\Enterprise Admins)
10520(Bliss\Group Policy Creator Owners)
10260(Bliss\torrent)
11053(Bliss\Trusted Local Net Users)
11612288(High Mandatory Level)
-------------

My main group = my group on my linux box (as propagated by samba).

If I use Process Hacker, I can look at the security token of a non-cygwin process
and see all the Bliss tokens and the high mandatory token.

I don't see the NT_AUTHORITY\xxx tokens in cygwin -- because of a hack in
Samba that refuses to return info about those GUIDS -- if you modify samba to
return the names for those, you can see those as well.

Files I create are normally in Bliss\lawgroup in my own diectories, but in
system dirs, it may be Admin or none or trusted abuser.

TrustedInstaller has a UID as well:
TrustedInstaller:*:4294967294:4294967294:U-NT 
SERVICE\TrustedInstaller,S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464::

Note -- I have seen your number as 'TrustedInstaller' as well the 4294967295 --
so it might be that number.
It should be listed out by mkpasswd -l.

You know after you do a mkpasswd -l
and a separate mkpasswd -D , you combine them in an /etc/passwd -- same for 
/etc/group (w/mkgroup).
That way you get your stuff set whether you log in on a local or a domain account.

Also FWIW -- on my linux machine-- my files are owned by lawgroup as well.





--
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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-10 12:57       ` John Smith
@ 2014-01-10 14:48         ` Max Polk
  0 siblings, 0 replies; 8+ messages in thread
From: Max Polk @ 2014-01-10 14:48 UTC (permalink / raw)
  To: cygwin

On 1/10/2014 7:57 AM, John Smith wrote:
> the None user group won't allow me to change group permissions.  When 
> rsyncing with a remote server, I mirror permissions from that server

Wanting to change file permissions with rsync (or any other command) to 
something you don't have the right to do is a problem rightly solved by 
fixing your user permissions on Windows, and does not constitute a 
problem with rsync.  Something as ambitious as mirroring files plus 
their ownership and permissions does seem to imply elevated 
permissions.  Can this rsync be run as administrator?

--
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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-08 17:49     ` Corinna Vinschen
  2014-01-10 12:57       ` John Smith
@ 2014-01-10 14:32       ` John Smith
  2014-01-11  1:48         ` Linda Walsh
  1 sibling, 1 reply; 8+ messages in thread
From: John Smith @ 2014-01-10 14:32 UTC (permalink / raw)
  To: cygwin

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

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

* Re: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-08 17:49     ` Corinna Vinschen
@ 2014-01-10 12:57       ` John Smith
  2014-01-10 14:48         ` Max Polk
  2014-01-10 14:32       ` John Smith
  1 sibling, 1 reply; 8+ messages in thread
From: John Smith @ 2014-01-10 12:57 UTC (permalink / raw)
  To: cygwin

Hi there,

I wanted to say thanks again for the help. With your advice I was able 
to track it down -- well, the most annoying parts, anyway.  I had an 
editor I was using that did not have all the same permissions assigned 
to it as say, Notepad or Wordpad.  The net effect is that it was somehow 
changing the group back to None every single time it saved a file.  This 
I finally solved by copying the same permissions I saw on Notepad -- 
including a special one entitled "ALL APPLICATION PACKAGES".  So now 
with that application having the above, plus SYSTEM, my account, 
Administrators, and Users, it was able to edit the file without changing 
the group or permissions as we intend.

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

The reason I was having this issue in the first place was because the 
None user group won't allow me to change group permissions.  When 
rsyncing with a remote server, I mirror permissions from that server and 
what was happening was that I had to change my group locally to anything 
else besides None (Lots of this help online, see 
http://stackoverflow.com/questions/9561759/why-cannot-chmod-in-cygwin-on-windows-8-cp 
for one such example) in order to make it accept the permissions for 
groups.  It is aggravating, but such is the way of things currently.

Perhaps there is a way to make cygwin allow the 'None' group to have 
permissions or something to get around this?  That seems somewhat 
dangerous but then again, like you said below, the "None" group really 
is a group -- so I don't know.

I'm going to mess around with changing the group name within Cygwin -- 
perhaps it's just the word "None" that causes this group permission 
problem, and not the id 513.  That seems unlikely but I am going to give 
it a shot anyway.

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

I did mess around with HomeGroup permissions and found they weren't the 
issue.  It wasn't until I changed the permissions to match what I saw on 
another system application (Notepad) that I noticed the ALL APPLICATION 
PACKAGES and the like.  I don't know if that's the particular fix, but I 
just removed all permissions and re-added them, ensuring inheritance was 
*off*, and that seemed to fix the changing group issue, anyway.

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

Ultimately the other tool I used to troubleshoot was to create a new 
user locally, too.  I was trying to debug whether it was the Windows 8 
"live" account that was the issue vs a local account, and found that the 
local account worked fine (well, at least getting rid of the ???????? 
group.  After messing with that, regenerating the /etc/group and 
/etc/passwd files, a reboot, I was able to get my normal account to 
recognize "None" again.  So bizarre.  I am not sure why adding another 
user and regenerating those /group/mkpasswd files fixed the issue, but 
it seemed to.  I must have regenerated those files a dozen times over 
the course of the past week trying to solve this issue.  I wish I could 
tell someone else reading this what the right answer was, but when in 
doubt, reboot after the change.

Hopefully this helps someone else out there.  Thanks so much for your 
help, Corinna, it was vital to tracking down the issue with the 
permissions on the application itself being the issue.



--
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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-08 17:08   ` John Smith
@ 2014-01-08 17:49     ` Corinna Vinschen
  2014-01-10 12:57       ` John Smith
  2014-01-10 14:32       ` John Smith
  0 siblings, 2 replies; 8+ messages in thread
From: Corinna Vinschen @ 2014-01-08 17:49 UTC (permalink / raw)
  To: cygwin

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

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

-- 
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: Windows 8 group won't respect /etc/passwd or /etc/group
  2014-01-08 15:58 ` Corinna Vinschen
@ 2014-01-08 17:08   ` John Smith
  2014-01-08 17:49     ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: John Smith @ 2014-01-08 17:08 UTC (permalink / raw)
  To: cygwin

Hi there,

>>> Yes, of course.  Changing the primary group via /etc/passwd only
>>> works for Cygwin processes and their child processes.  It does not
>>> change the default user token of all processes.  How should that
>>> work, especially since the OS itself doesn't allow to change the
>>> primary group of local user accounts.
>>
>> Interesting -- so we can change permissions via cygwin, (unless
>> we're mounted as noacl) but not groups?
>
> The primary group membership of a file is determined by the processes
> user token at the time of writing a file.  Native processes not started
> by Cygwin processes will have the "none" primary group, unless you're
> a domain user.

I'm not a domain user, just a standard install -- though Windows 8.1 
does ask that we connect our users accounts to their windows live 
service or whatever it is.  Could this be confusing matters into sort of 
being on a domain, but not really?

>> I'm not trying to change
>> the default group necessarily - that would be convenient, of course,
>> but the most frustrating part is that it's changing it *back*.
>
> 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 and say you are not seeing this?

>> 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?  Maybe when I run chgrp, it's someone fooling me 
into thinking it's been changed?  I don't know, until i change the group 
to something like Users, I can't explicitly set the group permissions -- 
so it seems to be working.  But again once I edit that file the group 
reverts to ???? and I lose group permissions again. I don't get it.

>> Optimally I would find a way to change the default created group,
>> but I can survive if cygwin (the OS?) will at least remember the
>> group when I change it to something else.
>
> The OS is Windows.  Cygwin does know the primary group and it won't
> change it at a whim either.
>
>> See, this is why I'm so baffled: I *do* have this group.  It's the
>> last entry in my /etc/groups:
>>
>> None:S-1-5-21-339652832-68357117-3096367938-513:513:
>
> And your account is a local user account, not a domain account?
> If so, the None entry won't be used, and the group information
> is ???? because your real primary group is missing in /etc/group.
> Recreate your /etc/passwd and /etc/group files using
> mkpasswd -l -d and mkgroup -l -d.

I'm not on a domain to my knowledge.  Running mkgroup -l -d gives me 
local groups and then an error trying to connect to a domain:

mkgroup (90): [1355] The specified domain either does not exist or could 
not be contacted.

>>> Except for the 4294967295, which is just a missing entry for "None" in
>>> /et/cgroup, this is normal.  See above.  It's not a problem of the OS or
>>> Cygwin, you're just misunderstanding how this works.  User tokens
>>> are propagated from process to child process.  The parent processes
>>> of any first Cygwin process is a native Windows process with an
>>> unchanged user token, so it has "None" as primary group.  At startup
>>> of the first Cygwin process, it reads /etc/passwd and /etc/group
>>> and changes the primary group in its user token if requested by your
>>> settings.  This changed user token will be inherited by child processes
>>
>> Ah, I see.  So do you know if there is anyway to tell applications
>> to change groups, to avoid this issue of the None/blank/missing
>> group?
>
> I'm thoroughly confused by this question.  This doesn't happen.  You
> seem to be interpreting something you see the wrong way but I can't make
> out what that is, sorry.

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.

> > Do you have any suggestions or thoughts as to why I'm still seeing
>> that group of ??????????? even though "none" exists in my
>> /etc/group?  I was assuming that the default group must be something
>> else, not "None", maybe some virtual group that cygwin can't detect
>> with mkgroup.
>
> mkgroup doesn't print all existing groups, especially not most of
> the predefined groups like "Local", "Createor Owner", etc., see
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa379649%28v=vs.85%29.aspx
> These groups are not used for group membership usually, even if they
> are part of a user token.  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?  I can understand this is the 
hierarchy of permissions, but I don't see a "none" group anywhere --

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?  I'm not sure if that's what this means.  Will that even 
solve the issue?  At this point I don't even care if the group is 
????????? as long as when I chgrp in cygwin, it won't go back to ??????.

Not sure if this helps, but throwing it in for good measure:

cacls cc.txt
D:\xampp\test\cc.txt Whitelancer\HomeUsers:R
                      BUILTIN\Administrators:F
                      NT AUTHORITY\SYSTEM:F
                      WHITELANCER\John:F
                      WHITELANCER\John:R
                      Everyone:R

Thank you for any thoughts you might have.











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

end of thread, other threads:[~2014-01-11  1:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  6:18 Windows 8 group won't respect /etc/passwd or /etc/group John Smith
2014-01-08  9:16 ` Corinna Vinschen
2014-01-08 15:34 John Smith
2014-01-08 15:58 ` Corinna Vinschen
2014-01-08 17:08   ` John Smith
2014-01-08 17:49     ` Corinna Vinschen
2014-01-10 12:57       ` John Smith
2014-01-10 14:48         ` Max Polk
2014-01-10 14:32       ` John Smith
2014-01-11  1:48         ` Linda Walsh

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