PTY-Allocation under SCO 5

svaughan at asterion.com svaughan at asterion.com
Tue Aug 29 17:17:06 EST 2000


Damien,
	I've tested the patch on SCO Openserver 5.0.5 and so far it works
great! This fixed my pty problem.  
	One thing I noticed is that num_ptys turns out to be 832. A
standard SCO install gives you 64 ptys, though most admins up this as is
the case on the server I have been testing on, which has 1055 ptys. I'm
wondering if there is a good way to check to see how many ptys are
available on a system like SCO. Or would this be a bad idea ?
 
 
Many thanks to Bastian.  


Sam 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


On Tue, 29 Aug 2000, Damien Miller wrote:

> On Mon, 28 Aug 2000, Bastian Trompetter wrote:
> 
> > Hello,
> > 
> > I used the sshd under SCO 5, and always get the error that the deamon
> > couldn't allcoate a pseudo tty. This depends on that SCO use a
> > different method to create the tty's in the /dev directory. The pseudo
> > tty line looks like: /dev/ttypXXX where XXX depends on the number of
> > pseudo tty's entered in the scoadmin Tool for the network interface.
> 
> Thanks for the diagnosis. Does this patch fix things?
> 
> Index: pty.c
> ===================================================================
> RCS file: /var/cvs/openssh/pty.c,v
> retrieving revision 1.20
> diff -u -r1.20 pty.c
> --- pty.c	2000/06/22 11:32:31	1.20
> +++ pty.c	2000/08/29 00:47:06
> @@ -162,12 +162,19 @@
>  	for (i = 0; i < num_ptys; i++) {
>  		snprintf(buf, sizeof buf, "/dev/pty%c%c", ptymajors[i / num_minors],
>  			 ptyminors[i % num_minors]);
> -		*ptyfd = open(buf, O_RDWR | O_NOCTTY);
> -		if (*ptyfd < 0)
> -			continue;
>  		snprintf(namebuf, namebuflen, "/dev/tty%c%c",
>  		    ptymajors[i / num_minors], ptyminors[i % num_minors]);
>  
> +		*ptyfd = open(buf, O_RDWR | O_NOCTTY);
> +		if (*ptyfd < 0) {
> +			/* Try SCO style naming */
> +			snprintf(buf, sizeof buf, "/dev/ptyp%d", i);
> +			snprintf(namebuf, namebuflen, "/dev/ttyp%d", i);
> +			*ptyfd = open(buf, O_RDWR | O_NOCTTY);
> +			if (*ptyfd < 0)
> +				continue;
> +		}	
> +			
>  		/* Open the slave side. */
>  		*ttyfd = open(namebuf, O_RDWR | O_NOCTTY);
>  		if (*ttyfd < 0) {
> 
> -d
> 
> -- 
> | "Bombay is 250ms from New York in the new world order" - Alan Cox
> | Damien Miller - http://www.mindrot.org/
> | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)
> 
> 
> 
> 








More information about the openssh-unix-dev mailing list