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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=yC7g3G4CIyj6Hc3m 4TO98vej+fWvAY/Y1Tt9ndUj6uLMPg7m69aj5j1SK9P2/U4BHinQlO4O+ehO9BS6 rkz/ETy6DBbcYRjC0lQYrnIroEIVFkvIvyiea4/IMOFtrX+T0BD2i9uBvwY1Zh/L d12itJMXN9s2hxiG+tMnvEL2gzE= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=V2xS+N6K0Ogq/CL06f4dZj g20sc=; b=iK+ZAhdFxdLHmz4F5/l0p58ZzSB5aDQOIFRm7t9zRCGMpt81jvJs8y am9mlRRZqdykGMHC0HHD/w/ynoaakdKqBxYL8xjaVp1EkS0KLfXFdTItlHNOIKTt rvR0PxWX/AKBNRbCyYYUK6JR6wWwxZIKlbkqSmUVaWLl5NmiejAMs= 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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Groups, H*Ad:D*gmx.de, determining, now X-HELO: mout.gmx.net Subject: Re: chmod failed: Invalid argument To: cygwin AT cygwin DOT com References: <20160128144429 DOT GC27369 AT calimero DOT vinschen DOT de> <20160128172256 DOT GB18626 AT calimero DOT vinschen DOT de> <20160128204021 DOT GA7055 AT calimero DOT vinschen DOT de> From: Rainer Blome X-Enigmail-Draft-Status: N1110 Message-ID: <56AE6D83.9070201@gmx.de> Date: Sun, 31 Jan 2016 21:24:35 +0100 MIME-Version: 1.0 In-Reply-To: <20160128204021.GA7055@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-UI-Out-Filterresults: notjunk:1;V01:K0:9Eff4Ir9Lio=:QOU1fknTUlgByuaM6ePDU6 oULn6+nfvXXtXD+fevEp4KAx71mErUrHD7bcUyUw/WZRR9yonS/jPCWJz7MAt0DRCCFN3JrTi vZjrRq8OuLhVF2MgZKcDjedDWYL8xtHO2qloPSpYNZD9YYBtTfeTfOaR3XGv/ehJoj7KhfJ+R kCROHk20NoI3DUmFyfHrBQlUuHVQmUJn9V11e4lYLlmiKTBs0HU+cZw8QQ06S9hejKRrDOQmz t4nQS3y89Zb0hgIEKmuMMj1gXRZ6khYy75xxeKcdrJczq5hVsxwUDVri+SnOwyjdXx3JEG5zM lMv/az2X6ktydwC7yeDcz5b0Dfqeo61cNO2iUua7F+UdNP0mhUriCW+JHgiF9qYE2U7rnoFkT tkldJXBfUYl0w78XaXA2eSow2snbCRAuDHGpeePJ0bNV3bw8cJb/NCOXNih/qC2dp8IzgtWfx ccjh4fUNGG5033AuDbjUg/Fq17U3jpDArvkCGmWAJwkJxiBpbK+jSudrO6Yoj3oAApT7RgPrl dPXgZSMwZeA29cGkuZFS77oX276K7CyOpDATPv86hM8ZcqPMszLhhOBx8F/Y1M9+5r8YkGSTW B3yCoUxpNHk67bYMSrf2d6lDvmhQgDScxe3PHK8aNm0tFE4PsFWj3tRrsqw7duWVvAuc/PgKW e39ipISXwF6GjYL7oNRvChwi+WTXPBQTR2l0WIMBIo5YNdFNC80t/euWTKz1mWFB3UolyCBvq dEVbrUOrze/lAQx/7O13aX981Yi6o6SMPsn1Gnn27UeUU3jZ+k4PGspTlBOYbwYtf5e0o9JrD AmX0BZQ X-IsSubscribed: yes On 28.01.2016 21:40, Corinna Vinschen wrote: > On Jan 28 19:43, Rainer Blome wrote: >>> Corinna Vinschen wrote 2016-01-28 18:22: >>>> On Jan 28 17:06, Rainer Blome wrote: >>>>> Corinna Vinschen wrote 2016-01-28 15-44: And then, what about >>>>> this unknwon group with gid 213? What does >>>>> >>>>> $ getent group 213 >>>>> >>>>> print? Something's weird here... >>>> >>>> getent group 213; echo $? # getent prints nothing, returns 2 >>>> >>> On a hunch, do you have old /etc/passwd and /etc/group files by >>> any chance? Does moving them out of /etc (don't delete them for >>> now!), exiting from Cygwin and starting a new shell somehow fix >>> things for you? How do the files look like? >> >> Define "old"! ;-) Yes, I do. There is no `/etc/group`, but >> `/etc/passwd` defines the group ID of my user as 213 (the real ID >> is a bit different, to be honest, but I do not think that >> matters.) The real group ID is 513, by the way. On a Cygwin 2.3.1 on a different machine, `/etc/passwd` also has 513 in the group column of all users. Yet, when I ask for `id`, I get something like this (translated): uid=197609(username) gid=197121(None) \ Groups=197121(None),545(Users),... > Ouch, that may be the reason. I have to check that but your passwd > and group files are > > 1) Not required anymore, see > https://cygwin.com/cygwin-ug-net/ntsec.htm, and Well, I do not use Active Directory, and I try to maintain a stable home directory across new machines, drives or Windows reinstalls, so I specify this directory in `/etc/passwd`. Since it is small, I see no harm in using this method. On my Cygwin 2.4.1, to get things to run the way I want them, I renamed `/etc/passwd.renamed` back to `/etc/passwd`, and replaced the old group id by the ID of group "None", 197121. In a new terminal, things now run as expected, SSH finds its .ssh directory and `chmod` etc. work the way that they should. > 2) *iff* they are there, there's good reason to have them in a good > working shape. No doubt. So what kind of maintenance do these files need? Should I have known that they do? >> The `git clone repo:bar` then fails because my `~/.ssh` is >> apparently no longer found (and I can only log in via SSH key). >> This is a bit surprising, because in the new terminal, `$HOME` and >> `~/.` are still set the way I specified it in the old `/etc/passwd` >> (now with extension `.renamed`). So some programs apparently use >> one method of determining the home directory, and others use a >> different method. I will look into that tomorrow. > > Yes, indeed. Ssh ignores $HOME and it does so as long as it exists. > Ssh uses the pw_dir field from your passwd entry and that in turn is > determined by /etc/passwd if it exists, or by /etc/nsswitch.conf. See > the extensive documentation starting at > https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch > The default homedir is /home/. There are a few knobs to > play with to change this setting, see > https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-home In the User-specific Windows environment variables, `$HOME` was set, so that most programs still saw that. To simplify, I removed that setting, hoping I did not use it in some Windows batch file. :-) >> If, after this "breakthrough", there is still value in looking >> further into the ACLs, I am willing to do that. > it might not be required anymore to generate the strace at all. Then I'll skip that for now. Maybe a bogus group setting in `/etc/passwd` is enough to reproduce the issue. >> Thanks for the help so far. > > Thanks for *your* help. I expect there are still a few problems in > that code since not even a multi-month testphase finds all problems. I am curious what change triggered the issue, can you point me to a commit or change-log entry? Rainer -- 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