Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73698 - php 5.0.2 can not be compiled with libmonetra 4.2
Summary: php 5.0.2 can not be compiled with libmonetra 4.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-07 11:26 UTC by Canal Vorfeed
Modified: 2004-12-15 22:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for libmonetra 4.2 (php-5.0.2.mcve-fix.patch,1.08 KB, patch)
2004-12-07 11:28 UTC, Canal Vorfeed
Details | Diff
php patch for libmonetra 4.2 (and below compat) (php_brad.diff,2.58 KB, patch)
2004-12-07 19:15 UTC, Brad House
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Canal Vorfeed 2004-12-07 11:26:38 UTC
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.
Comment 1 Canal Vorfeed 2004-12-07 11:28:20 UTC
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!
Comment 2 Canal Vorfeed 2004-12-07 11:30:22 UTC
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 :-(
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-07 11:59:43 UTC
Brad: you described 4.2 as binary+source compatible with 4.1. Is Canal's patch correct?
Comment 4 Canal Vorfeed 2004-12-07 17:50:08 UTC
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!
Comment 5 Brad House 2004-12-07 18:04:34 UTC
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
Comment 6 Brad House 2004-12-07 19:14:06 UTC
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. 
Comment 7 Brad House 2004-12-07 19:15:13 UTC
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.
Comment 8 Brad House 2004-12-15 16:19:12 UTC
FYI. PHP 5.0.3 & 4.3.10 do not have this bug.

-Brad
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-15 22:51:09 UTC
4.3.10 and 5.0.3 now in CVS.