]> granicus.if.org Git - php/commitdiff
MFH: Fix bug: #21687, imap extension does not include gss authentication mechanism
authorfoobar <sniper@php.net>
Sat, 18 Jan 2003 07:01:11 +0000 (07:01 +0000)
committerfoobar <sniper@php.net>
Sat, 18 Jan 2003 07:01:11 +0000 (07:01 +0000)
ext/imap/config.m4
ext/imap/php_imap.c

index 7ddf58b93f7cb5657c0ade9436c5f2cfd00a3ca3..cce4724bbf9ec670924777835229f3d79ad6ae0d 100644 (file)
@@ -21,10 +21,10 @@ AC_DEFUN(IMAP_LIB_CHK,[
   done
 ])
 
-dnl PHP_IMAP_TEST_BUILD(action-if-ok, action-if-not-ok [, extra-libs])
+dnl PHP_IMAP_TEST_BUILD(function, action-if-ok, action-if-not-ok [, extra-libs])
 AC_DEFUN(PHP_IMAP_TEST_BUILD, [
   old_LIBS=$LIBS
-  LIBS="$3 $LIBS"
+  LIBS="$4 $LIBS"
   AC_TRY_RUN([
     void mm_log(void){}
     void mm_dlog(void){}
@@ -41,17 +41,17 @@ AC_DEFUN(PHP_IMAP_TEST_BUILD, [
     void mm_exists(void){}
     void mm_searched(void){}
     void mm_expunged(void){}
-    char mail_open();
+    char $1();
     int main() {
-      mail_open(0,"",0);
+      $1();
       return 0;
     }
   ], [
     LIBS=$old_LIBS
-    $1
+    $2
   ],[
     LIBS=$old_LIBS
-    $2
+    $3
   ])
 ])
 
@@ -127,7 +127,7 @@ AC_DEFUN(PHP_IMAP_SSL_CHK, [
       TST_LIBS="$TST_LIBS -L$PHP_KERBEROS/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
     fi
 
-    PHP_IMAP_TEST_BUILD([
+    PHP_IMAP_TEST_BUILD(ssl_onceonlyinit, [
       AC_MSG_RESULT(no)
     ], [
       AC_MSG_RESULT(yes)
@@ -204,8 +204,14 @@ if test "$PHP_IMAP" != "no"; then
 
     dnl Test the build in the end
     TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD"
+
+    dnl Check if auth_gss exists
+    PHP_IMAP_TEST_BUILD(auth_gssapi_valid, [
+      AC_DEFINE(HAVE_IMAP_AUTH_GSS, 1, [ ])
+    ], [], $TST_LIBS)
+
     AC_MSG_CHECKING(whether IMAP works)
-    PHP_IMAP_TEST_BUILD([
+    PHP_IMAP_TEST_BUILD(mail_open, [
       AC_MSG_RESULT(yes)
     ], [
       AC_MSG_RESULT(no)
index 06aae6113ba74132f0acd9d1ca9779aa9c0118d3..89fef6b785ef51cfb92a63f9c03936f8eb853b30 100644 (file)
@@ -420,7 +420,11 @@ PHP_MINIT_FUNCTION(imap)
 #ifndef PHP_WIN32
        auth_link(&auth_log);           /* link in the log authenticator */
        auth_link(&auth_md5);       /* link in the cram-md5 authenticator */ 
-#ifdef  HAVE_IMAP_SSL
+#ifdef HAVE_IMAP_AUTH_GSS
+       auth_link(&auth_gss);           /* link in the gss authenticator */
+#endif
+
+#ifdef HAVE_IMAP_SSL
        ssl_onceonlyinit ();
 #endif
 #endif