]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Don't install duplicate STREAMS modules on Solaris
authorDarren Tucker <dtucker@dtucker.net>
Fri, 26 Apr 2019 08:06:34 +0000 (18:06 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 26 Apr 2019 08:06:34 +0000 (18:06 +1000)
Check if STREAMS modules are already installed on pty before installing
since when compiling with XPG>=4 they will likely be installed already.
Prevents hangs and duplicate lines on the terminal.  bz#2945 and bz#2998,
patch from djm@

openbsd-compat/bsd-openpty.c

index e8ad542f8d5577ae907a358ca96d8238ff8a6891..123a9be5650d43c2d51d0c7e6b904999245b7084 100644 (file)
@@ -121,6 +121,15 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
                return (-1);
        }
 
+# if defined(I_FIND) && defined(__SVR4)
+       /*
+        * If the streams modules have already been pushed then there
+        * is no more work to do here.
+        */
+       if (ioctl(*aslave, I_FIND, "ptem") != 0)
+               return 0;
+# endif
+
        /*
         * Try to push the appropriate streams modules, as described
         * in Solaris pts(7).