php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26972 Please add option to use umap-uw linkage.c
Submitted: 2004-01-20 04:43 UTC Modified: 2004-01-21 08:38 UTC
From: jdolecek at NetBSD dot org Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.3.4 OS: NetBSD 1.6ZH
Private report: No CVE-ID: None
 [2004-01-20 04:43 UTC] jdolecek at NetBSD dot org
Description:
------------
In NetBSD pkgsrc, we patch the imap module to use directly umap-iw linkage.c, so that all available authenticators and methods would be compiled in for PHP. Since some other people might find this useful, it would be nice to have a configure option to enable this.

This is the patch we currently use. It adds option --with-imap-linkage, which changes the code to use the linkage.c supplied by imap-uw package, instead of hardcoded list. It also disables the Kerberos check, since it's not necessary to explicitly link against Kerberos libs if the imap libraries contain Kerberos support.

Note this adresses same problem as to Bug #4136. I don't know why the change to use linkage.c unconditionally was removed.

Patch #1
--- config.m4.orig      2003-10-03 07:25:35.000000000 +0200
+++ config.m4
@@ -54,6 +54,14 @@ AC_DEFUN(PHP_IMAP_TEST_BUILD, [
   ])
 ])

+dsl Must be before --with-kerberos, affects the check
+PHP_ARG_WITH(imap-linkage,use IMAP c-client linkage,
+[  --with-imap-linkage     Use IMAP c-client linkage to determine supported ite
ms.])
+
+if test "$PHP_IMAP_LINKAGE" != "no"; then
+       AC_DEFINE(HAVE_IMAP_LINKAGE, 1, [ ])
+fi
+
 AC_DEFUN(PHP_IMAP_KRB_CHK, [
   AC_ARG_WITH(kerberos,
   [  --with-kerberos[=DIR]     IMAP: Include Kerberos support. DIR is the Kerbe
ros install dir.],[
@@ -90,7 +98,7 @@ AC_DEFUN(PHP_IMAP_KRB_CHK, [
     PHP_ADD_LIBRARY(k5crypto, 1, IMAP_SHARED_LIBADD)
     PHP_ADD_LIBRARY(com_err,  1, IMAP_SHARED_LIBADD)
     PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include)
-  else
+  elif test "$PHP_IMAP_LINKAGE" != "yes"; then
     AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
       AC_MSG_ERROR([This c-client library is built with Kerberos support.

--- cut here --
Patch #2
--- php_imap.c.orig     2003-09-04 09:48:30.000000000 +0200
+++ php_imap.c
@@ -408,6 +408,11 @@ PHP_MINIT_FUNCTION(imap)

        ZEND_INIT_MODULE_GLOBALS(imap, php_imap_init_globals, NULL)

+/*
+ * Optionally use the installed c-client linkage.c to determine which drivers
+ * are authenticators are linked in. Otherwise use this fixed list.
+ */
+#ifndef HAVE_IMAP_LINKAGE
 #ifndef PHP_WIN32
        mail_link(&unixdriver);         /* link in the unix driver */
        mail_link(&mhdriver);           /* link in the mh driver */
@@ -423,6 +428,10 @@ PHP_MINIT_FUNCTION(imap)
        mail_link(&tenexdriver);        /* link in the tenex driver */
        mail_link(&mtxdriver);          /* link in the mtx driver */
        mail_link(&dummydriver);        /* link in the dummy driver */
+#else /* HAVE_IMAP_LINKAGE */
+        /* link in the c-client mail and auth drivers */
+#include "linkage.c"
+#endif /* HAVE_IMAP_LINKAGE */

 #ifndef PHP_WIN32
        auth_link(&auth_log);           /* link in the log authenticator */


Reproduce code:
---------------
Code inspection.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-20 19:09 UTC] sniper@php.net
Reclassified. This is NOT a bug but feature/change request..

 [2004-01-20 19:10 UTC] sniper@php.net
And you already sent one report about this, bug #26936 ONE is enough..

 [2004-01-21 08:37 UTC] jdolecek at NetBSD dot org
BTW, I was not able to find bug #26936 using advanced search by specifying Author address 'jdolecek@NetBSD.org' and Status All. FWIW, now I cannot find even this bug (#26972) using the advanced search, either using Status=All or Status=Bogus. The search now returns (when using Status=Closed and the author setting) only two closed PRs, #26462 and #26896.
 [2004-01-21 08:38 UTC] jdolecek at NetBSD dot org
Surely enough, the 'Status=Closed' in previous message should have been 'Status=All'.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC