Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) X-RT-Original-Encoding: iso-8859-1 Content-Length: 2955 From cross@va.pubnix.com Mon Jan 19 17:03:54 1998 Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id RAA13972 for ; Mon, 19 Jan 1998 17:03:54 -0500 Received: from jeeves.va.pubnix.com by MIT.EDU with SMTP id AA04939; Mon, 19 Jan 98 17:03:55 EST Received: from ballista.va.pubnix.com by jeeves.va.pubnix.com with ESMTP (peer crosschecked as: ballista.va.pubnix.com [199.170.215.22]) id RAA15425; Mon, 19 Jan 1998 17:03:47 -0500 (EST) Received: by ballista.va.pubnix.com id RAA21793; Mon, 19 Jan 1998 17:03:47 -0500 (EST) Message-Id: Date: Mon, 19 Jan 1998 17:03:47 -0500 (EST) From: cross@va.pubnix.com (Chris P. Ross) Reply-To: cross@va.pubnix.com To: krb5-bugs@MIT.EDU Cc: cross@va.pubnix.com Subject: getpty problem under BSD 4.4 X-Send-Pr-Version: 3.99 >Number: 529 >Category: pty >Synopsis: getpty fails on BSD/OS 3.x (and presumedly other BSD 4.4 variants) >Confidential: no >Severity: critical >Priority: medium >Responsible: hartmans >State: closed >Class: sw-bug >Submitter-Id: unknown >Arrival-Date: Mon Jan 19 17:04:01 EST 1998 >Last-Modified: Tue Jan 27 00:22:19 EST 1998 >Originator: Chris P. Ross >Organization: UUNET Technologies >Release: krb5-1.0.4 >Environment: BSD/OS 3.0 and 3.1, intel and sparc >Description: Compile telnetd or rlogind, and try to use it. It will not work, failing to find a valid pty... >How-To-Repeat: same... >Fix: Stop using all of strlen("foo"), sizeof("foo"), and (strlen("foo") - 1) in the same function. Makes it hard to see this kind of bug. >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: tlyu State-Changed-When: Tue Jan 27 00:22:06 1998 State-Changed-Why: Should be fixed in 1.0.5 >Unformatted: >System: BSD/OS ballista.va.pubnix.com 3.1 BSDI BSD/OS 3.1 Kernel #5: Fri Nov 21 16:28:46 EST 1997 lidl@pembroke.va.pubnix.com:/export/src/bsdi/sys/compile/DESKTOP i386 >Patch: Index: getpty.c =================================================================== RCS file: /export/src/CVS/usr.local/krb5/src/util/pty/getpty.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -c -r1.1.1.2 -r1.2 *** getpty.c 1997/12/17 15:18:20 1.1.1.2 --- getpty.c 1998/01/13 12:46:54 1.2 *************** *** 111,118 **** } else { for (cp = "pqrstuvwxyzPQRST";*cp; cp++) { sprintf(slavebuf,"/dev/ptyXX"); ! slavebuf[sizeof("/dev/pty")] = *cp; ! slavebuf[sizeof("/dev/ptyp")] = '0'; if (stat(slavebuf, &stb) < 0) break; for (i = 0; i < 16; i++) { --- 111,118 ---- } else { for (cp = "pqrstuvwxyzPQRST";*cp; cp++) { sprintf(slavebuf,"/dev/ptyXX"); ! slavebuf[strlen("/dev/pty")] = *cp; ! slavebuf[strlen("/dev/ptyp")] = '0'; if (stat(slavebuf, &stb) < 0) break; for (i = 0; i < 16; i++) {