delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/15/07:49: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=el5vfmsG0258+ftLLjpdp+hQnFQwvVUPbyuW0FN61Lk7FYx5ukDZi
5n778xqP6UMPHTxf/Vvn+u5BgKtLrbHvmAk6N25f/HK5ut/HMJZ5h93gNfDp0mib
K+K896f4DoghLySGM3j71e/eKCDJkBfCGnSQtBjQj/XX3+E2nUnovg=
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=yWCeyed/YHNnBtiQvlJgAndfSr0=; b=trCDbjeu6vbg1NXBu2o+5+C8dIlk
J4tL4sNbwBZ/sI0QXyunT8PeUmYcHdNMTAC3rCYUwAuXD13iRUbPkuiEfSc+JEsw
s0lf3u9ztxU6P+1yTL6bWRTQ4WJarDao2llb1cHuwq8grjiTkpcDITeGj+bQ3PLG
K5fuOFYEYiSX5Sg=
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-Spam-SWARE-Status: No, score=-100.9 required=5.0 tests=BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=
X-HELO: mout.kundenserver.de
Date: Fri, 15 Feb 2019 13:48:44 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: textmode for stdout, what is "correct" now?
Message-ID: <20190215124844.GE2702@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <739ed5ce-6902-d702-e152-65dc2c1da667 AT ssi-schaefer DOT com> <20190214162002 DOT GA4950 AT calimero DOT vinschen DOT de> <6aa280c2-4769-0772-91d9-c73a3a3d9680 AT ssi-schaefer DOT com> <20190215102251 DOT GA2702 AT calimero DOT vinschen DOT de> <f7345109-5b22-a342-df1e-940e236c2397 AT ssi-schaefer DOT com>
MIME-Version: 1.0
In-Reply-To: <f7345109-5b22-a342-df1e-940e236c2397@ssi-schaefer.com>
User-Agent: Mutt/1.10.1 (2018-07-13)

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

On Feb 15 13:03, Michael Haubenwallner wrote:
> On 2/15/19 11:22 AM, Corinna Vinschen wrote:
> > On Feb 15 08:56, Michael Haubenwallner wrote:
> >> On 2/14/19 5:20 PM, Corinna Vinschen wrote:
> >>> On Feb 14 16:23, Michael Haubenwallner wrote:
> >>>> Hi,
> >>>> [SNIP]
> >> Down the line in their BIO module they do use setmode(fd, O_TEXT),
> >> which is the one that does introduce the \r, as far as I know.
> >=20
> > This one is not so nice.  Somebody should tell upstream we only
> > want explicit O_BINARY these days, but no explicit O_TEXT.
>=20
> Is this correct even for situations where the cygwin1.dll is used
> outside the Cygwin distribution, like git-bash, MSYS or similar,

This is OpenSSL, not the Cygwin DLL.

> where cygwin-based executables eventually are used from within some
> CMD or PowerShell script? Or should they use unix2dos/dos2unix then?

Only if the \r is really required.  Typically it isn't.

> OTOH, would it make sense to ignore the O_TEXT flag in cygwin1.dll?

That's an interesting idea.  The O_TEXT flag is already ignored in a lot
of cases, e.g. for pipes.  Only when opening files does it have an
effect, mostly.  I'm not sure we should really switch it off.  Maybe we
can consider a CYGWIN env var setting at one point.

> >> The backtrace in openssl-1.1.1a in this use case is:
> >> [...]
> >>>> Question now is: These days, what is the correct way to handle this?
> >=20
> > Telling upstream not to use O_TEXT on Cygwin in the first place, I thin=
k.
>=20
> I can do that, but if I were an upstream developer I would ask questions
> like above...

I sent a patch upstream and questions got asked.  But this is not
a native openssl lib, this is *Cygwin's* openssl lib, and it should
behave like a Cygwin lib.

> > For scripting, d2u should help.
>=20
> Plus, to be portable: type d2u >/dev/null 2>&1 || d2u() { cat; }

For portability, use `dos2unix'.  It's packed with most (all?) Linux
distros.


Corinna

--=20
Corinna Vinschen
Cygwin Maintainer

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

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlxmtSwACgkQ9TYGna5E
T6D3aQ//eOA68LBxnwFmQPnxF3SbkaEa6GEYxg/jskWbGbHvDlukFtWXdvsfB6cf
O4Cdae31Pd4S2aJzxjJBESe/9MpIqiPwB7VZi9PZNSR1Z5HPHX2+paFErbLvxqtu
eRtO1HVG+h32tko/UxDjlZs/FrOmOJREushSROFYlgetVoHgEEOykMQrHQL+8gM1
thXJh2DPhKaJtbobNoTUbMxg1IEK3CYMFHKsaXeySOb1e+v2vyEwqXpHCpOhUcKl
8YKOD9GnMlj9e4KEB9jgE1txsLtk7BG0avfqqvwz0r6BqZja6rxoNdvuSR+gcjaq
Wy/pG7tKrodytIk5VCG4tlPk+56crqkRO9Sd472iSddTEGZMTN0YfJ6WnxoFt0in
GwrCVSk4K85yZuOL556NHVNSIMgT9biSMi47jdKfyWkkGN+9HG7A6ZFj1eHYABjW
6NiTYpn6Ikm+hkNJ1wDgdKBYOYjOrvRuHnAlVrtJYPwbLqJVxbJHUuB53IE9OoJb
6wor+N8rQXLbyrUqbkW7ezNBUXhq+m5rAPPEDXXZKVf3RT4dFuDDS7h/WVwBH95u
1aOq900XT+MRmQojbP6dh6ZNXtyyC4PCtTmDtRNn/Jb3MNs6dgNIjQvcOTZbLAtb
XxwfDG05VNO1jZj/oue2yiSpKTaqFVEFI4t/abl6jaBS1sgidcY=
=2vJB
-----END PGP SIGNATURE-----

--DiL7RhKs8rK9YGuF--

- Raw text -


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