jailkit-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Jailkit-users] RE: How to launch a xterm into thejail (FOUCHECOURT FRED


From: FOUCHECOURT FREDERIC
Subject: [Jailkit-users] RE: How to launch a xterm into thejail (FOUCHECOURT FREDERIC)
Date: Thu, 15 Mar 2007 17:01:40 +0100

Hi Olivier,

I have reproduce your test and used the jk_cp command like you. 

The strace tool give me the following trace :

open("/dev/tty", O_RDWR)                = 5
alarm(0)                                = 2
rt_sigaction(SIGALRM, {SIG_DFL}, {0x805fe95, [ALRM], SA_RESTORER|SA_RESTART, 
0xb96898}, 8) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
close(5)                                = 0
open("/dev/ptmx", O_RDWR)               = 5
statfs("/dev/pts", {f_type=0x1021994, f_bsize=4096, f_blocks=259188, 
f_bfree=259150, f_bavail=259150, f_files=223839, f_ffree=223592, f_fsid={0, 0}, 
f_namelen=255, f_frsize=4096}) = 0
statfs("/dev/", {f_type=0x1021994, f_bsize=4096, f_blocks=259188, 
f_bfree=259150, f_bavail=259150, f_files=223839, f_ffree=223592, f_fsid={0, 0}, 
f_namelen=255, f_frsize=4096}) = 0
close(5)                                = 0
open("/dev/ptyp0", O_RDWR)              = -1 ENOENT (No such file or directory)
write(2, "xterm: Error 32, errno 2: ", 26) = 26
write(2, "No such file or directory\n", 26) = 26
write(2, "Reason: get_pty: not enough ptys"..., 33) = 33
close(-1)                               = -1 EBADF (Bad file descriptor)
chown32("/dev/pts/0", 0, 0)             = -1 ENOENT (No such file or directory)
chmod("/dev/pts/0", 0666)               = -1 ENOENT (No such file or directory)
exit_group(32)                          = ?

I think that the error is linked with pts and not tty, so I enter the following 
command :
Jk_cp /home/jail /dev/pts/*

Then I try to launch the xterm command again.

open("/dev/tty", O_RDWR)                = 5
alarm(0)                                = 2
rt_sigaction(SIGALRM, {SIG_DFL}, {0x805fe95, [ALRM], SA_RESTORER|SA_RESTART, 
0xb96898}, 8) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
close(5)                                = 0
open("/dev/ptmx", O_RDWR)               = 5
statfs("/dev/pts", {f_type=0x1021994, f_bsize=4096, f_blocks=259188, 
f_bfree=259150, f_bavail=259150, f_files=223839, f_ffree=223585, f_fsid={0, 0}, 
f_namelen=255, f_frsize=4096}) = 0
statfs("/dev/", {f_type=0x1021994, f_bsize=4096, f_blocks=259188, 
f_bfree=259150, f_bavail=259150, f_files=223839, f_ffree=223585, f_fsid={0, 0}, 
f_namelen=255, f_frsize=4096}) = 0
close(5)                                = 0
open("/dev/ptyp0", O_RDWR)              = -1 ENOENT (No such file or directory)
write(2, "xterm: Error 32, errno 2: ", 26) = 26
write(2, "No such file or directory\n", 26) = 26
write(2, "Reason: get_pty: not enough ptys"..., 33) = 33
close(-1)                               = -1 EBADF (Bad file descriptor)
chown32("/dev/pts/0", 0, 0)             = -1 EPERM (Operation not permitted)
getuid32()                              = 506
chmod("/dev/pts/0", 0666)               = -1 EPERM (Operation not permitted)
exit_group(32)                          = ?

With the user root I change permission to 666, but I obtain exactly the same 
error ?!?

Regards, Frédéric



-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Olivier Sessink
Sent: 14 March 2007 21:42
To: address@hidden
Subject: Re: [Jailkit-users] RE: How to launch a xterm into thejail 
(FOUCHECOURT FREDERIC)

FOUCHECOURT FREDERIC wrote:
> Thanks for your time Olivier :-)
> I wait for your message when you have try xterm installation.

I did an strace on an xterm process:

[pid  3866] open("/dev/tty", O_RDWR)    = 5
[pid  3866] alarm(0)                    = 2
[pid  3866] rt_sigaction(SIGALRM, {SIG_DFL}, {0x80663d0, [ALRM], SA_RESTART}, 
8) = 0 [pid  3866] ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig 
icanon echo ...}) = 0
[pid  3866] close(5)                    = 0
[pid  3866] open("/dev/ptmx", O_RDWR)   = -1 ENOENT (No such file or 
directory)
[pid  3866] open("/dev/ptyp0", O_RDWR)  = 5 [pid  3866] ioctl(5, 
SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 [pid  
3866] ioctl(5, TIOCGPTN, [134801400]) = -1 EINVAL (Invalid argument) [pid  
3866] fstat64(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(2, 0),
...}) = 0
[pid  3866] stat64("/dev/ttyp0", 0xbfd16a34) = -1 ENOENT (No such file or 
directory) [pid  3866] write(2, "xterm: Error 32, errno 2: ", 26) = 26 [pid  
3866] write(2, "No such file or directory\n", 26) = 26 [pid  3866] write(2, 
"Reason: get_pty: not enough ptys"..., 33) = 33

so I added /dev/tty*

jk_cp /home/testjail /dev/tty*

and that worked for me, xterm in a jail is running

regards,
        Olivier


_______________________________________________
Jailkit-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/jailkit-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]