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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=XN36q1ombaDiblMf5IzkyUFool24IImceyRvpXJQFcY b2+mOgWC/zIOAZ+gDKrBJ6jJW7QAiWTmByX4E2XONFYaBMgcXF33Ik4yfJFd634D JLMAt+6WqDyetPpyp7T1190gJAIhEustb6XZdhAWNZqIx+9IAFeozI+Q+sAhvvwA = 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=yPdS5IHe0KnbJ96zccYNdygn+fo=; b=oaPrnzwsmSEuWUcxt W2WDah2TarLLAgbjGBAO7lRSsJ6CIvDw5C563fgrwLmwKbqx7VaAUnv9alfr0NAS t4NJCNovoeRmYRfKBHCs8X9viGC3uGAvZ3vrWK7C1iG3ECSUnF8v5GE/Sz3AZyrE seXR4xy0o8xcNwHF2yMOXnh6B8= 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=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f179.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=y6hMkSDCnFtjbscR+JEFf+RoUyEgjICOtxmLq1CW7KU=; b=gCiTdqqTmEf0z4Ll712cyX2HmyXVDyEd1Ed27v8D6O66EuigPu7vDbv2iBXilrRso8 bdTmDrKYfWuWCKIwBuf+Z7pMpvHKWFuBba1JBPGNm+xy30F3WFSlAAHIac9soUDTLXh4 U5nH8yd3fe/MGzzijtZdXc0QcJce8p9hrh5Db7DnKtUIv8NDB1pKTUivGIqSQRFEUETv OiQ7UC7d8rqUyoZFihDz1ArV08UCSlqU1YjCmwMih58ZQapOXH2zqoL+Sfo9QqiZzv2L UWzl9POD9bvvlpM/7UsMOiBevYRWFEAVAZ5Mt+OUokz3s/KD2MZmtXISWVD1jFPVMET9 g1Dw== X-Gm-Message-State: ALoCoQkeKFnvq0EPX3g0BS6b8eqWh7thqX3ESeyceH7Qvwry3QY9h6dH3OaR7zXsI3MRcvne7XCT X-Received: by 10.50.21.2 with SMTP id r2mr33865263ige.13.1389200881254; Wed, 08 Jan 2014 09:08:01 -0800 (PST) Message-ID: <52CD85EC.3090108@whitelancer.com> Date: Wed, 08 Jan 2014 12:07:56 -0500 From: John Smith User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Windows 8 group won't respect /etc/passwd or /etc/group References: <52CD6FF0 DOT 1010309 AT whitelancer DOT com> <20140108155850 DOT GG1336 AT calimero DOT vinschen DOT de> In-Reply-To: <20140108155850.GG1336@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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