From owner-freebsd-ports Sun Jun 24 1:40:10 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6422337B406 for ; Sun, 24 Jun 2001 01:40:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5O8e3g79314; Sun, 24 Jun 2001 01:40:03 -0700 (PDT) (envelope-from gnats) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by hub.freebsd.org (Postfix) with ESMTP id 39E6D37B401 for ; Sun, 24 Jun 2001 01:33:23 -0700 (PDT) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id LMV82579; Sun, 24 Jun 2001 11:33:20 +0300 (EEST) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.11.4/8.11.4) id f5O8W9w08459; Sun, 24 Jun 2001 11:32:09 +0300 (EEST) (envelope-from netch) Message-Id: <200106240832.f5O8W9w08459@iv.nn.kiev.ua> Date: Sun, 24 Jun 2001 11:32:09 +0300 (EEST) From: Valentin Nechayev Reply-To: Valentin Nechayev To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/28383: screen incorrectly detects ptys with devfs Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 28383 >Category: ports >Synopsis: screen incorrectly detects ptys with devfs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 24 01:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Valentin Nechayev >Release: FreeBSD 5.0-CURRENT i386 >Organization: home sweet home >Environment: System: FreeBSD iv.nn.kiev.ua 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sat Jun 16 12:43:44 EEST 2001 root@iv.nn.kiev.ua:/usr/obj/usr/HEAD/src/sys/nn12 i386 >Description: When screen is built from ports on fresh -current system with devfs, config.h contains: #define PTYRANGE0 "pqrsPQRS" #define PTYRANGE1 "0" instead of correct #define PTYRANGE0 "pqrsPQRS" #define PTYRANGE1 "0123456789abcdefghijklmnopqrstuv" This is caused by default screen testing which separates some special cases (OSF, AIX,...), wide-spread /dev/ptmx variant, and without them falls to simple BSD-styled case with iterative opening of all master pty's in classes specified with PTYRANGE0 and PTYRANGE1. Screen's configure gets values from PTYRANGE0 and PTYRANGE1 from listing of current /dev, which works correct without devfs, but fails with devfs. Example of result: netch@iv:~>w 10:25AM up 50 mins, 14 users, load averages: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE WHAT root v1 - 9:35AM 15 -sbash (sbash) netch v2 - 9:35AM 26 -bash (bash) netch v3 - 9:35AM 26 -bash (bash) netch v4 - 9:35AM 30 -bash (bash) netch v6 - 9:36AM 48 ssh -2 localhost netch p0 :ttyv7:S.0 9:35AM - /usr/local/bin/mutt -y netch p1 localhost 9:36AM 48 -bash (bash) netch q0 :ttyv7:S.1 9:35AM - w netch r0 :ttyv7:S.2 9:41AM 29 /usr/local/bin/mutt -y netch s0 :ttyv7:S.3 9:55AM 15 lynx http://www.inar.r netch P0 :ttyv7:S.4 10:08AM 11 lynx http://www.inar.r netch Q0 :ttyv7:S.5 10:08AM - lynx http://www.inar.r netch R0 :ttyv7:S.6 10:09AM 15 lynx http://www.inar.r netch S0 :ttyv7:S.7 10:09AM 15 lynx http://www.inar.r An attempt to create new terminal, either from the same metasession or new one, fails with "No more PTYs." screen's error message. Strange pty allocation pattern (shown in `w' output) points to its reason. >How-To-Repeat: Close all ptys, rebuild screen from ports and check PTYRANGE* in config.h. >Fix: Disable misworked configure detecting of ptys and hardcode FreeBSD variant. This also fixes need to reinstall screen when new ptys are generated in plain old /dev, with little overhead of testing all nonexistent ones when ptys are really exhausted. diff -rNu 0/Makefile 1/Makefile --- 0/Makefile Sat Mar 31 12:36:51 2001 +++ 1/Makefile Sun Jun 24 11:30:58 2001 @@ -7,7 +7,7 @@ PORTNAME= screen PORTVERSION= 3.9.8 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= misc MASTER_SITES= ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \ ${MASTER_SITE_GNU} diff -rNu 0/files/patch-ah 1/files/patch-ah --- 0/files/patch-ah Thu Jan 1 03:00:00 1970 +++ 1/files/patch-ah Sun Jun 24 11:23:56 2001 @@ -0,0 +1,80 @@ +--- configure.orig Sun Jun 24 11:18:54 2001 ++++ configure Sun Jun 24 11:23:23 2001 +@@ -2183,76 +2183,10 @@ + fi + rm -f conftest* + +-echo "checking for /dev/ptc" 1>&6 +-echo "configure:2213: checking for /dev/ptc" >&5 +-if test -r /dev/ptc; then +-cat >> confdefs.h <<\EOF +-#define HAVE_DEV_PTC 1 +-EOF +- +-fi +- +-echo "checking for SVR4 ptys" 1>&6 +-echo "configure:2222: checking for SVR4 ptys" >&5 +-if test -c /dev/ptmx ; then +-cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +- rm -rf conftest* +- cat >> confdefs.h <<\EOF +-#define HAVE_SVR4_PTYS 1 +-EOF +- +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +-fi +-rm -f conftest* +-fi +- +-echo "checking for ptyranges" 1>&6 +-echo "configure:2246: checking for ptyranges" >&5 +-if test -d /dev/ptym ; then +-pdir='/dev/ptym' +-else +-pdir='/dev' +-fi +-cat > conftest.$ac_ext <&5 | +- egrep "yes" >/dev/null 2>&1; then +- rm -rf conftest* +- ptys=`echo /dev/ptyp??` +-else +- rm -rf conftest* +- ptys=`echo $pdir/pty??` +-fi +-rm -f conftest* +- +-if test "$ptys" != "$pdir/pty??" ; then +-p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` +-p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` + cat >> confdefs.h <> confdefs.h <&6 + echo "configure:2284: checking default tty permissions/group" >&5 /netch >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message