Re: Re: Re: Re: USER-WRN bad 'USER@' dest

"Frank Sackewitz" <[email protected]> Thu, 28 Nov 2002 10:25:46 +0100
Newsgroups gmane.linux.suse.proxy-suite
Message-ID <OF26323484.E4DD4F2C-ONC1256C7F.003015F9@LocalDomain>
--=_alternative 0033C8EFC1256C7F_=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

1st sorry for the delay, was on businesstrip!

Marius Tomaschewski wrote:
>On Thu, Nov 21, 2002 at 10:28:00AM +0100, Frank Sackewitz wrote:
>> Hi,
>
>Hi!
>
Shark! (german joke!)
>> I=B4ve to apologize to the proxy-suite-team. The mistake was sitting in =

>> front of the screen.
>>=20
>> ftp-proxy works fine if I start it out of my chroot. Running in my=20
>> chroot-envir ftp-proxy is=20
>> unable to resolve IP-Addresses via bind. Via host it works.
>>=20
>> What functions uses ftp-proxy to resolve addresses via bind?
>> Does it call any binary?
>
<No, it uses normal glibc functions gethostname, gethostbyname
>and inet=5Faton, inet=5Fntoa. No direct resolver calls are used.
>
>The glibc is using the NSS stuff (name service switch), i.e.
>/etc/nsswitch.conf, /etc/resolv.conf, libnss=5Fdns, libnsl,
>libresolv. You need them all - config+libs - in your chroot.
>
As I said - all files where there.

>Note also: if you do any changes to these files, you have to
>restart/reload the nscd (name service caching daemon).
>
I=B4m not sure, but I think I hav=B4nt change anything.

>Try to strace it. Start the proxy, connect using the clinent,
>find out the pid of the child process and attach strace to it:
>
>  strace -f -o filename -p PID
>
>After strace is running, login using MagicChar with hostname.
>You should be able to see, what happens / fails.
>

Part of the output:
29650 recv(0, "USER [email protected]"..., 35, 0) =3D 35
=3D>                    I have typed in:      .org
30226 recv(0, "USER [email protected]"..., 36, 0) =3D 36
30226 gettimeofday({1038481617, 376494}, NULL) =3D 0
30226 getpid()                          =3D 30226
30226 open("/etc/resolv.conf", O=5FRDONLY) =3D 3
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0644, st=5Fsize=3D90, ...}) =3D 0
30226 old=5Fmmap(NULL, 4096, PROT=5FREAD|PROT=5FWRITE,=20
MAP=5FPRIVATE|MAP=5FANONYMOUS, -1, 0) =3D 0x40018000
30226 read(3, "nameserver 193.101.111.10\nnamese"..., 4096) =3D 90
30226 read(3, "", 4096)                 =3D 0
30226 close(3)                          =3D 0
30226 munmap(0x40018000, 4096)          =3D 0
30226 getpid()                          =3D 30226
30226 open("/etc/resolv.conf", O=5FRDONLY) =3D 3
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0644, st=5Fsize=3D90, ...}) =3D 0
30226 old=5Fmmap(NULL, 4096, PROT=5FREAD|PROT=5FWRITE,=20
MAP=5FPRIVATE|MAP=5FANONYMOUS, -1, 0) =3D 0x40018000
30226 read(3, "nameserver 193.101.111.10\nnamese"..., 4096) =3D 90
30226 read(3, "", 4096)                 =3D 0
30226 close(3)                          =3D 0
30226 munmap(0x40018000, 4096)          =3D 0
30226 socket(PF=5FUNIX, SOCK=5FSTREAM, 0)   =3D 3
30226 connect(3, {sin=5Ffamily=3DAF=5FUNIX, path=3D"/var/run/.nscd=5Fsocket=
"}, 110)=20
=3D -1 ENOENT (No such file or directory)
30226 close(3)                          =3D 0
30226 open("/etc/host.conf", O=5FRDONLY)  =3D 3
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0644, st=5Fsize=3D370, ...}) =3D 0
30226 old=5Fmmap(NULL, 4096, PROT=5FREAD|PROT=5FWRITE,=20
MAP=5FPRIVATE|MAP=5FANONYMOUS, -1, 0) =3D 0x40018000
30226 read(3, "#\n# /etc/host.conf - resolver co"..., 4096) =3D 370
30226 read(3, "", 4096)                 =3D 0
30226 close(3)                          =3D 0
30226 munmap(0x40018000, 4096)          =3D 0
30226 open("/etc/hosts", O=5FRDONLY)      =3D 3
30226 fcntl64(3, F=5FGETFD)               =3D 0
30226 fcntl64(3, F=5FSETFD, FD=5FCLOEXEC)   =3D 0
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0644, st=5Fsize=3D917, ...}) =3D 0
30226 old=5Fmmap(NULL, 4096, PROT=5FREAD|PROT=5FWRITE,=20
MAP=5FPRIVATE|MAP=5FANONYMOUS, -1, 0) =3D 0x40018000
30226 read(3, "#\n# hosts         This file desc"..., 4096) =3D 917
30226 read(3, "", 4096)                 =3D 0
30226 close(3)                          =3D 0
30226 munmap(0x40018000, 4096)          =3D 0
30226 open("/etc/ld.so.cache", O=5FRDONLY) =3D 3
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0644, st=5Fsize=3D64, ...}) =3D 0
30226 old=5Fmmap(NULL, 64, PROT=5FREAD, MAP=5FPRIVATE, 3, 0) =3D 0x40018000
30226 close(3)                          =3D 0
30226 open("/lib/i586/mmx/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No=
 such=20
file or directory)
30226 stat64("/lib/i586/mmx", 0xbfffc3dc) =3D -1 ENOENT (No such file or=20
directory)
30226 open("/lib/i586/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No suc=
h=20
file or directory)
30226 stat64("/lib/i586", 0xbfffc3dc)   =3D -1 ENOENT (No such file or=20
directory)
30226 open("/lib/mmx/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No such=
 file=20
or directory)
30226 stat64("/lib/mmx", 0xbfffc3dc)    =3D -1 ENOENT (No such file or=20
directory)
30226 open("/lib/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No such fil=
e or=20
directory)
30226 stat64("/lib", {st=5Fmode=3DS=5FIFDIR|0755, st=5Fsize=3D272, ...}) =
=3D 0
30226 open("/usr/lib/i586/mmx/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT=
 (No=20
such file or directory)
30226 stat64("/usr/lib/i586/mmx", 0xbfffc3dc) =3D -1 ENOENT (No such file o=
r=20
directory)
30226 open("/usr/lib/i586/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No=
 such=20
file or directory)
30226 stat64("/usr/lib/i586", 0xbfffc3dc) =3D -1 ENOENT (No such file or=20
directory)
30226 open("/usr/lib/mmx/libnss=5Fdns.so.2", O=5FRDONLY) =3D -1 ENOENT (No =
such=20
file or directory)
30226 stat64("/usr/lib/mmx", 0xbfffc3dc) =3D -1 ENOENT (No such file or=20
directory)
30226 open("/usr/lib/libnss=5Fdns.so.2", O=5FRDONLY) =3D 3
30226 read(3,=20
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\16\0\000"..., 1024) =3D=20
1024
30226 fstat64(3, {st=5Fmode=3DS=5FIFREG|0755, st=5Fsize=3D16184, ...}) =3D 0
30226 old=5Fmmap(NULL, 15560, PROT=5FREAD|PROT=5FEXEC, MAP=5FPRIVATE, 3, 0)=
 =3D=20
0x40415000
30226 mprotect(0x40418000, 3272, PROT=5FNONE) =3D 0
30226 old=5Fmmap(0x40418000, 4096, PROT=5FREAD|PROT=5FWRITE,=20
MAP=5FPRIVATE|MAP=5FFIXED, 3, 0x2000) =3D 0x40418000
30226 close(3)                          =3D 0
30226 munmap(0x40018000, 64)            =3D 0
30226 socket(PF=5FINET, SOCK=5FDGRAM, IPPROTO=5FIP) =3D 3
30226 connect(3, {sin=5Ffamily=3DAF=5FINET, sin=5Fport=3Dhtons(53),=20
sin=5Faddr=3Dinet=5Faddr("193.101.111.10")}}, 28) =3D 0
30226 send(3, "0n\1\0\0\1\0\0\0\0\0\0\3ftp\2de\7openbsd\4org "..., 37, 0)=20
=3D 37
30226 gettimeofday({1038481617, 444069}, NULL) =3D 0
30226 poll([{fd=3D3, events=3DPOLLIN, revents=3DPOLLIN}], 1, 5000) =3D 1
30226 recvfrom(3, "0n\205\203\0\1\0\0\0\1\0\0\3ftp\2de\7openbsd\4org "..., =

1024, 0, {sin=5Ffamily=3DAF=5FINET, sin=5Fport=3Dhtons(53),=20
sin=5Faddr=3Dinet=5Faddr("193.101.111.10")}}, [16]) =3D 112
30226 close(3)                          =3D 0
30226 socket(PF=5FINET, SOCK=5FDGRAM, IPPROTO=5FIP) =3D 3
30226 connect(3, {sin=5Ffamily=3DAF=5FINET, sin=5Fport=3Dhtons(53),=20
sin=5Faddr=3Dinet=5Faddr("193.101.111.10")}}, 28) =3D 0
30226 send(3, "0o\1\0\0\1\0\0\0\0\0\0\3ftp\2de\7openbsd\4org "..., 46, 0)=20
=3D 46
30226 gettimeofday({1038481617, 716641}, NULL) =3D 0
30226 poll([{fd=3D3, events=3DPOLLIN, revents=3DPOLLIN}], 1, 5000) =3D 1
30226 recvfrom(3, "0o\205\203\0\1\0\0\0\1\0\0\3ftp\2de\7openbsd\4org "..., =

1024, 0, {sin=5Ffamily=3DAF=5FINET, sin=5Fport=3Dhtons(53),=20
sin=5Faddr=3Dinet=5Faddr("193.101.111.10")}}, [16]) =3D 121
30226 close(3)                          =3D 0
30226 time([1038481617])                =3D 1038481617
30226 getpid()                          =3D 30226
30226 write(4, "ftp-child [30226] <11/28-11:06:5"..., 105) =3D 105
30226 select(1, [0], [0], NULL, {900, 0}) =3D 1 (out [0], left {900, 0})
30226 send(0, "501 Invalid destination in user "..., 39, 0) =3D 39
30226 select(1, [0], [], NULL, {900, 0} <unfinished ...>


--=20
Bye

Frank Sackewitz
EDM
HASCO-GERMANY
--=_alternative 0033C8EFC1256C7F_=--