delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/08/05/06:10:21

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=R/qv/KeqzQkNYweg+uMEX0YvgWo8L7MTM/lDqMsz25XD4d0ZYBp3G
g5fhveLurIj5dml7ephEjP/NKHmBUVL/oXM3/t30i7RMogLbrJCuSD7DAuXRb86o
oKznFW65PbNvEl7b3wMpkWjXAVa4cR8J4ZdS9C8BBeerkKsUAEzm0k=
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=FO6tGLo+ORC1dUXSrq47OFg7PW4=; b=vBbLSPpeyE+sRuOf2cwClmhuvJfv
LeH8LihjzSL1+WSCyLp07SM6iHqAoqpOnk/6HfQR/yW8QX9BAnuByQ81/riMbY/U
ctXvksOnuK9zNaZ57gSw8uen8ZM+Je+ORAXK5Zl/USnGvlDMg2/INj6l6IQq3LQ+
VPySHvfFSUlLwLo=
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=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 5 Aug 2015 12:09:52 +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: <20150805100952.GU17917@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> <20150805075435 DOT GP17917 AT calimero DOT vinschen DOT de> <3f1d63803e3546f28d65e0fc7957a204 AT IBTEXCHMB1 DOT ibt DOT kfa-juelich DOT de>
MIME-Version: 1.0
In-Reply-To: <3f1d63803e3546f28d65e0fc7957a204@IBTEXCHMB1.ibt.kfa-juelich.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

--9ToWwKEyhugL+MAz
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Aug  5 09:19, Kiehl, Horst wrote:
> Corinna Vinschen wrote:
>=20
> > The problem the fix was *supposed* to fix (but it didn't) was to disall=
ow
> > incoming $HOME values which are non-POSIX or non-absolute paths.  These
> > $HOME values should be disregarded.
> >=20
> > So the idea was:
> >=20
> >   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
>=20
> The second case, IMHO, *is* an absolute path in the context of Windows:
> C:/foo
> So my assumption as a user would be that Cygwin would use this value for
> HOME in its (cygpath-) translated form: /cygdrive/c/foo
>=20
> This way I could continue to use my Windows profile directory
> (%USERPROFILE%) as my Cygwin home directory (with the definition of
> HOME=3D%USERPROFILE% and the symbolic link /home -> cygdrive/c/Users to
> keep ssh working) as well as e.g. continue to use the Windows port of
> GNU Emacs which consults the HOME variable too.

You can do this anyway by using a matching definition in /etc/nsswitch.conf
(https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch), e.g.:

  db_home: %H

> In other words, if Cygwin would continue to use HOME=3D/cygdrive/c/foo as
> the conversion of HOME=3DC:/foo, this would follow the principle of least
> surprise, IMHO.
>=20
> (Just thinking ... would even the third case (HOME=3D//foo/bar) be a valid
> scenario? Does Cygwin "technically allow" the home directory to be on
> the network? If there is a POSIX-compliant translation of //foo/bar, it
> might be a better choice than ignoring the value.)

That was a typo, sorry.  I was using slashes instead of backslashes
by habit.  //server/share is a valid POSIX path.  \\server\share isn't.

> > 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.
>=20
> On my (somewhat outdated) Cygwin installation, cygpath seems to
> translate relative Windows paths to relative Cygwin paths. If I
> understand you correctly, the conversion done by cygpath is the same
> that Cygwin uses to translate the value of HOME before deciding whether
> the outcome is a valid POSIX path. Wouldn't this already detect a
> relative value of HOME as invalid?

In theory, but not as you describe above.  cygpath has a -a switch.
This functionality is used to convert $HOME.


Corinna

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

--9ToWwKEyhugL+MAz
Content-Type: application/pgp-signature

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

iQIcBAEBCAAGBQJVweDwAAoJEPU2Bp2uRE+gTjMQAIg6uVOeH/op9Z1onDMnb5sE
Ymz0gkRPCsr2DLYzUkR65sq+BygX30ffa3+Ko1xVFn1mzQUXnD39rPnnxr0M46ht
6cAfuP9RAutjuems8TfLS37Xx6I09jnc1k4+89XVBbp4sDM9V0EAE4j0ue5y7jL+
m2AK2r2OXSCnC5Z+41E+E8QCji0+UaOC0fSBJAI65jQVC3hCiHQKSO/TnXq1VW3v
HjmrlUnLyM0/piVLkoRBlwg7n0VBoBOpcmFPw2up6RfA9Px0wsdwXAfgwdHEvHqz
/wzc4XkQPwOuQ5f6l8ZO3rHGUHMOHfchMhCk3kdXoBZ4cY3KP5Sjdzwk4Uc4Qd4W
fTG5CZFvuaRi0A0z1JjtL8Wk9yFaBaFaszZR8jSWpCH+YiJfPIQl8v98GQeVvCBA
7uV78dpWr/hbkfO1KWtwoZFL1s+Y8fpfQX6Lu9Id6c6YV5jL9uuLcXiF4jdO3mwx
Sjf6x3yY6pYYVZ/tDgwO5yDliNedYAet23NGHz/WgqKnmGv0KEi68lDpM0x+N2uJ
IdHgxBQKYOVortYESDiEKiPPP4l0Z/WYWvOW4pTpUJWpDZTO5CgMMS5N/YPBEuG/
DKzhdOK69+U7RNZj8rbLnfCEcLiSBDQ/eR9WRuqXvnS2quLrw1A6UKYrptuz9YgX
oGnSspRWScDXPlOdaVoz
=QmHP
-----END PGP SIGNATURE-----

--9ToWwKEyhugL+MAz--

- Raw text -


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