xterm: Error 18, errno 13

Glynn Clements glynn at gclements.plus.com
Thu Dec 2 02:11:27 PST 2004


Javier Valencia wrote:

> Hi all, i don't know what mailing list to use, there are lots of them in 
> xorg site!
> 
> Well, lately, i've coded a kernel module that disable write access on 
> /bin inode, this means you can't create/delete entries in /bin inode, 
> but you can read and execute all files in it.
> 
> All binaries work, but not xterm. The error i get is:
>   
>    xterm: Error 18, errno 13: Permission denied
>    Reason: spawn: open() failed on ptsname
> 
> If i disable my module, xterm works again.
> Why is xterm writing on /bin inode? or, what's happening here?

This error message corresponds to SysError(ERROR_OPPTSNAME), which
occurs if xterm is unable to open the pseudo-terminal slave device, as
identified by the ptsname() function:

	if ((pty_name = ptsname(screen->respond)) == 0) {
	    SysError(ERROR_PTSNAME);
	}
	if ((ptyfd = open(pty_name, O_RDWR)) < 0) {
	    SysError(ERROR_OPPTSNAME);
	}

pty_name should be a pathname beneath /dev/pts.

Is your kernel module checking both the device and inode number? Or is
it only checking the inode number, and mistaking /dev or /dev/pts for
the /bin directory? Note that /dev/pts definitely won't be on the root
filesystem, and /dev won't be on the root filesystem if you are using
devfs.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list