GNU bug report logs - #42059
26.3; OpenBSD now has posix_openpt(3)

Previous Next

Package: emacs;

Reported by: YASUOKA Masahiko <yasuoka <at> yasuoka.net>

Date: Fri, 26 Jun 2020 13:42:01 UTC

Severity: normal

Found in version 26.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42059 in the body.
You can then email your comments to 42059 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Fri, 26 Jun 2020 13:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to YASUOKA Masahiko <yasuoka <at> yasuoka.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Jun 2020 13:42:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; OpenBSD now has posix_openpt(3)
Date: Fri, 26 Jun 2020 18:52:55 +0900 (JST)
OpenBSD now has posix_openpt(3), emacs should use that.
A diff is attached.

Currently emacs uses an old way which actually causes a problem.  I am
using gnupg through Mew(*1) which run on emacs, Mew seems to create a
process without a pty regardless it specifies "process-connection-type
pty" properly.  The pty is required to pass the passphrase.

*1) http://mew.org/


--- configure.ac.orig	Fri Jun 26 18:33:33 2020
+++ configure.ac	Thu Aug 22 07:25:23 2019
@@ -4620,11 +4620,11 @@ case $opsys in
     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
     ;;
 
-  gnu | qnxnto )
+  gnu | openbsd | qnxnto )
     AC_DEFINE(FIRST_PTY_LETTER, ['p'])
     ;;
 
-  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | openbsd | netbsd | darwin | nacl )
+  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
     dnl if HAVE_GRANTPT
     if test "x$ac_cv_func_grantpt" = xyes; then
       AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])


Configured using:
 'configure --build=amd64-unknown-openbsd --without-sound
 --with-x-toolkit=gtk3 --prefix=/usr/local --sysconfdir=/etc
 --mandir=/usr/local/man --infodir=/usr/local/info
 --localstatedir=/var --disable-silent-rules --disable-gtk-doc
 'CFLAGS=-O2 -pipe -g -fno-pie' CPPFLAGS=-I/usr/local/include
 'LDFLAGS=-L/usr/local/lib -nopie -g''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK DBUS GSETTINGS GLIB NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM THREADS LCMS2

Important settings:
  value of $LC_CTYPE: ja_JP.UTF-8
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: 
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug message rmc puny seq byte-opt gv bytecomp
byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec
password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils misearch multi-isearch anthy-conf
anthy-dic anthy vc-git diff-mode easy-mmode pp qp mew-varsx mew-unix
mew-auth mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp mew-pop
mew-smtp mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib
mew-ext mew-refile mew-demo mew-attach mew-draft mew-message
mew-thread mew-virtual mew-summary4 mew-summary3 mew-summary2
mew-summary mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq
mew-smime mew-pgp mew-header mew-exec mew-mark mew-mime mew-edit
mew-decode mew-encode mew-cache mew-minibuf mew-complete mew-addrbook
mew-local mew-vars3 mew-vars2 mew-vars mew-env mew-lang-jp mew-mule3
mew-mule mew-gemacs easymenu mew-key mew-func mew-blvs mew-const mew
elec-pair edmacro kmacro cl-loaddefs cl-lib time-date mule-util
japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
threads dbusbind kqueue lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 166712 13664)
 (symbols 48 26580 2)
 (miscs 40 396 845)
 (strings 32 50253 1145)
 (string-bytes 1 1271766)
 (vectors 16 22102)
 (vector-slots 8 838358 23398)
 (floats 8 79 319)
 (intervals 56 3324 0)
 (buffers 992 16))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Sat, 27 Jun 2020 03:57:02 GMT) Full text and rfc822 format available.

Message #8 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
To: 42059 <at> debbugs.gnu.org
Subject: Re: 26.3; OpenBSD now has posix_openpt(3)
Date: Sat, 27 Jun 2020 12:56:42 +0900 (JST)
On Fri, 26 Jun 2020 18:52:55 +0900 (JST)
YASUOKA Masahiko <yasuoka <at> yasuoka.net> wrote:
> OpenBSD now has posix_openpt(3), emacs should use that.
> A diff is attached.
> 
> Currently emacs uses an old way which actually causes a problem.  I am
> using gnupg through Mew(*1) which run on emacs, Mew seems to create a
> process without a pty regardless it specifies "process-connection-type
> pty" properly.  The pty is required to pass the passphrase.
> 
> *1) http://mew.org/

The patch I sent previously was reversed.  Let me update it.

--- configure.ac.orig	Thu Aug 22 07:25:23 2019
+++ configure.ac	Fri Jun 26 18:33:33 2020
@@ -4620,11 +4620,11 @@ case $opsys in
     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
     ;;
 
-  gnu | openbsd | qnxnto )
+  gnu | qnxnto )
     AC_DEFINE(FIRST_PTY_LETTER, ['p'])
     ;;
 
-  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | netbsd | darwin | nacl )
+  gnu-linux | gnu-kfreebsd | dragonfly | freebsd | openbsd | netbsd | darwin | nacl )
     dnl if HAVE_GRANTPT
     if test "x$ac_cv_func_grantpt" = xyes; then
       AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.])






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Tue, 30 Jun 2020 11:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
Cc: 42059 <at> debbugs.gnu.org
Subject: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Tue, 30 Jun 2020 13:52:21 +0200
Thanks for the patch! I'd be happy to apply it, but first: can you confirm that older OpenBSD versions are still able to build Emacs with that patch applied, or argue that this is a lesser problem?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Tue, 30 Jun 2020 13:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
To: mattiase <at> acm.org
Cc: 42059 <at> debbugs.gnu.org
Subject: Re: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Tue, 30 Jun 2020 22:49:29 +0900 (JST)
On Tue, 30 Jun 2020 13:52:21 +0200
Mattias Engdegård <mattiase <at> acm.org> wrote:
> Thanks for the patch! I'd be happy to apply it, but first: can you
> confirm that older OpenBSD versions are still able to build Emacs with
> that patch applied, or argue that this is a lesser problem?

Although old versions might become not able to build Emacs with the
patch, I suggest Emacs should have the patch.

Firstly the versions are too old.  posix_openpt(3) had been introduced
to OpenBSD at OpenBSD 5.3, it was 7 years ago and 14 versions before
the latest.  It was 6 years ago when the last version which doesn't
have posix_openpt(3) became out of support.

Secondly the old way the old versions is using has another problem. It
caused an error when emacs opens some ptys.  To solve this problem, in
any case, people need to use newer OpenBSD and newer Emacs.

Thanks,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Tue, 30 Jun 2020 14:26:02 GMT) Full text and rfc822 format available.

Message #17 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 42059 <at> debbugs.gnu.org
Subject: Re: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Tue, 30 Jun 2020 16:24:55 +0200
30 juni 2020 kl. 15.49 skrev YASUOKA Masahiko <yasuoka <at> yasuoka.net>:

> Although old versions might become not able to build Emacs with the
> patch, I suggest Emacs should have the patch.
> 
> Firstly the versions are too old.  posix_openpt(3) had been introduced
> to OpenBSD at OpenBSD 5.3, it was 7 years ago and 14 versions before
> the latest.  It was 6 years ago when the last version which doesn't
> have posix_openpt(3) became out of support.
> 
> Secondly the old way the old versions is using has another problem. It
> caused an error when emacs opens some ptys.  To solve this problem, in
> any case, people need to use newer OpenBSD and newer Emacs.

Thank you for the detailed explanation, and I think applying your patch will be all right -- 7 years is a long time in the security-conscious OpenBSD world. It would probably need an update to the NEWS file, though.

Eli, do you have any objection to the patch by Yasuoka-san, assuming that it limits the OpenBSD support to version 5.3 or newer?
Presumably the patch would be for Emacs 28, unless there are strong security/reliability reasons for Emacs 27.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Tue, 30 Jun 2020 14:33:02 GMT) Full text and rfc822 format available.

Message #20 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
Cc: mattiase <at> acm.org, 42059 <at> debbugs.gnu.org
Subject: Re: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Tue, 30 Jun 2020 17:32:01 +0300
> Date: Tue, 30 Jun 2020 22:49:29 +0900 (JST)
> From: YASUOKA Masahiko <yasuoka <at> yasuoka.net>
> Cc: 42059 <at> debbugs.gnu.org
> 
> On Tue, 30 Jun 2020 13:52:21 +0200
> Mattias Engdegård <mattiase <at> acm.org> wrote:
> > Thanks for the patch! I'd be happy to apply it, but first: can you
> > confirm that older OpenBSD versions are still able to build Emacs with
> > that patch applied, or argue that this is a lesser problem?
> 
> Although old versions might become not able to build Emacs with the
> patch, I suggest Emacs should have the patch.
> 
> Firstly the versions are too old.  posix_openpt(3) had been introduced
> to OpenBSD at OpenBSD 5.3, it was 7 years ago and 14 versions before
> the latest.  It was 6 years ago when the last version which doesn't
> have posix_openpt(3) became out of support.

Would it be possible to contact the OpenBSD developers and/or the
persons who prepare the Emacs distros for OpenBSD, and ask for their
opinion about this?  I mean, I wouldn't want to drop support for some
versions of an OS without at least consulting the relevant developers.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Tue, 30 Jun 2020 15:38:01 GMT) Full text and rfc822 format available.

Message #23 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: yasuoka <at> yasuoka.net, 42059 <at> debbugs.gnu.org
Subject: Re: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Tue, 30 Jun 2020 18:36:59 +0300
> From: Mattias Engdegård <mattiase <at> acm.org>
> Date: Tue, 30 Jun 2020 16:24:55 +0200
> Cc: 42059 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> 
> Thank you for the detailed explanation, and I think applying your patch will be all right -- 7 years is a long time in the security-conscious OpenBSD world. It would probably need an update to the NEWS file, though.
> 
> Eli, do you have any objection to the patch by Yasuoka-san, assuming that it limits the OpenBSD support to version 5.3 or newer?
> Presumably the patch would be for Emacs 28, unless there are strong security/reliability reasons for Emacs 27.

As I wrote, I'd prefer to hear the opinions of OpenBSD maintainers, if
possible.  I don't feel we know enough about that OS to make such
decisions on our own.

Alternatively, adding a compatibility feature whereby it would be
possible to build Emacs on OpenBSD without this change, would allow us
to go ahead even without asking the OpenBSD folks.

IOW, I don't want to drop support of old OpenBSD versions so easily.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42059; Package emacs. (Wed, 01 Jul 2020 11:26:02 GMT) Full text and rfc822 format available.

Message #26 received at 42059 <at> debbugs.gnu.org (full text, mbox):

From: Jeremie Courreges-Anglas <jca <at> wxcvbn.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mattiase <at> acm.org, YASUOKA Masahiko <yasuoka <at> yasuoka.net>,
 42059 <at> debbugs.gnu.org
Subject: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Wed, 01 Jul 2020 13:23:12 +0200
[Message part 1 (text/plain, inline)]
Hi,

jca <at> OpenBSD.org here, I'm the maintainer of the GNU Emacs port in the
OpenBSD ports tree[0].

I can confirm what Yasuoka-san wrote, the OpenBSD project only provides
some kind of support for the two latest OpenBSD releases[1].  We highly
discourage the use of old OpenBSD releases.

As the maintainer of the Emacs port, OpenBSD 5.3 and older releases are
completely out of scope.  I mostly care about our development branch, if
security fixes in Emacs need to be adressed in our stable releases,
I would probably handle them as patches backported from newer Emacs
versions, not as updates to newer Emacs versions.

So as far as I am concerned the proposed change can land in any upcoming
Emacs release, the sooner the better.  Since Yasuoka-san is also an
OpenBSD developer he has already pushed this change in our Emacs port[2]
with my approval.  Many thanks to him!


[0] https://cvsweb.openbsd.org/ports/editors/emacs/Makefile?rev=1.94&content-type=text/x-cvsweb-markup
[1] https://www.openbsd.org/faq/faq5.html#Flavors
[2] https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/emacs/patches/patch-configure.diff?r1=1.17&r2=1.18&f=h
-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
[signature.asc (application/pgp-signature, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 01 Jul 2020 14:25:01 GMT) Full text and rfc822 format available.

Notification sent to YASUOKA Masahiko <yasuoka <at> yasuoka.net>:
bug acknowledged by developer. (Wed, 01 Jul 2020 14:25:02 GMT) Full text and rfc822 format available.

Message #31 received at 42059-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jeremie Courreges-Anglas <jca <at> wxcvbn.org>
Cc: mattiase <at> acm.org, yasuoka <at> yasuoka.net, 42059-done <at> debbugs.gnu.org
Subject: Re: bug#42059: 26.3; OpenBSD now has posix_openpt(3)
Date: Wed, 01 Jul 2020 17:24:22 +0300
> From: Jeremie Courreges-Anglas <jca <at> wxcvbn.org>
> Cc: YASUOKA Masahiko <yasuoka <at> yasuoka.net>, mattiase <at> acm.org,
>         42059 <at> debbugs.gnu.org
> Date: Wed, 01 Jul 2020 13:23:12 +0200
> 
> As the maintainer of the Emacs port, OpenBSD 5.3 and older releases are
> completely out of scope.  I mostly care about our development branch, if
> security fixes in Emacs need to be adressed in our stable releases,
> I would probably handle them as patches backported from newer Emacs
> versions, not as updates to newer Emacs versions.

Thank you very much for taking time to answer our questions.  I've now
installed the patch on the master branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Jul 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.