diff options
author | nectar <nectar@FreeBSD.org> | 1999-04-06 07:36:46 +0800 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 1999-04-06 07:36:46 +0800 |
commit | b099a1b43774ce24a98d8c75ecb2bc82709e95f8 (patch) | |
tree | bdfaa34630df4b627f060b7e8ec3ac8d69571d9d /security/krb5-17 | |
parent | 877162a46d614194c1cd0893adaef64b60ae5a6b (diff) | |
download | freebsd-ports-gnome-b099a1b43774ce24a98d8c75ecb2bc82709e95f8.tar.gz freebsd-ports-gnome-b099a1b43774ce24a98d8c75ecb2bc82709e95f8.tar.zst freebsd-ports-gnome-b099a1b43774ce24a98d8c75ecb2bc82709e95f8.zip |
Teach krlogind, telnetd, et. al. about FreeBSD's available ptys.
In other words,
/dev/pty[p-zP-T][0-9a-f] -> /dev/pty[p-sP-S][0-9a-v]
Submitted by: John Polstra <jdp@polstra.com>
Diffstat (limited to 'security/krb5-17')
-rw-r--r-- | security/krb5-17/files/patch-ay | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/security/krb5-17/files/patch-ay b/security/krb5-17/files/patch-ay new file mode 100644 index 000000000000..4ed0c9e5cbbb --- /dev/null +++ b/security/krb5-17/files/patch-ay @@ -0,0 +1,50 @@ +--- util/pty/getpty.c.orig Fri Feb 6 19:46:42 1998 ++++ util/pty/getpty.c Mon Apr 5 14:00:07 1999 +@@ -21,13 +21,26 @@ + #include "libpty.h" + #include "pty-int.h" + ++#ifdef __FreeBSD__ ++#define PTYCHARS1 "pqrsPQRS" ++#define PTYCHARS2 "0123456789abcdefghijklmnopqrstuv" ++#endif ++ ++#ifndef PTYCHARS1 ++#define PTYCHARS1 "pqrstuvwxyzPQRST" ++#endif ++ ++#ifndef PTYCHARS2 ++#define PTYCHARS2 "0123456789abcdef" ++#endif ++ + long pty_getpty (fd, slave, slavelength) + int slavelength; + int *fd; char *slave; + { +- char *cp; ++ char *cp1, *cp2; + char *p; +- int i,ptynum; ++ int ptynum; + struct stat stb; + char slavebuf[1024]; + #ifdef HAVE__GETPTY +@@ -109,14 +122,14 @@ + strncpy(slave, slavebuf, slavelength); + return 0; + } else { +- for (cp = "pqrstuvwxyzPQRST";*cp; cp++) { ++ for (cp1 = PTYCHARS1; *cp1 != '\0'; cp1++) { + sprintf(slavebuf,"/dev/ptyXX"); +- slavebuf[sizeof("/dev/pty") - 1] = *cp; ++ slavebuf[sizeof("/dev/pty") - 1] = *cp1; + slavebuf[sizeof("/dev/ptyp") - 1] = '0'; + if (stat(slavebuf, &stb) < 0) + break; +- for (i = 0; i < 16; i++) { +- slavebuf[sizeof("/dev/ptyp") - 1] = "0123456789abcdef"[i]; ++ for (cp2 = PTYCHARS2; *cp2 != '\0'; cp2++) { ++ slavebuf[sizeof("/dev/ptyp") - 1] = *cp2; + *fd = open(slavebuf, O_RDWR); + if (*fd < 0) continue; + |