[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ftp mget hangs
>>>>> "Assar" == Assar Westerlund <assar@sics.se> writes:
Assar> Brian May <bmay@csse.monash.edu.au> writes:
>> Not sure about that patch:
Assar> It's better than an infinite loop, right? :-) I think we
Assar> solved that part of the problem.
I will take your word for it ;-)
>> - mget returns without listing any files.
>>
>> - dir says server has closed connection, even though server is
>> still alive.
Assar> The server actually dies as far as I can tell. Can you run
Assar> `strace -ff' on ftpd so that we can see where the child of
Assar> ftpd dies?
Yes - you are right. Must have been mistaken last time.
Here is the strace listing of ftpd doing a "dir":
read(0, "MIC YDMGCSqGSIb3EgECAgIBAAD/////"..., 1024) = 78
alarm(0) = 900
sigaction(SIGALRM, {0x804c090, [], SA_INTERRUPT}, {0x804c090, [], SA_INTERRUPT}) = 0
alarm(900) = 0
alarm(0) = 900
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
brk(0x8062000) = 0x8062000
pipe([7, 8]) = 0
open("/etc/passwd", O_RDONLY) = 9
fcntl(9, F_GETFD) = 0
fcntl(9, F_SETFD, FD_CLOEXEC) = 0
fstat(9, {st_mode=S_IFREG|0644, st_size=2434, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40024000
lseek(9, 0, SEEK_CUR) = 0
read(9, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2434
close(9) = 0
munmap(0x40024000, 4096) = 0
open("/etc/shadow", O_RDONLY) = -1 EACCES (Permission denied)
access("/home/ftp//bin/ls", X_OK) = -1 ENOENT (No such file or directory)
lstat("-la", 0xbfff9f20) = -1 ENOENT (No such file or directory)
lstat(".", {st_mode=S_IFDIR|0711, st_size=5120, ...}) = 0
fork() = 31750
fcntl(7, F_GETFL) = 0 (flags O_RDONLY)
fstat(7, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40024000
lseek(7, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
close(8) = 0
setreuid(4294967295, 0) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 8
setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(8, {sin_family=AF_INET, sin_port=htons(7999), sin_addr=inet_addr("202.12.87.129")}, 16) = 0
setreuid(4294967295, 1003) = 0
setsockopt(8, SOL_IP, IP_TOS, [8], 4) = 0
fcntl(8, F_GETFL) = 0x2 (flags O_RDWR)
fstat(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4018e000
lseek(8, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
connect(8, {sin_family=AF_INET, sin_port=htons(3875), sin_addr=inet_addr("202.12.87.129")}, 16) = 0
write(1, "631 YGMGCSqGSIb3EgECAgIBAAD/////"..., 142) = 142
setsockopt(8, SOL_SOCKET, SO_SNDBUF, [4194304], 4) = 0
read(7, "total 6404\ndrwx--x--x 32 bam "..., 4096) = 4096
write(8, "\0\0\0=", 4) = 4
write(8, "`;\6\t*\206H\206\367\22\1\2\2\2\1"..., 61) = 61
write(8, "\0\0\0m", 4) = 4
write(8, "`k\6\t*\206H\206\367\22\1\2\2\2\1"..., 109) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) ---
setreuid(4294967295, 0) = 0
--- SIGCHLD (Child exited) ---
getpid() = 31732
time(NULL) = 946264909
write(5, "\10\0\0\0\364{\0\0ftp31732\0\0\0"..., 384) = 384
_exit(-1) = ?
--
Brian May <bmay@csse.monash.edu.au>