From 7435ded5ba1ce482c78720425f39822596a36979 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Thu, 28 Oct 2004 22:33:41 +0000 Subject: Repair handling of ptys. --- security/sudosh3/files/patch-src::sudosh.c | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 security/sudosh3/files/patch-src::sudosh.c (limited to 'security/sudosh3/files/patch-src::sudosh.c') diff --git a/security/sudosh3/files/patch-src::sudosh.c b/security/sudosh3/files/patch-src::sudosh.c new file mode 100644 index 000000000000..9f7d3a914cb3 --- /dev/null +++ b/security/sudosh3/files/patch-src::sudosh.c @@ -0,0 +1,42 @@ +--- src/sudosh.c.orig Tue Oct 26 18:01:24 2004 ++++ src/sudosh.c Thu Oct 28 15:18:50 2004 +@@ -75,6 +75,12 @@ + #define SIGCHLD SIGCLD + #endif + ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#endif ++ + static struct termios termorig; + static struct winsize winorig; + +@@ -377,15 +383,24 @@ + { + if ((p->mfd = open ("/dev/ptc", O_RDWR)) == -1) + { +- perror ("Cannot open cloning master pty"); +- return -1; ++#ifdef __FreeBSD__ ++ if (openpty(&p->mfd, &p->sfd, sname, NULL, NULL) == -1) ++ { ++#endif ++ perror ("Cannot open cloning master pty"); ++ return -1; ++#ifdef __FreeBSD__ ++ } ++#endif + } + } + + (void) unlockpt (p->mfd); + (void) grantpt (p->mfd); + ++#ifndef __FreeBSD__ + sname = (char *) ptsname (p->mfd); ++#endif + + if ((p->sfd = open (sname, O_RDWR)) == -1) + { -- cgit v1.2.3