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

Hi there,

First, thanks for the detailed reply!!

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

Yes, I understand this part.  And I would be happy to see this group 
show up, but it does not seem to be able to identify "None" as the group.>

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

In *nix, once you change a group, just editing a file won't change the 
group back to something else.  Is there a way to get to this within 
cygwin?

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.

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

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:

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

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

Just tested this, and yes, that definitely works.  OK, thank you for 
this.  It's not the solution yet but it's on the right track.

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.  I just 
can't figure out what group cygwin is detecting it as.  Once I do an 
'ls', cygwin has already tried to map the group and just returns 
'??????' (well, -1 or whatever).  Is there a way to see what group 
cygwin is trying to look up?  If I can detect that it's not defaulting 
to the 'None' group, but some other random group, maybe it's a 
configuration option on the OS level to start using "none" again or 
something?

Thank you so much for your thoughts and help on this.

-J





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