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=YOe+dZGH52KdYa0HnLZATViFHdKMxLrmxXx7SX2CPVC1A9kE5n4UM /T1yNP1WvBb1A4vrZzUEuQcMaeI5M0mub8barWUl/eglrA6JVExqf5XMhzg9JT8u LN/+W4XKDhocKlCJm/k/frc+my6b9WWvIjlU37nkTbMIJVmKLRUdEE= 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=llEn3cNHq9Ckx2yxYsfVPOS/eR0=; b=lMds3jsxg6jnT/U7Dd7FaaF+ZDG6 Hj1ByLIwYk9IApzGjjGZw645ZQHkjedycp+1/trhhLhFRWgjJ1riFjkJuFKDcHar 4D2LJqBY3l6eYVceQ+yMsuIRu9e/QfqjylZgAUHC3891x1hqaUJ+eK3n8qNG+/FX CL2qo+xG94RwvRo= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Wed, 8 Jan 2014 16:58:50 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Re: Windows 8 group won't respect /etc/passwd or /etc/group Message-ID: <20140108155850.GG1336@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <52CD6FF0 DOT 1010309 AT whitelancer DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QNDPHrPUIc00TOLW" Content-Disposition: inline In-Reply-To: <52CD6FF0.1010309@whitelancer.com> User-Agent: Mutt/1.5.21 (2010-09-15) --QNDPHrPUIc00TOLW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 8 10:34, John Smith wrote: > Hi there, >=20 > First, thanks for the detailed reply!! >=20 > >>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----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. >=20 > 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.> >=20 > >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. >=20 > 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 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. > 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. > 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. > >>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. >=20 > See, this is why I'm so baffled: I *do* have this group. It's the > last entry in my /etc/groups: >=20 > 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=20 mkpasswd -l -d and mkgroup -l -d. > >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 >=20 > 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. > >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. >=20 > 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. >=20 > 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=3Dvs.8= 5%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. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --QNDPHrPUIc00TOLW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJSzXW6AAoJEPU2Bp2uRE+gNmAP/jqS5uVzjmRjVGNqEKSqV5Tm SczYId86muAVHs4VyIEHXj2VMklQCsY02F3e6Dw5QzoUDrZPvp1MlBICM6cPnKSi XbVOGYg2BwQonntVL/WalA4uIgDI/+DQuVKADHKixKLQ1Y4GN+jMBLJhEVg0agdb TUVpWMBZver1VQBBI/P4NoBkV0ZzA5BtLk2TrQ6acLVNHKMmBV+T0pY69mQZzF4a JD3N87qqI4JO+YaKEWXqv0BXeifE1PY7Al6wsWLH77W1+wJLa1bBLHUj3GMe5jub 4fF4/WxHKUGcI31+FgXNicNi9UMFf4pscdB3VtxEfnjaclGiRtqF3+a2FB4Gjppd +42+4K3YuhXyrSZIXIqUkJjBvCUkzqQdyGOUQo54N3UuzosSEmS6advplUxAKqGo jjGuWbh55q+lx866OOqz2PlpNJX4GqrlNQJu31QrvG/XlaC1cg4Hby1YQ2aFfbF9 WsJpozQ+mDx4xjVwdpnSwolAkx8owkpPrp47fjVGkmEVuvZ0B3EV2v4aRybJDE0q mYF6Z8FcWChYtMrpCSCiiueuISoDA8S6XIJ3nVqkwwLs6PuK+oGOHAvclu33UjZc 5d1NEK+njL6OSQpKTzhQfXhffAw+9LyuFQHfXveScy0+ZxGAk9JSGw1CXf3eaQVP XUUjb1FwM2a3/tZ0HnjH =oAGG -----END PGP SIGNATURE----- --QNDPHrPUIc00TOLW--