Subject: lib/12862: openpty() tries to allocate ptyv*.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dogcow@redback.com>
List: netbsd-bugs
Date: 05/07/2001 17:01:40
>Number:         12862
>Category:       lib
>Synopsis:       openpty() tries to allocate ptyv*.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 17:01:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        <NetBSD-current source date> NetBSD 1.5
>Organization:
	
>Environment:
	
System: NetBSD fartmangler.redback.com 1.5.1_ALPHA NetBSD 1.5.1_ALPHA (NETZUUL) #34: Mon Apr 16 19:22:08 PDT 2001 notroot@zuul.redback.com:/amd/netapp6/netbsd15/nbsrc/sys/arch/i386/compile/NETZUUL i386


>Description:
According to the i386 MAKEDEV, pty6 (aka ptyv*) conflicts with the
console ttyv0 device, so it's not created.

However, openpty() (basesrc/lib/libutil/pty.c) has

#define TTY_LETTERS     "pqrstuvwxyzPQRST"

and so it tries to allocate/use ptyv, which fails horribly.

This bug is not only in 1.5, but is in -current as well.
	
>How-To-Repeat:
Try to create more than 80 telnet/sshd sessions on a box.
	
>Fix:
	
If ttyv* is no longer being used, fix MAKEDEV to create the devices and
    not worry about it.
If ttyv* is still being used, whack 'v' from the TTY_LETTERS string.

Of course, having some brave soul write a sysV-ish /dev/pts/37-style
thing wouldn't be bad...
>Release-Note:
>Audit-Trail:
>Unformatted: