Hi Andreas,

Binc IMAP seems able to deal with the checkpw program because I'm now
getting past the authentication stage, but I'm curious to know why
checkpw doesn't seem to work when I call it directly. 

I ran strace on it and have attached the output. Line 21 shows the
password being read from the input and line 92 shows the password being
read from ~/Maildir/.password. I'm curious to know what else can be
deduced from this log.

Thanks very much for your help,
Mike.

-----Original Message-----
From: Andreas Aardal Hanssen [mailto:[EMAIL PROTECTED] 
Sent: April 6, 2004 3:57 PM
To: Binc IMAP General
Subject: RE: [binc] 'The server died unexpectedly'

On Tue, 6 Apr 2004, Mike Iles wrote:
>I'm having more success... I found this note [1] which gave me the tool
>to redirect output onto descriptor 3, like so:
>   printf "user\0password\0y123456\0" |checkpw id 3<&0

It is in general quite hard to debug the checkpassword programs, since
they have no real way of reporting errors other than their return code.

Could you try running the above, or Binc IMAP, using strace?

http://lifewithbincimap.org/index.php/Main/DumpingWithStrace

Andy :-)

--
Andreas Aardal Hanssen   | http://www.andreas.hanssen.name/gpg
Author of Binc IMAP      |  "It is better not to do something
http://www.bincimap.org/ |        than to do it poorly."

execve("/usr/bin/checkpw", ["/usr/bin/checkpw", "id"], [/* 15 vars */]) = 0
uname({sys="Linux", node="mist", ...})  = 0
brk(0)                                  = 0x804ac20
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40017000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 4
fstat64(4, 0xbffff238)                  = -1 ENOSYS (Function not implemented)
fstat(4, {st_mode=S_IFREG|0644, st_size=31446, ...}) = 0
old_mmap(NULL, 31446, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40018000
close(4)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 4
read(4, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200^\1\0004\0\0\0\364\362\22\0\0\0\0\0004\0
 
\0\10\0(\0006\0005\0\6\0\0\0004\0\0\0004\0\0\0004\0\0\0\0\1\0\0\0\1\0\0\5\0\0\0\4\0\0\0\3\0\0\0\310`\22\0\310`\22\0\310`\22\0\23\0\0\0\23\0\0\0\4\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10s\22\0\10s\22\0\5\0\0\0\0\20\0\0\1\0\0\0
 s\22\0 \203\22\0 [EMAIL PROTECTED]@[EMAIL PROTECTED] \0\0\0 
\0\0\0\4\0\0\0\4\0\0\0P\345td\334`\22\0\334`\22\0\334`\22\0,\22\0\0,\22\0\0\4\0\0\0\4\0\0\0Q\345td\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\2\0\0\0\0\0\0\0\377\3\0\0\302\10\0\0006\1\0\0\332\6\0\0\214\2\0\0\375\0\0\0D\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\311\6\0\0%\6\0\0\0\0\0\0{\10\0\0\322\6\0\0H\2\0\0\345\2\0\0\220\10\0\0f\4\0\0\205\10\0\0t\3\0\0\n\7\0\0\266\2\0\0P\10\0\0t\6\0\0\23\5\0\0
 
\10\0\0\350\7\0\0\0\0\0\0\357\4\0\0\7\6\0\0\211\10\0\0\223\7\0\0\0\0\0\0\0\0\0\0\245\5\0\0}\4\0\0\214\7\0\0G\5\0\0\216\10\0\0\0\0\0\0Q\10\0\0",
 512) = 512
fstat(4, {st_mode=S_IFREG|0644, st_size=1244004, ...}) = 0
old_mmap(NULL, 1254244, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40020000
old_mmap(0x40148000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x127000) 
= 0x40148000
old_mmap(0x40150000, 9060, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 
-1, 0) = 0x40150000
close(4)                                = 0
munmap(0x40018000, 31446)               = 0
read(3, "mike\0testpw\0y123456\0\n", 513) = 21
read(3, "", 492)                        = 0
close(3)                                = 0
brk(0)                                  = 0x804ac20
brk(0x806bc20)                          = 0x806bc20
brk(0)                                  = 0x806bc20
brk(0x806c000)                          = 0x806c000
socket(PF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110) = -1 ECONNREFUSED 
(Connection refused)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY)    = 3
fstat64(3, 0xbffff8b0)                  = -1 ENOSYS (Function not implemented)
fstat(3, {st_mode=S_IFREG|0644, st_size=465, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40018000
read(3, "# /etc/nsswitch.conf\n#\n# Example configuration of GNU Name Service Switch 
functionality.\n# If you have the `glibc-doc\' and `info\' packages installed, try:\n# 
`info libc \"Name Service Switch\"\' for information about this file.\n\npasswd:       
  compat\ngroup:          compat\nshadow:         compat\n\nhosts:          files 
dns\nnetworks:       files\n\nprotocols:      db files\nservices:       db 
files\nethers:         db files\nrpc:            db files\n\nnetgroup:       nis\n", 
4096) = 465
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40018000, 4096)                = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=31446, ...}) = 0
old_mmap(NULL, 31446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_compat.so.2", O_RDONLY) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0P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old_mmap(0x4015a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x6000) = 
0x4015a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000<\0\0004\0\0\0$\33\1\0\0\0\0\0004\0 
\0\7\0(\0\31\0\30\0\6\0\0\0004\0\0\0004\0\0\0004\0\0\0\340\0\0\0\340\0\0\0\5\0\0\0\4\0\0\0\3\0\0\0\350\20\1\0\350\20\1\0\350\20\1\0\23\0\0\0\23\0\0\0\4\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\373\20\1\0\373\20\1\0\5\0\0\0\0\20\0\0\1\0\0\0\0\21\1\0\0!\1\0\0!\1\0H\t\0\0\240*\0\0\6\0\0\0\0\20\0\0\2\0\0\0D\26\1\0D&\1\0D&\1\0\330\0\0\0\330\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\24\1\0\0\24\1\0\0\24\1\0\0
 \0\0\0 
\0\0\0\4\0\0\0\4\0\0\0Q\345td\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\2\0\0\0\0\0\0\0\303\1\0\0\3\1\0\0\0\0\0\0Q\0\0\0\230\0\0\0\0\0\0\0\0\0\0\0.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\202\0\0\0\0\0\0\0\177\0\0\0\341\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\265\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0:\0\0\0\322\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\251\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0I\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0)\0\0\0\0\0\0\0",
 512) = 512
fstat(3, {st_mode=S_IFREG|0644, st_size=73484, ...}) = 0
old_mmap(NULL, 84896, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4015b000
old_mmap(0x4016d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 
0x4016d000
old_mmap(0x4016e000, 7072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 
-1, 0) = 0x4016e000
close(3)                                = 0
munmap(0x40018000, 31446)               = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=31446, ...}) = 0
old_mmap(NULL, 31446, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_nis.so.2", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 
\34\0\0004\0\0\0\250z\0\0\0\0\0\0004\0 
\0\7\0(\0\31\0\30\0\6\0\0\0004\0\0\0004\0\0\0004\0\0\0\340\0\0\0\340\0\0\0\5\0\0\0\4\0\0\0\3\0\0\0\350w\0\0\350w\0\0\350w\0\0\23\0\0\0\23\0\0\0\4\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\373w\0\0\373w\0\0\5\0\0\0\0\20\0\0\1\0\0\0\374w\0\0\374\207\0\0\374\207\0\0\350\1\0\0P\3\0\0\6\0\0\0\0\20\0\0\2\0\0\0
 x\0\0 \210\0\0 
\210\0\0\350\0\0\0\350\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\24\1\0\0\24\1\0\0\24\1\0\0 \0\0\0 
\0\0\0\4\0\0\0\4\0\0\0Q\345td\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\2\0\0\0\0\0\0\0\261\0\0\0\205\0\0\0\0\0\0\0M\0\0\0\0\0\0\0=\0\0\0\\\0\0\0h\0\0\0\0\0\0\0>\0\0\0\0\0\0\0\0\0\0\0Q\0\0\0003\0\0\0\0\0\0\0m\0\0\0\0\0\0\0X\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0007\0\0\0\0\0\0\0\0\0\0\0g\0\0\0\0\0\0\0\202\0\0\0\0\0\0\0l\0\0\0\0\0\0\0j\0\0\0\0\0\0\0~\0\0\0\0\0\0\0e\0\0\0r\0\0\0v\0\0\0\0\0\0\0o\0\0\0\0\0\0\0006\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\'\0\0\0|\0\0\0\0\0\0\0H\0\0\0\0\0\0\0",
 512) = 512
fstat(3, {st_mode=S_IFREG|0644, st_size=32400, ...}) = 0
old_mmap(NULL, 35660, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40170000
old_mmap(0x40178000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 
0x40178000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libnss_files.so.2", O_RDONLY) = 3
read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\35\0\0004\0\0\0\234\202\0\0\0\0\0\0004\0
 
\0\7\0(\0\31\0\30\0\6\0\0\0004\0\0\0004\0\0\0004\0\0\0\340\0\0\0\340\0\0\0\5\0\0\0\4\0\0\0\3\0\0\0\320\177\0\0\320\177\0\0\320\177\0\0\23\0\0\0\23\0\0\0\4\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\343\177\0\0\343\177\0\0\5\0\0\0\0\20\0\0\1\0\0\0\0\200\0\0\0\200\0\0\0\200\0\0\330\1\0\0\270\3\0\0\6\0\0\0\0\20\0\0\2\0\0\0\f\200\0\0\f\200\0\0\f\200\0\0\330\0\0\0\330\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\24\1\0\0\24\1\0\0\24\1\0\0
 \0\0\0 
\0\0\0\4\0\0\0\4\0\0\0Q\345td\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\4\0\0\0\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\2\0\0\0\0\0\0\0\277\0\0\0\213\0\0\0q\0\0\0\0\0\0\0j\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\207\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0b\0\0\0P\0\0\0\201\0\0\0\0\0\0\0\0\0\0\0Z\0\0\0l\0\0\0E\0\0\0\0\0\0\0\0\0\0\0;\0\0\0)\0\0\0L\0\0\0m\0\0\0<\0\0\0&\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0s\0\0\0*\0\0\0+\0\0\0\'\0\0\0\0\0\0\0\0\0\0\0}\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
 512) = 512
fstat(3, {st_mode=S_IFREG|0644, st_size=34436, ...}) = 0
old_mmap(NULL, 33720, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40179000
old_mmap(0x40181000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x8000) = 
0x40181000
close(3)                                = 0
munmap(0x40018000, 31446)               = 0
open("/etc/passwd", O_RDONLY)           = 3
fcntl64(3, F_GETFD)                     = -1 ENOSYS (Function not implemented)
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=1135, ...}) = 0
mmap2(NULL, 1135, PROT_READ, MAP_SHARED, 3, 0) = -1 ENOSYS (Function not implemented)
old_mmap(NULL, 1135, PROT_READ, MAP_SHARED, 3, 0) = 0x40018000
_llseek(3, 1135, [1135], SEEK_SET)      = 0
munmap(0x40018000, 1135)                = 0
close(3)                                = 0
chdir("/home/mike")                     = 0
stat("Maildir/.password", {st_mode=S_IFREG|0600, st_size=7, ...}) = 0
open("Maildir/.password", O_RDONLY|O_NONBLOCK) = 3
read(3, "testpw\n", 32)                 = 7
read(3, "", 32)                         = 0
close(3)                                = 0
setgroups32(1, [1000])                  = -1 ENOSYS (Function not implemented)
setgroups(1, [1000])                    = -1 EPERM (Operation not permitted)
exit_group(1)                           = ?

Reply via email to