public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
To: cygwin@cygwin.com
Subject: textmode for stdout, what is "correct" now?
Date: Thu, 14 Feb 2019 16:05:00 -0000	[thread overview]
Message-ID: <739ed5ce-6902-d702-e152-65dc2c1da667@ssi-schaefer.com> (raw)

Hi,

so I find myself struggling with textmode versus binmode for stdio again.

Running the openssl command (from within the apps/ build directory here) does
yield different results regarding carriage return depending on the version:

$ ./apps/openssl version
OpenSSL 1.0.2p  14 Aug 2018
$ ./apps/openssl x509 -hash -noout -in /etc/pki/tls/cert.pem | xxd
00000000: 6139 3464 3039 6535 0a                   a94d09e5.


$ ./apps/openssl version
OpenSSL 1.1.0j  20 Nov 2018
$ ./apps/openssl x509 -hash -noout -in /etc/pki/tls/cert.pem | xxd
00000000: 6139 3464 3039 6535 0d0a                 a94d09e5..

Some subsequent shell script does create wrong symlink filenames
(with embedded CR) when used with openssl-1.1.x.

The commit that changed this behaviour in openssl-1.1 is:
https://github.com/openssl/openssl/commit/bdd58d98467e9f0f6635c1628e1eae304383afb1

From an openssl developer's point of view, I can understand to set
textmode when the intent is to output some text, and to set
binmode when the intent is to output some binary data.

Question now is: These days, what is the correct way to handle this?

Is it up to openssl to not use textmode at all with Cygwin (what if
used from within some cmd.exe?), or is it up to the shell script to
explicitly drop any carriage return here?

Thanks!
/haubi/

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

             reply	other threads:[~2019-02-14 15:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 16:05 Michael Haubenwallner [this message]
2019-02-14 18:51 ` Corinna Vinschen
2019-02-15  9:31   ` Michael Haubenwallner
2019-02-15 10:28     ` Corinna Vinschen
2019-02-15 12:48       ` Michael Haubenwallner
2019-02-15 12:49         ` Corinna Vinschen
2019-02-15 18:25           ` Michael Haubenwallner
2019-02-15 20:35             ` Corinna Vinschen
2019-02-16  9:39               ` Michael Haubenwallner
2019-02-16  9:40                 ` Corinna Vinschen
2019-02-16 17:40                   ` Michael Haubenwallner
2019-02-17  0:11                     ` Corinna Vinschen
2019-02-18 10:01                       ` Michael Haubenwallner
2019-02-18 10:43                         ` Corinna Vinschen
2019-02-18 12:15                           ` Michael Haubenwallner
2019-02-18 13:39                             ` Corinna Vinschen
2019-02-18 15:13                               ` Michael Haubenwallner
2019-02-18 16:04                                 ` Corinna Vinschen
2019-02-15 14:20         ` Andrey Repin
2019-02-15 18:50           ` portable use of dos2unix WAS: " Michael Haubenwallner
2019-02-15 19:14             ` Andrey Repin
2019-02-15 19:43               ` Michael Haubenwallner
2019-02-15 20:50                 ` Andrey Repin
2019-02-15 21:21                 ` Corinna Vinschen
2019-02-18 10:09                   ` Michael Haubenwallner
2019-02-18 10:26                     ` Corinna Vinschen
2019-02-18 13:07                     ` Jeffrey Walton
2019-02-15 21:32                 ` Brian Inglis
2019-02-16  6:09 ` Jeffrey Walton
2019-02-16  9:45   ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=739ed5ce-6902-d702-e152-65dc2c1da667@ssi-schaefer.com \
    --to=michael.haubenwallner@ssi-schaefer.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).