File php-pts.patch of Package php73
diff -Pdpru php-7.3.33.orig/ext/standard/proc_open.c php-7.3.33/ext/standard/proc_open.c
--- php-7.3.33.orig/ext/standard/proc_open.c 2021-11-16 14:18:36.000000000 +0300
+++ php-7.3.33/ext/standard/proc_open.c 2024-07-16 14:06:04.626469159 +0300
@@ -56,7 +56,7 @@
* */
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
-#if 0 && HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
+#if HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
# include <sys/ioctl.h>
# include <termios.h>
# define PHP_CAN_DO_PTS 1
@@ -636,15 +636,18 @@ PHP_FUNCTION(proc_open)
#if PHP_CAN_DO_PTS
if (dev_ptmx == -1) {
/* open things up */
- dev_ptmx = open("/dev/ptmx", O_RDWR);
+ dev_ptmx = open("/dev/ptmx", O_RDWR|O_NOCTTY);
if (dev_ptmx == -1) {
php_error_docref(NULL, E_WARNING, "failed to open /dev/ptmx, errno %d", errno);
goto exit_fail;
}
grantpt(dev_ptmx);
unlockpt(dev_ptmx);
+#ifdef TIOCGPTPEER
+ slave_pty = ioctl(dev_ptmx, TIOCGPTPEER, O_RDWR);
+#else
slave_pty = open(ptsname(dev_ptmx), O_RDWR);
-
+#endif
if (slave_pty == -1) {
php_error_docref(NULL, E_WARNING, "failed to open slave pty, errno %d", errno);
goto exit_fail;