ID: 9461
Updated by: chagenbu
Status: Open
Bug Type: IMAP related
PHP Version: 4.0 Latest CVS (26/02/2001)
Assigned To: 

From:  James Treleaven <[EMAIL PROTECTED]> 

Like the author of bug #9461, I also tracked the problem down to mm_login() in 
ext/imap/php_imap.c [that is where my stack was getting stomped].  I replaced the 
later two calls to strncpy() in the function, with calls to strcpy(), and now I can 
use the function to login to news servers with no 

The code in mm_login() looks correct to me - but I cannot believe that there is a bug 
in Linux's libc.a:strncpy(). I have a web based gateway up and running with hundreds 
of user's using my modified imap_open() to successfully connect to nntp with their 
usernames and passwords (we always require authentication).  My modification seems to 
be a good workaround - but I don't know why. 

Previous Comments:

[2001-02-26 08:36:22] [EMAIL PROTECTED]
function that causes crash
imap_open('{newsserver/nntp}'.'test.test','username','password') || die("can't 
connect: ".imap_last_error());

backtrace from gdb ( i know it says nothing but i did as described in the backtrace 
#0  0x0 in ?? ()

I have a problem with imap_open:
I can do imap_open on nntp server that has no authentication. But when i try on
a nntpserver that requires a password.. php dumps core (signal 11 gdb backtrace
is #0 0x0 in ?? ()) ( i executed the cgi version of php to be sure that apache
has nothing to do with it.)
i tested c-client with the mtest program and it worked perfectly.
I've tried to compile php4 with -enable-debug but i'm not so experienced with
gdb so when i load the core-file i still get no symbols or references to the
instruction that causes the problem.
it should be simple to test:

try to connect to a nntp server without username and password
try to connect to a nntp server that requires username and password

i have looked through the c-client code and the php4 extension and i could
imagine the problem might be in mm_login but i'm not certain.

the server is running:
php4.0.5-dev latest cvs
linux 2.2.12-20smp
imap (imap-2001.BETA.SNAP-0102201858) also tried (imap-4.7c)
All help is appreciated and if anybody wants more information or maybe a test
nntp account i can provide that (just send me a mail [EMAIL PROTECTED]).


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to