Hi,
I'm trying to use sudosh on my new Debian Etch server.
sudosh-1.6.3
Debian Etch (x86_amd64)
sudosh-1.6.3# src/sudosh -i
[info]: chmod 0733 directory /var/log/sudosh
drwx-wx-wx 2 root root 4096 2007-02-14 09:25 sudosh
sudosh-1.6.3# src/sudosh
open slave pty: Bad address
open pty failed: Illegal seek
Don't know what this should mean, but sudosh is not working as expected.
Ralf
Logged In: YES
user_id=1466476
Originator: YES
I'm just wondering if the project ist still alive?
Logged In: NO
Hi,
I have the same problem in ia64, amd x86_64 and EM64T.
I think that the problem is in the slave terminal.
with strace you can read something like:
_____________________________________________________
_____________________________________________________
open("/var/log/sudosh/jordi-jordi-input-1175589865-dMuR6aGmwnwyRiAM", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
fstat(5, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
time([1175589865]) = 1175589865
open("/etc/localtime", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0644, st_size=946, ...}) = 0
fstat(6, {st_mode=S_IFREG|0644, st_size=946, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad64e9d3000
read(6, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\10"..., 4096) = 946
close(6) = 0
munmap(0x2ad64e9d3000, 4096) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=946, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=946, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=946, ...}) = 0
socket(PF_FILE, SOCK_DGRAM, 0) = 6
fcntl(6, F_SETFD, FD_CLOEXEC) = 0
connect(6, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
sendto(6, "<150>Apr 3 10:44:25 sudosh: sta"..., 89, MSG_NOSIGNAL, NULL, 0) = 89
close(6) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=39, ws_col=125, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
open("/dev/ptmx", O_RDWR) = 6
ioctl(6, TIOCSPTLCK, [0]) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(6, TIOCGPTN, [6]) = 0
stat("/dev/pts/6", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 6), ...}) = 0
statfs("/dev/pts/6", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(6, TIOCGPTN, [6]) = 0
stat("/dev/pts/6", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 6), ...}) = 0
open(umovestr: Input/output error
0x4ecbda90, O_RDWR) = -1 EFAULT (Bad address)
dup(2) = 7
fcntl(7, F_GETFL) = 0x8001 (flags O_WRONLY|O_LARGEFILE)
close(7) = 0
write(2, "open slave pty: Bad address\n", 28open slave pty: Bad address
) = 28
close(6) = 0
_____________________________________________________
_____________________________________________________
Logged In: NO
This is a strange problem caused by ptsname() being given the wrong signature.
Add this line to sudosh.c and it'll work (this is a workaround, not a particularly nice fix...):
char *ptsname(int fildes);
That's the correct signature. Without it gcc treats the returned value as an integer on 64 bit platforms, and stores just 32 bits of the returned result into the pointer...
Logged In: NO
my error is different
open slave pty: Permission denied
open pty failed: Illegal seek
any ideas ?
socket(PF_FILE, SOCK_DGRAM, 0) = 6
fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
connect(6, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
send(6, "<150>Dec 9 16:08:00 sudosh: sta"..., 93, MSG_NOSIGNAL) = 93
close(6) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=46, ws_col=169, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
open("/dev/ptmx", O_RDWR) = 6
ioctl(6, TIOCSPTLCK, [0]) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(6, TIOCGPTN, [6]) = 0
stat64("/dev/pts/6", {st_mode=S_IFCHR|020, st_rdev=makedev(136, 6), ...}) = 0
statfs("/dev/pts/6", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(6, TIOCGPTN, [6]) = 0
stat64("/dev/pts/6", {st_mode=S_IFCHR|020, st_rdev=makedev(136, 6), ...}) = 0
open("/dev/pts/6", O_RDWR) = -1 EACCES (Permission denied)
dup(2) = 7
fcntl64(7, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(7, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 5), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
_llseek(7, 0, 0xbed76968, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(7, "open slave pty: Permission denie"..., 34open slave pty: Permission denied
) = 34
close(7) = 0
munmap(0x40016000, 4096) = 0
close(6) = 0
dup(2) = 6
fcntl64(6, F_GETFL) = 0x2 (flags O_RDWR)
fstat64(6, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 5), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
_llseek(6, 0, 0xbed76968, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(6, "open pty failed: Illegal seek\n", 30open pty failed: Illegal seek
) = 30
close(6) = 0
munmap(0x40016000, 4096) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
close(4) = 0
close(3) = 0
close(5) = 0
time([1197227280]) = 1197227280
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=276, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=276, ...}) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=276, ...}) = 0
socket(PF_FILE, SOCK_DGRAM, 0) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
send(3, "<150>Dec 9 16:08:00 sudosh: sto"..., 70, MSG_NOSIGNAL) = 70
close(3) = 0
io_submit(0x1, 0, 0x8 <unfinished ... exit status 1>
Process 3016 detached
Logged In: NO
I was able to get around this by configuring with
env CFLAGS="-D_GNU_SOURCE" ./configure
It appears that otherwise, gcc won't use the version of ptsname() that sudosh expects.