Subject: Re: tty allocation
To: Jaromir Dolecek <>
From: Thor Lancelot Simon <>
List: tech-kern
Date: 04/26/2002 11:35:21
On Fri, Apr 26, 2002 at 02:45:35PM +0200, Jaromir Dolecek wrote:
> Piotr Stolc wrote:
> > It requires root priviledges, and I want to do it as an unpriviledged user,
> > for example under screen without suid flag set.
> > I've just checked the behaviour of Linux with /dev/pts - it creates new nodes
> > owned by requesting user.
> > 
> This is AFAIK just implementation detail, and by-product of devfs.
> I'd be very surprised if this would actually be mandated by the standard.

Indeed, the standard requires that you call grantpt(), which has a
totally broken and stupid interface: because most systems have grantpt()
actually fork and exec a setuid program that does a chown, and some bozo
doing some commercial implementation long ago didn't know how to handle
child processes without using SIGCHLD, the standard explicitly allows
grantpt() to not work if your program happens to have a SIGCHLD handler.

Mmmmm, Unix standards where features are for sale to the highest bidder...

 Thor Lancelot Simon	                            
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud