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

index be9f492e6b99d8ada5cb6080180c65fd1fd54ab6..cb74f15e51d52f4cd3c80fd6638758e04ba8c53c 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 af12742c128ae9675f969be50c39613b6beef642..8362583cb3d2a9ef39cc15df8dd781bdeefc0af6 100644 (file)
@@ -415,7 +415,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