Re: weird qmail-popup behaviour?

2001-07-06 Thread Arjen van Drie

On Thu, Jul 05, 2001 at 11:21:10PM +0200, Peter van Dijk wrote:
On Thu, Jul 05, 2001 at 05:20:54PM +0200, Arjen van Drie wrote:
[snip]
 This is the 'run' script started by supervise:
 
 #!/bin/sh
 exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
/var/qmail/bin/qmail-popup ids.trivial.3va.net /bin/checkpassword \ 
/var/qmail/bin/qmail-pop3d Maildir 21

Could you show us a hexdump of that file? This is interesting :)

000 2123 622f 6e69 732f 0a68 7865 6365 2f20
010 7375 2f72 6f6c 6163 2f6c 6962 2f6e 6374
020 7370 7265 6576 2072 782d 2f20 7465 2f63
030 6374 7270 6c75 7365 642e 742f 7063 702e
040 706f 2e33 6463 2062 762d 2d20 2052 482d
050 2d20 206c 2030 2030 3131 2030 0a5c 2f09
060 6176 2f72 6d71 6961 2f6c 6962 2f6e 6d71
070 6961 2d6c 6f70 7570 2070 6469 2e73 7274
080 7669 6169 2e6c 7633 2e61 656e 2074 622f
090 6e69 632f 6568 6b63 6170 7373 6f77 6472
0a0 5c20 0a20 2f09 6176 2f72 6d71 6961 2f6c
0b0 6962 2f6e 6d71 6961 2d6c 6f70 3370 2064
0c0 614d 6c69 6964 2072 3e32 3126 0a0a 
0ce

Remember, it _only_ doesn't work when run by supervise. 
When run without supervise it works fine :\



-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-06 Thread Arjen van Drie

On Fri, Jul 06, 2001 at 08:42:57AM +0200, Arjen van Drie wrote:
On Thu, Jul 05, 2001 at 11:21:10PM +0200, Peter van Dijk wrote:
On Thu, Jul 05, 2001 at 05:20:54PM +0200, Arjen van Drie wrote:
[snip]
 This is the 'run' script started by supervise:
 
 #!/bin/sh
 exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
/var/qmail/bin/qmail-popup ids.trivial.3va.net /bin/checkpassword \ 
/var/qmail/bin/qmail-pop3d Maildir 21

When i run this one like this:

#!/bin/sh
exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
   /var/qmail/bin/qmail-popup ids.trivial.3va.net /bin/checkpassword 
/var/qmail/bin/qmail-pop3d Maildir 21

it works!

Duh! All other qmail run scripts with multiple lines ended by '\' do
work. Nou breekt mijn klomp :\

(Dutch expression: now my wooden shoe breaks).




Could you show us a hexdump of that file? This is interesting :)

000 2123 622f 6e69 732f 0a68 7865 6365 2f20
010 7375 2f72 6f6c 6163 2f6c 6962 2f6e 6374
020 7370 7265 6576 2072 782d 2f20 7465 2f63
030 6374 7270 6c75 7365 642e 742f 7063 702e
040 706f 2e33 6463 2062 762d 2d20 2052 482d
050 2d20 206c 2030 2030 3131 2030 0a5c 2f09
060 6176 2f72 6d71 6961 2f6c 6962 2f6e 6d71
070 6961 2d6c 6f70 7570 2070 6469 2e73 7274
080 7669 6169 2e6c 7633 2e61 656e 2074 622f
090 6e69 632f 6568 6b63 6170 7373 6f77 6472
0a0 5c20 0a20 2f09 6176 2f72 6d71 6961 2f6c
0b0 6962 2f6e 6d71 6961 2d6c 6f70 3370 2064
0c0 614d 6c69 6964 2072 3e32 3126 0a0a 
0ce

Remember, it _only_ doesn't work when run by supervise. 
When run without supervise it works fine :\



-- 

Grtz, 

Arjen.


-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-06 Thread Arjen van Drie

On Fri, Jul 06, 2001 at 12:04:39AM -0700, Ian Lance Taylor wrote:
Arjen van Drie [EMAIL PROTECTED] writes:

 On Thu, Jul 05, 2001 at 11:21:10PM +0200, Peter van Dijk wrote:
 
 Could you show us a hexdump of that file? This is interesting :)
 
 000 2123 622f 6e69 732f 0a68 7865 6365 2f20
 010 7375 2f72 6f6c 6163 2f6c 6962 2f6e 6374
 020 7370 7265 6576 2072 782d 2f20 7465 2f63
 030 6374 7270 6c75 7365 642e 742f 7063 702e
 040 706f 2e33 6463 2062 762d 2d20 2052 482d
 050 2d20 206c 2030 2030 3131 2030 0a5c 2f09
 060 6176 2f72 6d71 6961 2f6c 6962 2f6e 6d71
 070 6961 2d6c 6f70 7570 2070 6469 2e73 7274
 080 7669 6169 2e6c 7633 2e61 656e 2074 622f
 090 6e69 632f 6568 6b63 6170 7373 6f77 6472
 0a0 5c20 0a20 2f09 6176 2f72 6d71 6961 2f6c
 0b0 6962 2f6e 6d71 6961 2d6c 6f70 3370 2064
 0c0 614d 6c69 6964 2072 3e32 3126 0a0a 
 0ce

There is a space after the second backslash.  This means that the
backslash is not a line continuation character, since that only
happens if the backslash appears at the end of the line.  That means
that checkpassword is being run with no arguments, which causes it to
silently and immediately exit.

You will see this if you use `cat -ve' on the file.

Thanks all. It works now. How does one read hexdumps? Is there 
a howto or a table somewhere?

-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-06 Thread Peter van Dijk

On Fri, Jul 06, 2001 at 11:00:12PM +0200, Arjen van Drie wrote:
[snip]
 You will see this if you use `cat -ve' on the file.
 
 Thanks all. It works now. How does one read hexdumps? Is there 
 a howto or a table somewhere?

On FreeBSD I like hexdump -C a lot, which gives output like:

bash$ hexdump -C /var/service/qmail-send/run
  23 21 2f 62 69 6e 2f 73  68 0a 65 78 65 63 20 65 |#!/bin/sh.exec e|
0010  6e 76 20 2d 20 50 41 54  48 3d 22 2f 76 61 72 2f |nv - PATH=/var/|
0020  71 6d 61 69 6c 2f 62 69  6e 3a 24 50 41 54 48 22 |qmail/bin:$PATH|
0030  20 71 6d 61 69 6c 2d 73  74 61 72 74 20 2e 2f 4d | qmail-start ./M|
0040  61 69 6c 64 69 72 2f 0a  |aildir/.|
0048

Which immediately shows where exactly the spaces are and everything.
For reading hexdumps without ascii side-output, you need to convert
the hex codes to ascii. Google can teach you a lot about that, I don't
have anything handy right now (and too much blood in my alcohol).

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html



Re: weird qmail-popup behaviour?

2001-07-06 Thread Scott Gifford

Peter van Dijk [EMAIL PROTECTED] writes:

 On Fri, Jul 06, 2001 at 11:00:12PM +0200, Arjen van Drie wrote:
 [snip]
  You will see this if you use `cat -ve' on the file.
  
  Thanks all. It works now. How does one read hexdumps? Is there 
  a howto or a table somewhere?
 

[...]

 For reading hexdumps without ascii side-output, you need to convert
 the hex codes to ascii. Google can teach you a lot about that, I don't
 have anything handy right now (and too much blood in my alcohol).

On Linux, see the ascii(7) manpage.  If you're not, search around for
it, or email me off-list and I'll send you a copy.

ScottG.



Re: weird qmail-popup behaviour?

2001-07-06 Thread Adam McKenna

On Sat, Jul 07, 2001 at 01:38:02AM +0200, Peter van Dijk wrote:
 Which immediately shows where exactly the spaces are and everything.

cat -ev is helpful as well.

--Adam



Re: weird qmail-popup behaviour?

2001-07-05 Thread Arjen van Drie

On Wed, Jul 04, 2001 at 10:01:49AM +0200, Peter van Dijk wrote:
On Wed, Jul 04, 2001 at 08:17:13AM +0200, Arjen van Drie wrote:
[snip]
 
 Any ideas?

Hmm, no clue. Tried stracing?

Yeah, but that doesn't tell me much:

[root@ids /root]# strace -p 21534
select(1, [0], NULL, NULL, {1185, 48}) = 1 (in [0], left {1172, 22})
read(0, user qwerty\r\n, 128) = 13
select(2, NULL, [1], NULL, {1200, 0})   = 1 (out [1], left {1200, 0})
write(1, +OK \r\n, 6) = 6
select(1, [0], NULL, NULL, {1200, 0})   = 1 (in [0], left {1196, 93})
read(0, pass qwerqwer\r\n, 128)   = 15
fcntl64(1, F_GETFL) = 0x2 (flags O_RDWR)
close(2)= 0
fcntl64(1, F_DUPFD, 2)  = 2
close(3)= -1 EBADF (Bad file descriptor)
pipe([3, 4])= 0
fork()  = 21569
close(3)= 0
write(4, qwerty\0qwerqwer\021534.994315366..., 54) = 54
close(4)= 0
--- SIGCHLD (Child exited) ---
wait4(21569, [WIFEXITED(s)  WEXITSTATUS(s) == 111], 0, NULL) = 21569
select(2, NULL, [1], NULL, {1200, 0})   = 1 (out [1], left {1200, 0})
write(1, -ERR authorization failed\r\n, 27) = 27
_exit(1)= ?


-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-05 Thread Peter van Dijk

On Thu, Jul 05, 2001 at 08:48:11AM +0200, Arjen van Drie wrote:
 On Wed, Jul 04, 2001 at 10:01:49AM +0200, Peter van Dijk wrote:
 On Wed, Jul 04, 2001 at 08:17:13AM +0200, Arjen van Drie wrote:
 [snip]
  
  Any ideas?
 
 Hmm, no clue. Tried stracing?
 
 Yeah, but that doesn't tell me much:
 
 [root@ids /root]# strace -p 21534

Try adding -f, so we see what the child does.

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html



Re: weird qmail-popup behaviour?

2001-07-05 Thread Arjen van Drie

On Thu, Jul 05, 2001 at 01:27:05PM +0200, Peter van Dijk wrote:

Try adding -f, so we see what the child does.

Ok. First the one by hand, i only left the relevant strace output

[pid 13002] munmap(0x40017000, 4096)= 0
[pid 13002] setgroups32(1, [513])   = 0
[pid 13002] setgid32(513)   = 0
[pid 13002] setuid32(513)   = 0
[pid 13002] chdir(/home/qwerty)   = 0
[pid 13002] execve(/var/qmail/bin/qmail-pop3d, [/var/qmail/bin/qmail-pop3d, 
Maildir], [/* 31 vars */]) = 0
[pid 13002] uname({sys=Linux, node=ids.trivial.3va.net, ...}) = 0
[pid 13002] brk(0)  = 0x804e210
[pid 13002] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x40016000
[pid 13002] open(/etc/ld.so.preload, O_RDONLY) = -1 ENOENT (No such file or 
directory)
[pid 13002] open(/etc/ld.so.cache, O_RDONLY) = 3
[pid 13002] fstat64(3, {st_mode=S_IFREG|0644, st_size=19076, ...}) = 0
[pid 13002] old_mmap(NULL, 19076, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000
[pid 13002] close(3)= 0
[pid 13002] open(/lib/libc.so.6, O_RDONLY) = 3
[pid 13002] read(3, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0H\277\1..., 1024) 
= 1024

and all goes well. Then started by svscan:

[pid 13202] munmap(0x40017000, 4096)= 0
[pid 13202] setgroups32(1, [513])   = 0
[pid 13202] setgid32(513)   = 0
[pid 13202] setuid32(513)   = 0
[pid 13202] chdir(/home/qwerty)   = 0
[pid 13202] execve(/usr/local/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such 
file or directory)
[pid 13202] execve(/usr/sbin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file or 
directory)
[pid 13202] execve(/usr/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file or 
directory)
[pid 13202] execve(/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file or 
directory)
[pid 13202] _exit(111)  = ?
... wait4 resumed [WIFEXITED(s)  WEXITSTATUS(s) == 111], 0, NULL) = 13202
--- SIGCHLD (Child exited) ---
select(2, NULL, [1], NULL, {1200, 0})   = 1 (out [1], left {1200, 0})
write(1, -ERR authorization failed\r\n, 27) = 27
_exit(1)= ?


Although /var/qmail/bin is in $PATH.



-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-05 Thread Charles Cazabon

Arjen van Drie [EMAIL PROTECTED] wrote:

 [pid 13202] chdir(/home/qwerty)   = 0
 [pid 13202] execve(/usr/local/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such 
file or directory)
 [pid 13202] execve(/usr/sbin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file 
or directory)
 [pid 13202] execve(/usr/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file 
or directory)
 [pid 13202] execve(/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file or 
directory)
 [pid 13202] _exit(111)  = ?

It's searching the path, trying to exec a program named   -- a single space.
That can't be correct.  What's in the script that starts this process again?

Charles
-- 
---
Charles Cazabon[EMAIL PROTECTED]
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
---



Re: weird qmail-popup behaviour?

2001-07-05 Thread Arjen van Drie

On Thu, Jul 05, 2001 at 08:08:25AM -0600, Charles Cazabon wrote:
Arjen van Drie [EMAIL PROTECTED] wrote:

 [pid 13202] chdir(/home/qwerty)   = 0
 [pid 13202] execve(/usr/local/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such 
file or directory)
 [pid 13202] execve(/usr/sbin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file 
or directory)
 [pid 13202] execve(/usr/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file 
or directory)
 [pid 13202] execve(/bin/ , [ ], [/* 18 vars */]) = -1 ENOENT (No such file or 
directory)
 [pid 13202] _exit(111)  = ?

It's searching the path, trying to exec a program named   -- a single space.
That can't be correct.  What's in the script that starts this process again?

This is the 'run' script started by supervise:

#!/bin/sh
exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
   /var/qmail/bin/qmail-popup ids.trivial.3va.net /bin/checkpassword \ 
   /var/qmail/bin/qmail-pop3d Maildir 21


-- 

Grtz, 

Arjen.




Re: weird qmail-popup behaviour?

2001-07-05 Thread Peter van Dijk

On Thu, Jul 05, 2001 at 05:20:54PM +0200, Arjen van Drie wrote:
[snip]
 This is the 'run' script started by supervise:
 
 #!/bin/sh
 exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
/var/qmail/bin/qmail-popup ids.trivial.3va.net /bin/checkpassword \ 
/var/qmail/bin/qmail-pop3d Maildir 21

Could you show us a hexdump of that file? This is interesting :)

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html



Re: weird qmail-popup behaviour?

2001-07-04 Thread Peter van Dijk

On Wed, Jul 04, 2001 at 08:17:13AM +0200, Arjen van Drie wrote:
[snip]
 
 Any ideas?

Hmm, no clue. Tried stracing?

Greetz, Peter
-- 
Against Free Sex!   http://www.dataloss.nl/Megahard_en.html



weird qmail-popup behaviour?

2001-07-03 Thread Arjen van Drie


Uhmm,

something I don't get. When I run as root by hand:

/usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
/var/qmail/bin/qmail-popup my.hostname.ext /bin/checkpassword \
/var/qmail/bin/qmail-pop3d Maildir 21

I get:

[arjen@bami arjen]$ telnet my.hostname.ext 110
Trying 172.16.3.1...
Connected to my.hostname.ext.
Escape character is '^]'.
+OK [EMAIL PROTECTED]
user qwerty
+OK 
pass qwerqwer
+OK


But when i run exactly the same using supervise in my bootup script:

#!/bin/sh
#exec /usr/local/bin/softlimit -m 200 \
exec /usr/local/bin/tcpserver -x /etc/tcprules.d/tcp.pop3.cdb -v -R -H -l 0 0 110 \
 /var/qmail/bin/qmail-popup my.hostname.ext /bin/checkpassword \ 
 /var/qmail/bin/qmail-pop3d Maildir 21

(softlimit also gives me an error, says it doesn't know the -m option)


 i get:

[arjen@bami arjen]$ telnet my.hostname.ext 110
Trying 172.16.3.1...
Connected to my.hostname.ext.
Escape character is '^]'.
+OK [EMAIL PROTECTED]
user qwerty
+OK 
pass qwerqwer
-ERR authorization failed
Connection closed by foreign host.


Any ideas?


-- 

Grtz, 

Arjen.