Problem is self-evident from attached patch: where previous versions of libmonetra had function with two argumenents there are now three. Reproducible: Always Steps to Reproduce: Try to emerge php 5.0.2 with libmonetra support.
Created attachment 45446 [details, diff] Fix for libmonetra 4.2 Trvial patch to pull changes in libmonetra to php level - may be not what's expected but at least with this patch I can compile mod_php!
Oops. I've posted patch before I've tried to actually use it :-( Of course instead of zend_get_parameters_ex(2, &arg1, &arg2, &arg3) there are should be zend_get_parameters_ex(3, &arg1, &arg2, &arg3) otherwise you'll just crash php :-(
Brad: you described 4.2 as binary+source compatible with 4.1. Is Canal's patch correct?
Make a diff from libmonetra-4.1 to libmonetra-4.2. There you'll see: diff -uNr libmonetra-4.1/monetra.h libmonetra-4.2/monetra.h --- libmonetra-4.1/monetra.h 2004-08-06 21:29:55.000000000 +0400 +++ libmonetra-4.2/monetra.h 2004-11-24 20:03:37.000000000 +0300 @@ -295,7 +295,8 @@ M_EXPORT int M_SetDropFile(M_CONN *myconn, char *df_location); M_EXPORT int M_SetIP(M_CONN *myconn, char *host, unsigned short port); M_EXPORT int M_SetSSL(M_CONN *myconn, char *host, unsigned short port); -M_EXPORT int M_SetSSL_Files(const char *sslkeyfile, const char *sslcertfile); +M_EXPORT int M_SetSSL_CAfile(M_CONN *myconn, const char *path); +M_EXPORT int M_SetSSL_Files(M_CONN *myconn, const char *sslkeyfile, const char *sslcertfile); M_EXPORT void M_VerifyConnection(M_CONN *myconn, int tf); M_EXPORT void M_VerifySSLCert(M_CONN *myconn, int tf); M_EXPORT int M_Connect(M_CONN *myconn); It's pretty obvious that you can not add new paramenter to function and still expect any type of compatibility - even source-level compatiblity, let alone binary-level compatibility. Change looks logical and usefull but it's NOT backward-compatible!
odd, during testing, I did not see a compilation error. SetSSL_Files actually should have never been implemented into the php mainline branch (as it is an undocumented function, and was only in previous libmonetra releases for testing, not production), so that was an error on our end that it was released in PHP. Yes, canal's patch is indeed correct for PHP... I will commit that to the PHP CVS as well. Sorry about that. -Brad
sorry about that you all... I'm about to attach the patch I just committed to php cvs. Granted, it should be 'binary compatible' with previous releases as long as no one calls M_SetSSL_Files, which is a safe bet.
Created attachment 45483 [details, diff] php patch for libmonetra 4.2 (and below compat) This patch makes PHP compatible with libmonetra 4.2 or higher, while maintaining compatability with older releases.
FYI. PHP 5.0.3 & 4.3.10 do not have this bug. -Brad
4.3.10 and 5.0.3 now in CVS.