Re: cvs: php4 /ext/vpopmail config.m4 php_vpopmail.c
| From: | Markus Fischer | Date: | Wed, 20 Mar 2002 06:48:22 +0000 |
| Subject: | Re: cvs: php4 /ext/vpopmail config.m4 php_vpopmail.c | ||
| References: | 1 2 | Groups: | php.cvs php.qa |
| Request: | Send a blank email to php-cvs+get-10454@lists.php.net to get a copy of this message | ||
[cc'ing to QA]
I was thinking about it .. because vpopmail 5.2 is already
out quite for a while and it would make sense if the next PHP
release would support it.
QA: Can someone verify this changes if they work as expected?
Though I made sure it should work, I don't have a working
environment right now and the create of bug 16120 still
didn't response to this changes.
- Markus
On Wed, Mar 20, 2002 at 07:39:01AM +0100, derick@php.net wrote :
> Hello,
>
> does it make sense to merge this to the branch?
>
> Derick
>
> On Tue, 19 Mar 2002, Markus Fischer wrote:
>
> > mfischer Tue Mar 19 17:47:39 2002 EDT
> >
> > Modified files:
> > /php4/ext/vpopmail config.m4 php_vpopmail.c
> > Log:
> > - Support vpopmail 5.2 (fixes #16120).
> >
> >
> >
> > Index: php4/ext/vpopmail/config.m4
> > diff -u php4/ext/vpopmail/config.m4:1.11 php4/ext/vpopmail/config.m4:1.12
> > --- php4/ext/vpopmail/config.m4:1.11 Sun Mar 17 03:33:24 2002
> > +++ php4/ext/vpopmail/config.m4 Tue Mar 19 17:47:34 2002
> > @@ -1,5 +1,5 @@
> > dnl
> > -dnl $Id: config.m4,v 1.11 2002/03/17 08:33:24 mfischer Exp $
> > +dnl $Id: config.m4,v 1.12 2002/03/19 22:47:34 mfischer Exp $
> > dnl
> >
> > PHP_ARG_WITH(vpopmail, for vpopmail support,
> > @@ -22,20 +22,28 @@
> > VPOPMAIL_LIB_DIR=$i/lib
> > fi
> >
> > - if test -r $i/vadddomain; then
> > + if test -x $i/vadddomain; then
> > VPOPMAIL_BIN_DIR=$i
> > - elif test -r $i/bin/vadddomain; then
> > + elif test -x $i/bin/vadddomain; then
> > VPOPMAIL_BIN_DIR=$i/bin
> > fi
> > done
> >
> > - for i in "$VPOPMAIL_INC_DIR/vpopmail.h"
> > "$VPOPMAIL_INC_DIR/vpopmail_config.h" "$VPOPMAIL_LIB_DIR/libvpopmail.a"
> > "$VPOPMAIL_BIN_DIR/vadddomain" "$VPOPMAIL_BIN_DIR/vaddaliasdomain"
> > "$VPOPMAIL_BIN_DIR/vdeldomain" ; do
> > + for i in "$VPOPMAIL_INC_DIR/vpopmail.h"
> > "$VPOPMAIL_INC_DIR/vpopmail_config.h" "$VPOPMAIL_LIB_DIR/libvpopmail.a"; do
> > if test ! -r "$i"; then
> > AC_MSG_ERROR(Could not find '$i'. Please make sure you have vpopmail
> > installed. Use
> > ./configure --with-vpopmail=<vpopmail-home-dir> if necessary)
> > fi
> > done
> >
> > + for i in "$VPOPMAIL_BIN_DIR/vadddomain"
> > "$VPOPMAIL_BIN_DIR/vaddaliasdomain" "$VPOPMAIL_BIN_DIR/vdeldomain" ; do
> > + if test ! -x "$i"; then
> > + AC_MSG_ERROR(Could not find '$i' or binary not executeable under current
> > user.
> > +Please make sure you have vpopmail properly installed.
> > +Use ./configure --with-vpopmail=<vpopmail-home-dir> if necessary)
> > + fi
> > + done
> > +
> > AC_MSG_RESULT($VPOPMAIL_DIR)
> >
> > dnl newer versions of vpopmail have include/vauth.h defining valias functions
> > @@ -56,6 +64,31 @@
> >
> > AC_DEFINE(HAVE_VPOPMAIL,1,[Whether you have vpopmail])
> > AC_DEFINE_UNQUOTED(VPOPMAIL_BIN_DIR,"$VPOPMAIL_BIN_DIR",[vpopmail bin path])
> > +
> > + dnl Detect if we have vpopmail >= 5.2 to accomodate C-API changes
> > + dnl
> > + dnl The current table is:
> > + dnl
> > + dnl PHP API VPOPMAIL VERSION
> > + dnl 1 < 5.2
> > + dnl 2 >= 5.2
> > + vpopmail_internal_api=1
> > + version=
grep VERSION $VPOPMAIL_INC_DIR/vpopmail_config.h
> > + if test -n "$version"; then
> > + version_major=echo "$version" | sed
> > 's/^[[^"]]\+"\([[0-9]]\+\)\.[[0-9]]\+"/\1/';
> > + version_minor=echo "$version" | sed
> > 's/^[[^"]]\+"[[0-9]]\+\.\([[0-9]]\+\)"/\1/'
> > + if test $version_major -ge 5; then
> > + if test $version_major -eq 5; then
> > + if test $version_minor -ge 2; then
> > + vpopmail_internal_api=2
> > + fi
> > + fi
> > + if test $version_major -gt 5; then
> > + vpopmail_internal_api=2
> > + fi
> > + fi
> > + fi
> > + AC_DEFINE_UNQUOTED(HAVE_VPOPMAIL_API,$vpopmail_internal_api,[Interal definition for
> > vpopmail API changes])
> >
> > PHP_NEW_EXTENSION(vpopmail, php_vpopmail.c, $ext_shared)
> > fi
> > Index: php4/ext/vpopmail/php_vpopmail.c
> > diff -u php4/ext/vpopmail/php_vpopmail.c:1.25 php4/ext/vpopmail/php_vpopmail.c:1.26
> > --- php4/ext/vpopmail/php_vpopmail.c:1.25 Tue Mar 12 22:51:21 2002
> > +++ php4/ext/vpopmail/php_vpopmail.c Tue Mar 19 17:47:36 2002
> > @@ -17,7 +17,7 @@
> > +----------------------------------------------------------------------+
> > */
> >
> > -/* $Id: php_vpopmail.c,v 1.25 2002/03/13 03:51:21 bbonev Exp $ */
> > +/* $Id: php_vpopmail.c,v 1.26 2002/03/19 22:47:36 mfischer Exp $ */
> >
> > /* TODO: move to config.m4 when support for old versions is ready or just
> > * don't support rather old vpopmail. current version must bail out if
> > @@ -285,7 +285,11 @@
> > RETURN_FALSE;
> > }
> >
> > +#if (!defined(HAVE_VPOPMAIL_API) || HAVE_VPOPMAIL_API == 1)
> > if (add_domain_assign(Z_STRVAL_PP(aliasdomain), Dir, uid, gid) != 1) {
> > +#else
> > + if (add_domain_assign(Z_STRVAL_PP(aliasdomain), Z_STRVAL_PP(domain), Dir, uid, gid) !=
> > 1) {
> > +#endif
> > php_error(E_WARNING, "vpopmail_addaliasdomain could not add domain to control
> > files");
> > VPOPMAILG(vpopmail_errno) = 1;
> > RETURN_FALSE;
> > @@ -922,7 +926,7 @@
> > }
> > /* }}} */
> >
> > -#endif HAVE_VPOPMAIL
> > +#endif /* HAVE_VPOPMAIL */
> >
> > /*
> > * Local variables:
> >
> >
> >
> > --
> > PHP CVS Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> -----------------------------------------------------------------------
> PHP: Scripting the Web - derick@php.net
> All your branches are belong to me!
> SRM: Script Running Machine - www.vl-srm.net
> -----------------------------------------------------------------------
--
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc