[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Installed screen 3.9.5-2.1 (source i386)



At 13:07 +0100 1999-11-02, Gergely Madarasz wrote:
>On Tue, 2 Nov 1999, Juan Cespedes wrote:
>> Without my patch, "screen" does not work at all if you don't have
>> CONFIG_UNIX98_PTYS=y in your kernel, and I think that should be more
>> important than freeing ptys.
>
>In my opinion, either is a release critical problem. I've already run into
>some problems with utmp and screen because of this pty leakage, and I had
>to restart screen because of this.

Speaking as libc maintainer, I suggest leaving the openpty() patch backed out
and changing the grantpt()/unlockpt() case in pty.c to use getpt() to get a
master pty instead of /dev/ptmx. This should fix both issues.

diff --exclude=configure -ur screen-3.9.5/config.h.in screen-3.9.5.getpt/config.h.in
--- screen-3.9.5/config.h.in	Tue Nov  2 06:27:30 1999
+++ screen-3.9.5.getpt/config.h.in	Tue Nov  2 06:13:34 1999
@@ -563,6 +563,11 @@
  */
 #undef HAVE_SVR4_PTYS
 
+/*
+ * define HAVE_GETPT if you have the getpt() function.
+ */
+#undef HAVE_GETPT
+
 /* 
  * define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
  * to unusual environments. E.g. For SunOs the defaults are "qpr" and 
diff --exclude=configure -ur screen-3.9.5/configure.in screen-3.9.5.getpt/configure.in
--- screen-3.9.5/configure.in	Tue Nov  2 06:27:30 1999
+++ screen-3.9.5.getpt/configure.in	Tue Nov  2 06:19:58 1999
@@ -625,6 +625,7 @@
 if test -c /dev/ptmx ; then
 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],AC_DEFINE(HAVE_SVR4_PTYS))
 fi
+AC_CHECK_FUNCS(getpt)
 
 AC_CHECKING(for ptyranges)
 if test -d /dev/ptym ; then
diff --exclude=configure -ur screen-3.9.5/pty.c screen-3.9.5.getpt/pty.c
--- screen-3.9.5/pty.c	Fri Aug 27 03:00:12 1999
+++ screen-3.9.5.getpt/pty.c	Tue Nov  2 06:33:11 1999
@@ -242,11 +242,15 @@
 {
   register int f;
   char *m, *ptsname();
-  int unlockpt __P((int)), grantpt __P((int));
+  int unlockpt __P((int)), grantpt __P((int)), getpt __P((void));
   sigret_t (*sigcld)__P(SIGPROTOARG);
 
+#ifdef HAVE_GETPT
+  if ((f = getpt()) == -1)
+#else
   strcpy(PtyName, "/dev/ptmx");
   if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
+#endif
     return -1;
 
   /*
-- 
Joel Klecker (aka Espy)                    Debian GNU/Linux Developer
<URL:mailto:jk@espy.org>                 <URL:mailto:espy@debian.org>
<URL:http://web.espy.org/>               <URL:http://www.debian.org/>


Reply to: