diff options
author | kent <kent> | 2002-06-24 18:38:36 +0000 |
---|---|---|
committer | kent <kent> | 2002-06-24 18:38:36 +0000 |
commit | c7b1249fe3a120f223ad443d0c3f2dce82d37f7b (patch) | |
tree | e31130bed46d0d4265bb1ecb87791c288d1ab0bf /www/web500gw | |
parent | f9237e26ca3893c579f970ca953f3d5a1ee05ece (diff) | |
download | pkgsrc-c7b1249fe3a120f223ad443d0c3f2dce82d37f7b.tar.gz |
Fixed Y2K problem. The modification solves a part of pkg/11574.
I gave up support of OpenLDAP v2....
Diffstat (limited to 'www/web500gw')
-rw-r--r-- | www/web500gw/Makefile | 8 | ||||
-rw-r--r-- | www/web500gw/distinfo | 5 | ||||
-rw-r--r-- | www/web500gw/patches/patch-ab | 49 | ||||
-rw-r--r-- | www/web500gw/patches/patch-ac | 100 |
4 files changed, 153 insertions, 9 deletions
diff --git a/www/web500gw/Makefile b/www/web500gw/Makefile index 11778a5cca0..3e4c47b5bae 100644 --- a/www/web500gw/Makefile +++ b/www/web500gw/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.8 2001/10/26 12:18:20 agc Exp $ +# $NetBSD: Makefile,v 1.9 2002/06/24 18:38:36 kent Exp $ DISTNAME= web500gw-2.1b3 +PKGREVISION= 1 CATEGORIES= www databases MASTER_SITES= ftp://ftp.tu-chemnitz.de/pub/Local/urz/web500gw/ @@ -8,6 +9,7 @@ MAINTAINER= packages@netbsd.org HOMEPAGE= http://www.tu-chemnitz.de/~fri/web500gw/ COMMENT= WWW to ldap gateway -DEPENDS+= openldap-1.2.*:../../databases/openldap1 - +#DEPENDS+= openldap-1.2.*:../../databases/openldap1 +.include "../../databases/openldap1/buildlink.mk" +#.include "../../databases/openldap/buildlink.mk" .include "../../mk/bsd.pkg.mk" diff --git a/www/web500gw/distinfo b/www/web500gw/distinfo index eddd7b980a7..586860187d8 100644 --- a/www/web500gw/distinfo +++ b/www/web500gw/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.3 2001/10/26 12:18:20 agc Exp $ +$NetBSD: distinfo,v 1.4 2002/06/24 18:38:36 kent Exp $ SHA1 (web500gw-2.1b3.tar.gz) = 417533e1bdecac8437119d49622c8e030937c6c0 Size (web500gw-2.1b3.tar.gz) = 143463 bytes SHA1 (patch-aa) = a6feaf33012a92cbf6839858922e5ac2fcf6c501 -SHA1 (patch-ab) = 51ed9b0d944c37b8a12ef0c8744f7a49ec001999 +SHA1 (patch-ab) = ef23806d3be7818f792a6ab750957b99a1c8e979 +SHA1 (patch-ac) = e8618b2e9c00f3ddce051a5a0ded48389284daee diff --git a/www/web500gw/patches/patch-ab b/www/web500gw/patches/patch-ab index 26e761c9655..b0f33bb6265 100644 --- a/www/web500gw/patches/patch-ab +++ b/www/web500gw/patches/patch-ab @@ -1,8 +1,37 @@ -$NetBSD: patch-ab,v 1.1.1.1 1999/01/08 14:15:57 hwr Exp $ +$NetBSD: patch-ab,v 1.2 2002/06/24 18:38:36 kent Exp $ ---- web500gw.h.orig Wed Oct 28 13:27:47 1998 -+++ web500gw.h Fri Jan 8 14:26:55 1999 -@@ -69,9 +69,9 @@ +--- web500gw.h.orig Wed Oct 28 21:27:47 1998 ++++ web500gw.h +@@ -22,6 +22,28 @@ + + #include "lber.h" + #include "ldap.h" ++#if defined(LDAP_VENDOR_VERSION) && (LDAP_VENDOR_VERSION >= 20000) ++# ifdef LDAP_DEBUG ++# undef LDAP_DEBUG ++# endif ++# define NULLTMPLITEM ((struct ldap_tmplitem *)0) ++# define LD_MATCHED(R) "(No info)" ++# define SET_SIZELIMIT(LD,V) do { \ ++ int value = V; \ ++ ldap_set_option(LD, LDAP_OPT_SIZELIMIT, &value); \ ++} while (0) ++# define SET_DEREF(LD,V) do { \ ++ int value = V; \ ++ ldap_set_option(LD, LDAP_OPT_DEREF, &value); \ ++} while (0) ++#else ++# ifndef LDAP_VENDOR_VERSION ++# define LDAP_VENDOR_VERSION 10000 ++# endif ++# define LD_MATCHED(R) (R)->r_ld->ld_matched ++# define SET_SIZELIMIT(LD,V) (LD)->ld_sizelimit = V ++# define SET_DEREF(LD,V) (LD)->ld_deref = V ++#endif + #include "disptmpl.h" + #include <stdio.h> + #include <stdarg.h> +@@ -69,9 +91,9 @@ #include <unistd.h> #endif /* USE_SYSCONF */ @@ -14,3 +43,15 @@ $NetBSD: patch-ab,v 1.1.1.1 1999/01/08 14:15:57 hwr Exp $ #include "messages.h" extern char *msg[]; +@@ -456,7 +478,11 @@ + char *c_helpfile; /* name of helpfile */ + char *c_attrfile; /* name of helpfile for attributes */ + char *c_friendlyfile; /* name of friendlyfile */ ++#if LDAP_VENDOR_VERSION < 20000 + FriendlyMap *c_fm; ++#else ++ LDAPFriendlyMap *c_fm; ++#endif + char *c_messagefile; /* name of messagefile */ + char *c_msg[MSG_count + 1]; + char **c_errmsg; diff --git a/www/web500gw/patches/patch-ac b/www/web500gw/patches/patch-ac new file mode 100644 index 00000000000..687db6c2876 --- /dev/null +++ b/www/web500gw/patches/patch-ac @@ -0,0 +1,100 @@ +$NetBSD: patch-ac,v 1.1 2002/06/24 18:38:36 kent Exp $ + +--- util.c.orig Tue Jun 25 01:16:57 2002 ++++ util.c +@@ -465,6 +465,7 @@ + char mydate[256]; + struct tm tm, *ntm; + time_t t; ++ int ds_off; /* date string offset */ + + #ifdef WEB500GW_DEBUG + Web500gw_debug(WEB500GW_DEBUG_UTIL, " format_date (%s, \"%s\")\n", +@@ -473,15 +474,22 @@ + if (!s) + return(NULL); + +- /* s should point to: YYMMDDHHmmSSZ */ ++ /* s should point to: YYMMDDHHmmSSZ (13 chars) */ + /* ... well 2 digits for year :-( */ +- +- tm.tm_year = 10*(s[0] - '0') + (s[1] - '0'); +- tm.tm_mon = 10*(s[2] - '0') + (s[3] - '0') - 1; +- tm.tm_mday = 10*(s[4] - '0') + (s[5] - '0'); +- tm.tm_hour = 10*(s[6] - '0') + (s[7] - '0'); +- tm.tm_min = 10*(s[8] - '0') + (s[9] - '0'); +- tm.tm_sec = 10*(s[10] - '0') + (s[11] - '0'); ++ /* or: YYYYMMDDHHmmSSZ (15 chars; 4-digit years) */ ++ if (strlen(s) == 13) { ++ tm.tm_year = 10*(s[0] - '0') + (s[1] - '0'); ++ ds_off = 2; ++ } else { ++ tm.tm_year = 1000*(s[0] - '0') + 100*(s[1] - '0') + ++ 10*(s[2] - '0') + (s[3] - '0'); ++ ds_off = 4; ++ } ++ tm.tm_mon = 10*(s[ds_off] - '0') + (s[ds_off+1] - '0') - 1; ++ tm.tm_mday = 10*(s[ds_off+2] - '0') + (s[ds_off+3] - '0'); ++ tm.tm_hour = 10*(s[ds_off+4] - '0') + (s[ds_off+5] - '0'); ++ tm.tm_min = 10*(s[ds_off+6] - '0') + (s[ds_off+7] - '0'); ++ tm.tm_sec = 10*(s[ds_off+8] - '0') + (s[ds_off+9] - '0'); + tm.tm_isdst = 0; + + #if ! (defined(__hpux) || defined(_AIX) || defined(sunos5) || defined(linux) || defined(unixware7)) +@@ -524,6 +532,7 @@ + char month_name[4]; + int year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0; + int i = 0; ++ int ds_off; /* date string offset */ + + #ifdef WEB500GW_DEBUG + Web500gw_debug(WEB500GW_DEBUG_UTIL, " cmp_dates (%s, %s)\n", +@@ -554,7 +563,8 @@ + &day, month_name, &year, &hour, &min, &sec); + if (year < 70) + year += 100; +- year += 1900; ++ if (year < 1900) ++ year += 1900; + } else { /* normal HTTP date (RFC 822/1123): dd Mmm yyyy hh:mm:ss */ + sscanf(http_date, "%d %s %d %d:%d:%d", + &day, month_name, &year, &hour, &min, &sec); +@@ -568,17 +578,31 @@ + day, month, year, 0); + Web500gw_debug(WEB500GW_DEBUG_UTIL, "%d:%d:%d\n", hour, min, sec, 0); + #endif +- if ((i = ((10*(ldap_date[0] - '0') + (ldap_date[1] - '0') + 1900) - year))) +- return i > 0; +- if ((i = ((10*(ldap_date[2] - '0') + (ldap_date[3] - '0')) - month))) ++ /* ldap_date should point to: YYMMDDHHmmSSZ (13 chars) */ ++ /* ... well 2 digits for year :-( */ ++ /* or: YYYYMMDDHHmmSSZ (15 chars; 4-digit years) */ ++ if (strlen(ldap_date) == 13) { ++ ds_off=2; ++ if ((i = ((10*(ldap_date[0] - '0') + (ldap_date[1] - '0') + 1900) - year))) ++ return i > 0; ++ } else { ++ ds_off=4; ++ if ((i = ((1000*(ldap_date[0] - '0') + ++ 100*(ldap_date[1] - '0') + ++ 10*(ldap_date[2] - '0') + ++ (ldap_date[3] - '0')) - year ))) ++ return i > 0; ++ } ++ ++ if ((i = ((10*(ldap_date[ds_off] - '0') + (ldap_date[ds_off+1] - '0')) - month))) + return i > 0; +- if ((i = ((10*(ldap_date[4] - '0') + (ldap_date[5] - '0')) - day))) ++ if ((i = ((10*(ldap_date[ds_off+2] - '0') + (ldap_date[ds_off+3] - '0')) - day))) + return i > 0; +- if ((i = ((10*(ldap_date[6] - '0') + (ldap_date[7] - '0')) - hour))) ++ if ((i = ((10*(ldap_date[ds_off+4] - '0') + (ldap_date[ds_off+5] - '0')) - hour))) + return i > 0; +- if ((i = ((10*(ldap_date[8] - '0') + (ldap_date[9] - '0')) - min))) ++ if ((i = ((10*(ldap_date[ds_off+6] - '0') + (ldap_date[ds_off+7] - '0')) - min))) + return i > 0; +- if ((i = ((10*(ldap_date[10] - '0') + (ldap_date[11] - '0')) - sec))) ++ if ((i = ((10*(ldap_date[ds_off+8] - '0') + (ldap_date[ds_off+9] - '0')) - sec))) + return i > 0; + + /* gone so far - dates are identical */ |