www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/01/28/15:40:53

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=rcFnk8wGyRutFnenZANHYroci8ig6YCADFPHWTufS8HKmaQmgFM9Q
cdeBI3GjXlst06Ss5IMCKuPxlNsKyQaNTQaTgkNRXsgvXmGxrzoFvhE7YL11Fa/u
6Q/D/+xNpaQELEv9kQzlePOBNzJWawW5U6BOW00WZUeAbn8dz6TywE=
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=MJb8H2h8/XcfJRykrT8D/hvvxuo=; b=pnrQy0ePmQNsm4ESKR/ZTLzIH3TU
q91QaMZrhOGJRYVUWdlM60Dw9gnpLxbGjgRr0vebOQaqOD3OvxXHa8k21UkiU26a
38BDV+mTkRwahqkcrwaORQVDUqJuXGB1vzNHu0SbCvSgj+WDlkg55mVP32gptxL1
tW+z79QqvRCkjDk=
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=-96.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=H*r:sk:calimer, Hx-spam-relays-external:sk:calimer, publish, HX-HELO:sk:calimer
X-HELO: calimero.vinschen.de
Date: Thu, 28 Jan 2016 21:40:21 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: chmod failed: Invalid argument
Message-ID: <20160128204021.GA7055@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <trinity-f5aca8d9-16f5-41e1-a521-60beada36d8e-1453991058087 AT 3capp-gmx-bs39> <20160128144429 DOT GC27369 AT calimero DOT vinschen DOT de> <trinity-1207f321-8a47-46bf-99f9-9c2eb5b08d91-1453997213459 AT 3capp-gmx-bs39> <20160128172256 DOT GB18626 AT calimero DOT vinschen DOT de> <trinity-7ee91fc7-9323-4efa-bbe7-b3420e77c824-1454006627384 AT 3capp-gmx-bs39>
MIME-Version: 1.0
In-Reply-To: <trinity-7ee91fc7-9323-4efa-bbe7-b3420e77c824-1454006627384@3capp-gmx-bs39>
User-Agent: Mutt/1.5.24 (2015-08-30)

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

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:
> > > > On Jan 28 15:24, Rainer Blome wrote:
> > > > the acl should always at least contain ACEs for the
> > > > default POSIX perms, plus a NULL ACE:
> > > >=20
> > > > foo NULL SID:(DENY)(Rc,S)
> > > >     VINSCHEN\corinna:(R,W,D,WDAC,WO)
> > > >     VINSCHEN\vinschen:(R)
> > > >     Everyone:(Rc,S,RA)
> > >=20
> > > In Windows Explorer -> `bar` -> RMB -> Properties -> Security ->
> > > Advanced, I am told that it inherits ist permissions from `base`,
> > > the parent of `bar`. (To be precise, it inherits from its
> > > grandparent, but I assume that the length of the ancestor chain is
> > > not important here.)
> >=20
> > This means the permission have been inherited when creating the
> > file but Cygwin couldn't overwrite the ACL with a POSIXified variant
> > for one reason or another.  It might have to do with this mysterious
> > group 213...
> >=20
> > > > For directories also inheritable default perms for "CREATOR OWNER" =
and
> > > > "CREATOR GROUP".  Is that really a Cygwin mkdir?!?
> > >=20
> > > As far as can see, yes, see above.
> > >=20
> > > > And then, what about
> > > > this unknwon group with gid 213?  What does
> > > >=20
> > > >   $ getent group 213
> > > >=20
> > > > print?  Something's weird here...
> > >=20
> > > getent group 213; echo $?
> > > 2
> >=20
> > Ok, that's not exactly helpful to analyze this problem.  Can you try
> > running another strace
> >=20
> >   strace -o getfacl.trace getfacl <file>
> >=20
> > on a file which has supposedly that group as owning group, e.g.  your
> > "base" dir?  We might have a chance to look at the SID of group 213 in
> > there.
>=20
> That command segfaults, just as `strace : ` does.
>=20
> > 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?
>=20
> 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.)

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

2) *iff* they are there, there's good reason to have them in a good
   working shape.

> When I rename the file and open a new Cygwin terminal, things start
> to work. `strace echo` yields the expected output, `chmod` does
> what it's supposed to do, and `git config`, `git init` and `git
> clone foo foo2` work as well.
>=20
> 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.=20
See the extensive documentation starting at
https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch
The default homedir is /home/<USERNAME>.  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

> If, after this "breakthrough", there is still value in looking
> further into the ACLs, I am willing to do that. However, the strace
> output looks awfully laborious to sanitize, so I can not do this
> today.

There's not much to sanitize usually, a few env variables you don't like
to publish, that's all.  Other than that, it might not be required
anymore to generate the strace at all.  Writing this mail is my last
action for today aswell, at least :)

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


Corinna

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

--vtzGhvizbBRQ85DL
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWqny1AAoJEPU2Bp2uRE+gYqQP/1rFgUoP+qJXJqCuWPAd3VZ3
IL3jmULPzytijwxBMOdmqD+nsMWqHzyjCFpu3Wt3cis+8UO4ohZvgYOsQZTdUnjC
I2LLEJ4BMnfcK0gSCozI9vjvXFlgbvhGsIVubxyfPgGZU8ij2uk0danXHhDirgCE
oUu/uw3FSkRZFOL5fC6UcNfVl7rE8ybTrQR/fVAicjDdM36VAeoQeZKGIlPeHmKb
dc+1s7Ie0ZWyonsEzSFR9l7/qwEu8IqFypprokeAuQZUX1G57oQoKrISozxTRfHb
F9o2FJVzaZNwsrVxkkHpt4f7k0lvwz38ZZCWnJMM58GDF8ADcC3esbV54hTbP+Wr
sIzrv3m/Zn3h1ycPotSbDmRvEp9JdklXr5Fgd/hb0rYVqBiaEwdAlLCX0jw/jVPL
4pEwoTmRR7wepw+NKSBmWSv1hASwf9r/Za8/wqh9d3LYGneRgKiZwy36jMXtyPFb
/ZhwRq0GH5RIsSgIQHWOpzbcZqHaUAYg1ykfO/lebhK+v4MLAoCYPPgx1Zd2hVDd
yQ8hztoP3LrMMD0GxWeM9zgaV1p5bNk/Eerz8tpNmofhMcKNrcP39qX18PqaQ2N6
6nykc77EL41mbFn1YKVZPu/YNkr+Fr1CsOp5iXbSXp2PRVD1AOfc6Djuhc5drZha
LMFYmMhBv+0jtTREm+M5
=4YcH
-----END PGP SIGNATURE-----

--vtzGhvizbBRQ85DL--

- Raw text -


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