xterm: Error 18, errno 13

Javier Valencia jvalencia at log01.org
Thu Dec 2 03:41:26 PST 2004


Glynn Clements wrote:

>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.
>
>  
>
My module only checks for inode number, it prints "write denied on inode 
4", that is my /bin directory. Another thing very curious, is that the 
first xterm gets frozen with this error, but all next xterms work 
perfectly!! Why am i having this error only in the first xterm?

stats of my /bin:

  File: `/bin/'
  Size: 3712            Blocks: 7          IO Block: 131072 directory
Device: 304h/772d       Inode: 4           Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2004-07-28 00:16:43.000000000 +0100
Modify: 2004-06-23 11:20:27.000000000 +0100
Change: 2004-12-01 22:58:04.000000000 +0000




More information about the xorg mailing list