Re: Bug #12883 Updated: krb4 support in c-client
| From: | Liam Hoekenga | Date: | Wed, 22 Aug 2001 12:43:32 +0000 |
| Subject: | Re: Bug #12883 Updated: krb4 support in c-client | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-64028@lists.php.net to get a copy of this message | ||
If you guys decide not to commit the patch (which I can understand given the
unsupported nature of krb4 in c-client, and the apache server module of PHP
inability to use it properly)...
Would you consider putting an entry in the FAQ about the "auth_link(&auth_krb);"
line in php_imap.c?
It took me months to track that down.
thanks
Quoting Bug Database <php-dev@lists.php.net>:
> ID: 12883
> Updated by: sniper
> Reported By: liamr@umich.edu
> Old Status: Open
> Status: Analyzed
> Bug Type: Feature/Change Request
> Operating System: Solaris (SPARC) 2.6
> PHP Version: 4.0CVS-2001-08-21
> New Comment:
>
> Before anybody commits this patch here's a note from IMAP
> docs/FAQ:
> ----------------------------------------------------------
> Q: Can I use Kerberos V4?
> A: Kerberos V4 is not supported. Kerberos V4 client-only contributed code
> is available as:
> ftp://ftp.cac.washington.edu/mail/kerberos4-patches.tar.Z
> This is a patchkit which must be applied to the IMAP toolkit according
> to the instructions in the patchkit's README. I can not promise that
> this code works.
> ----------------------------------------------------------
>
>
>
>
> Previous Comments:
> ------------------------------------------------------------------------
>
> [2001-08-21 16:46:33] liamr@umich.edu
>
> I realized I should probably submit a patch that worked..
> it works with 4.0.6, but not 4.0.7dev. The tests that
> configure (4.0.7dev) runs to check for SSL support in
> c-client misidentifies the krb4 c-client as having ssl. I
> can configure and build 4.0.7dev if I disable the
> IMAP_CHK_SSL in ext/imap/config.m4 and rerun buildconf.
>
> configure: error: This c-client library is build with SSL
> support.
>
> Add --with-imap-ssl<=DIR> to your configure line.
>
> Check config.log for details.
> config.log:
> configure:25058: gcc -o conftest -g -O2
> -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib
> -R/usr/local/gnu/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2
> -L/usr/local/gnu/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2
> -R/usr/local/build/imap-2000c/lib
> -L/usr/local/build/imap-2000c/lib -R/usr/local/krb4/lib
> -L/usr/local/krb4/lib conftest.c -lcrypt -lpam -lcrypt
> -lresolv -lresolv -lm -ldl -lnsl -lsocket -lsocket -lgcc
> -lcrypt -ldes -lkrb -L/usr/local/build/imap-2000c/lib
> -lc-client 1>&5
> Undefined first referenced
> symbol in file
> tkt_string
> /usr/local/build/imap-2000c/lib/libc-client.a(osdep.o)
> (bunch of these for the krb4 functions). I think it's
> because it's put an -lcrypt where it doesn't belong and
> it's conflicting with some of the calls in the krb4 des
> library. Not sure tho..
>
> So.. here's the patch for 4.0.6.. again, it works as a cgi,
> but not as an apache server module, and i've no idea why.
> Trying to figure that part out..
>
> diff -p -N -U 4 -r ext/imap/config.m4
> ext/imap.krb4/config.m4
> --- ext/imap/config.m4 Mon May 21 20:38:46 2001
> +++ ext/imap.krb4/config.m4 Tue Aug 21 16:03:59 2001
> @@ -20,8 +20,25 @@ AC_DEFUN(IMAP_LIB_CHK,[
> fi
> done
> ])
>
> +AC_DEFUN(PHP_IMAP_KRB4_CHK, [
> + PHP_ARG_WITH(krb4,for KerberosIV support in IMAP,
> + [ --with-krb4[=DIR] IMAP: Include KerberosIV
> support.])
> +
> + if test "$PHP_KRB4" = "yes"; then
> + test -d /usr/kerberos && PHP_KRB4=/usr/kerberos
> + fi
> +
> + if test "$PHP_KRB4" != "no"; then
> + AC_DEFINE(HAVE_IMAP_KRB4,1,[ ])
> + PHP_ADD_LIBPATH($PHP_KRB4/lib, IMAP_SHARED_LIBADD)
> + PHP_ADD_LIBRARY(des, 1, IMAP_SHARED_LIBADD)
> + PHP_ADD_LIBRARY(krb, 1, IMAP_SHARED_LIBADD)
> + fi
> +])
> +
> +
> AC_DEFUN(PHP_IMAP_KRB_CHK, [
> PHP_ARG_WITH(kerberos,for Kerberos support in IMAP,
> [ --with-kerberos[=DIR] IMAP: Include Kerberos
> support.])
>
> @@ -134,7 +151,8 @@ if test "$PHP_IMAP" != "no"; then
>
> PHP_ADD_INCLUDE($IMAP_INC_DIR)
> PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD)
> PHP_ADD_LIBRARY_DEFER($IMAP_LIB)
> + PHP_IMAP_KRB4_CHK
> PHP_IMAP_KRB_CHK
> PHP_IMAP_SSL_CHK
> fi
> diff -p -N -U 4 -r ext/imap/php_imap.c
> ext/imap.krb4/php_imap.c
> --- ext/imap/php_imap.c Tue Aug 21 16:06:23 2001
> +++ ext/imap.krb4/php_imap.c Tue Aug 21 16:44:31 2001
> @@ -449,8 +449,9 @@ PHP_MINIT_FUNCTION(imap)
> #ifndef PHP_WIN32
> mail_link(&mmdfdriver); /* link in the mmdf
> driver */
> mail_link(&newsdriver); /* link in the news
> driver */
> mail_link(&philedriver); /* link in the
> phile driver */
> + auth_link(&auth_krb); /* link in the krb
> authenticator */
> auth_link(&auth_log); /* link in the log
> authenticator */
> auth_link(&auth_md5); /* link in the cram-md5
> authenticator */
> #ifdef HAVE_IMAP_SSL
> ssl_onceonlyinit ();
>
> ------------------------------------------------------------------------
>
> [2001-08-21 14:02:12] liamr@umich.edu
>
> the line wrapping might be a little off..
>
> this should allow php_imap.c to support a kerberized (krb4) c-client, with
> the appropriate configure options.
>
> it works with the CGI, but not the apache server module. i'm not sure why.
> we're trying to figure that part out.
> -----------------------------------------------------------
>
> diff -p -N -U 4 -r ext/imap/config.m4 ext/imap-krb4/config.m4
> --- ext/imap/config.m4 Tue Aug 21 12:41:18 2001
> +++ ext/imap-krb4/config.m4 Tue Aug 21 13:50:28 2001
> @@ -20,8 +20,37 @@ AC_DEFUN(IMAP_LIB_CHK,[
> fi
> done
> ])
>
> +AC_DEFUN(PHP_IMAP_KRB4_CHK, [
> + AC_ARG_WITH(krb4,
> + [ --with-krb4[=DIR] IMAP: Include KerberosIV support. DIR is the
> Kerber
> +os install dir.],[
> + PHP_KRB4=$withval
> + ],[
> + PHP_KRB4=no
> + ])
> +
> + if test "$PHP_KRB4" = "yes"; then
> + test -d /usr/kerberos && PHP_KERBEROS=/usr/kerberos
> + fi
> +
> + if test "$PHP_KRB4" != "no"; then
> + AC_DEFINE(HAVE_IMAP_KRB4,1,[ ])
> + PHP_ADD_LIBPATH($PHP_KRB4/lib, IMAP_SHARED_LIBADD)
> + PHP_ADD_LIBRARY(des, 1, IMAP_SHARED_LIBADD)
> + PHP_ADD_LIBRARY(krb, 1, IMAP_SHARED_LIBADD)
> + else
> + AC_EGREP_HEADER(auth_krb, $IMAP_INC_DIR/linkage.h, [
> + AC_MSG_ERROR(This c-client library is build with Kerberos support.
> +
> + Add --with-krb4<=DIR> to your configure line. Check config.log for
> det
> +ails.)
> + ])
> + fi
> +
> +])
> +
> AC_DEFUN(PHP_IMAP_KRB_CHK, [
> AC_ARG_WITH(kerberos,
> [ --with-kerberos[=DIR] IMAP: Include Kerberos support. DIR is the
> Kerberos install dir.],[
> PHP_KERBEROS=$withval
> @@ -163,7 +192,8 @@ if test "$PHP_IMAP" != "no"; then
>
> PHP_ADD_INCLUDE($IMAP_INC_DIR)
> PHP_ADD_LIBPATH($IMAP_LIBDIR, IMAP_SHARED_LIBADD)
> PHP_ADD_LIBRARY_DEFER($IMAP_LIB,, IMAP_SHARED_LIBADD)
> + PHP_IMAP_KRB4_CHK
> PHP_IMAP_KRB_CHK
> PHP_IMAP_SSL_CHK
> fi
> diff -p -N -U 4 -r ext/imap/php_imap.c ext/imap-krb4/php_imap.c
> --- ext/imap/php_imap.c Tue Aug 21 13:35:28 2001
> +++ ext/imap-krb4/php_imap.c Tue Aug 21 12:45:53 2001
> @@ -413,8 +413,9 @@ PHP_MINIT_FUNCTION(imap)
> /* mail_link(&mxdriver); */ /* According to c-client docs
> (internal.
> txt) this shouldn't be used. */
> mail_link(&mmdfdriver); /* link in the mmdf driver */
> mail_link(&newsdriver); /* link in the news driver */
> mail_link(&philedriver); /* link in the phile driver */
> + auth_link(&auth_krb); /* link in the krb authenticator */
> auth_link(&auth_md5); /* link in the cram-md5 authenticator
> */
> auth_link(&auth_log); /* link in the log authenticator */
> #ifdef HAVE_IMAP_SSL
> ssl_onceonlyinit ();
>
>
> ------------------------------------------------------------------------
>
>
>
> ATTENTION! Do NOT reply to this email!
> To reply, use the web interface found at
> http://bugs.php.net/?id=12883&edit=2
>