delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/08/04:17:04

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=Y3xoTUZ7Kp+LJMiRSJiaG3/MG0QcMXs031pg/LufEbsxElzYe9BM/
+PV4Zqun/3IeWMYRuMwEv49Z15dnWRN2rWw9saKCqO5Ac67QKN4TapLEvySGbW+9
f7+FqGrovUtpJi0QCJ5FXP7XiImTuUF0hbp9VU08VEnc3vt3tcY7as=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=521Ufld9NdbGBQ5CGEM38Jp4ZI4=; b=alfoysIvH76OKcdPU3yhOUxWEhYr
155kT3D0LiR2DaCrVuBfAGUIQ8SjLOLTnr5VkfW669VkX9T4rgXkh7fs/ctNLvPL
IYC/eBXwCXxv/C+dCH8z5YKhsEhZQDORW+tNZ9c7Vet9+6BtFdkNs+1OAYC6mooq
NMXNb7ldvkyDkJc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 8 Jan 2014 10:16:41 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Windows 8 group won't respect /etc/passwd or /etc/group
Message-ID: <20140108091641.GA28847@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <52CCEDAC DOT 60609 AT whitelancer DOT com>
MIME-Version: 1.0
In-Reply-To: <52CCEDAC.60609@whitelancer.com>
User-Agent: Mutt/1.5.21 (2010-09-15)

--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

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

--+QahgC5+KEYLbs62
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJSzRd5AAoJEPU2Bp2uRE+geoAP/A67B7dLQM70rEoCBX/SPRbY
dkBvoDjjgQzQmfpt+UGegwRu7qjhagH232zm7mNy86wUE0kKa4vMoEJDo1yWDGAU
78x3SGoP7Wo8U1oBo/ryorXXJN7NKDtRGhrCcQgcQ0HRCStWzxT+mOXnWJUu+QMb
hQsWT/eJY2tZzTDAssbmXBUS3nGPcXZvV1HVPlIhaUqbrEILCwL6SBoWSPtoOgrw
JKB+TXdVvkl3BR5Ifg2zCaruztMrOAuoRj1/hXMFrkykSiIYuzcYLQBcOKSE/26V
PeoVupc95JFzVwdX4c+uBmHiuIKNkP8wC8SFwHb67YpcIFvBj0KoP9QlejzPSvnO
M349wPhIMqxh3lbsx8XSw8Zlrz01LbMs45j86yHOnLyrKD2pvjBPqVrhspIuLy1+
CYqvmAaMti7mkLaFmkqklUPp1tg90y72nCilkayr1+MdzdY2T49FaDrBsEAOmd0Q
AD2ONwsuG166ifCu1NWrs6IyyKQDnKeIj+cUJn954D+yfMpeWyIGgkCOuUwo79vD
IwxRfS8n4PsgLqBJoAj4QqyKOwiUyxBgXdIaElcpKYxcYw+9eWj6Yr6QTV49DBja
CZPuMoWDLDh3Kt/eMBwWXp6NK07q9n+YdzPoOgVyMowHl8hKjJy9kbId8RKurcOd
H1U7Q+qhgGldo3akf3uG
=zeid
-----END PGP SIGNATURE-----

--+QahgC5+KEYLbs62--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019