delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/08/05/03:54:57

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=AE2Spg3+LnyoQqm3jxhOPQJe2hplcbSbUN0FJipSDL/VrUnonSpAK
yqjxfBWY6UioNRUvX2nqvDlSzOBzpRyM4wmnw+o0/LftFyEHLvltU1O2a3zfEooF
QDvyZCVEoWssn56v7SqIm06Oi5j7ptxKianb9A2TU47YtIYr9FIKI8=
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=hDhZ+Njskqfjz9URr+gnmash4SU=; b=RTGRcYh55yLPHyq59a+ix/sxyIix
nExTGfEewueQxsVg8qeIV5ogjgIsqeLuWC8+lJ+eFJ8aoLKLXJAh1tetJGjoJJL9
lA05gQwf2CPcOnoyubei3bvNLUk6ci/FECyyK1NqdjiJesTXHPECwEQHUY+2Lfm3
cxDw57glkVGRg0g=
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=-4.5 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 5 Aug 2015 09:54:35 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated: Cygwin 2.2.0-1
Message-ID: <20150805075435.GP17917@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 20150803131950 DOT GA18878 AT calimero DOT vinschen DOT de> <55BFB64C DOT 1010802 AT towo DOT net> <20150803192940 DOT GA19315 AT calimero DOT vinschen DOT de> <loom DOT 20150804T094839-714 AT post DOT gmane DOT org> <895515CC-6BB7-41E7-AEA5-30FBBE071153 AT etr-usa DOT com> <87wpxac2bj DOT fsf AT Rainer DOT invalid>
MIME-Version: 1.0
In-Reply-To: <87wpxac2bj.fsf@Rainer.invalid>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

On Aug  4 20:53, Achim Gratz wrote:
> Warren Young writes:
> > Here=E2=80=99s an interesting experiment to try on your non-Cygwin POSI=
X boxes:
> >
> >     $ HOME=3D/dfjkshkds bash -l
> >     $ echo $HOME
> >
> > Guess what it prints.
> >
> > Hint: It isn=E2=80=99t the second-to-last field in /etc/passwd. :)

This is correct behaviour, of course.

> > Spoiler: Apparently Cygwin is already doing the standard thing.

No, it's not.  Or, to phrase it a bit differently, it doesn't perform
thr action it was supposed to do.  My testing seemed to be a teeny bit
half-hearted...

The problem the fix was *supposed* to fix (but it didn't) was to disallow
incoming $HOME values which are non-POSIX or non-absolute paths.  These
$HOME values should be disregarded.

So the idea was:

  set HOME=3Dfoo		<- ignored, set HOME from passwd DB entry
  set HOME=3DC:/foo	<- same
  set HOME=3D//foo/bar	<- same
  set HOME=3D/foo/bar	<- valid, taken

Right now, when started from a non-Cygwin process, Cygwin takes the
value of $HOME and simply calls the Win32->POSIX conversion function.
It does so for a long time, but is that right?  Especially if %HOME% is
a non-absolute =3D=3D relative path, the resulting POSIX value of $HOME
depends on the current directory when starting Cygwin.

This sounds like a terrible idea to me.  Together with cases like
https://cygwin.com/ml/cygwin/2015-07/msg00344.html, and the fact that
$HOME has no meaning in native Windows (HOMEPATH/HOMEDRIVE instead) I'm
inclined to think that any incoming $HOME should make sense from a POSIX
POV, otherwise we take the value from the passwd DB as defined by
/etc/nsswitch.conf.

Does anybody have a *good* reason *not* to change this?

> That's why I offered to ignore the issue.  That also needs nothing to be
> done by me, which is an added benefit.  :-)

That may be the way to go as soon as Cygwin is doing the right thing :}


Corinna

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

--N8ia4yKhAKKETby7
Content-Type: application/pgp-signature

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

iQIcBAEBCAAGBQJVwcE7AAoJEPU2Bp2uRE+gGCcP/RK38veNJvHhMTSnHs0GkUtb
Gspzr1NMzzWE7jIrSXYsfK55wjXFzBZ2k2o/znbta5tbVnVKjW/y2pKMXmfZQslE
ssW8WSLiZhRnkG8N6IlEeJEKKIgTDGOTyUPOSBc0qPiuYJQTczghXgErXo6clNvM
bKHS+pj5O59WAWdgrSUagEWfCOtTNGShpHVbOrfFt5qWLmoUF6Ev6qzLehGOx0b2
1ybsoLol6tRLBiMRL/SgunRGOStPrjw1rsOsn0/Kt0sq/jNf7uPoDj5AtQcw03jW
mSFmQzBU/7ij1Qe6yB6PUaSjRLxfjL1DmZJXZoRnokwYOXBrUpzBb1ZKpBTTDhML
azve8FqoibaSgwWLUdHIkRLPxvDo4ONBEShjFgqEuTzKpnPCnjt8HbdMdhjNsSVu
MRAO1IVmN9uCPKK6EX3PviYV8kIFFfWi4Pisj3LcIzu2rDxr1hv+EJCcfQ3KAfaY
h1CdhPBclC3R+wWd3aYgiMomJeABc4wYTQsHVcseC8p6GjL8EpqsXw3dOW5vcWD0
/HzoleKwKlQT8Va9+uk0U0MGneyExDRYkefkVfY0LU7Gkzdy9abFspaD/ZKZ50tU
sTG92fxKcRTeRmx5bLyZZcTQOfF09UOmapk1saupTI7PjIyhJxdT82+mQnDW/N96
059tuePcTZ1+9v4nVgjk
=mlkl
-----END PGP SIGNATURE-----

--N8ia4yKhAKKETby7--

- Raw text -


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