summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes7
-rw-r--r--LDAPapi.pm78
-rw-r--r--LDAPapi.xs149
-rw-r--r--Makefile.PL2
-rw-r--r--README6
-rw-r--r--debian/changelog63
-rw-r--r--debian/compat1
-rw-r--r--debian/control25
-rw-r--r--debian/copyright17
-rw-r--r--debian/patches/10-t64.patch31
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules24
-rw-r--r--debian/source/format1
-rw-r--r--debian/upstream/metadata2
-rw-r--r--debian/watch6
15 files changed, 264 insertions, 149 deletions
diff --git a/Changes b/Changes
index 7ba0723..1bdb886 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,11 @@
Revision history for Perl5 Net::LDAPapi Module.
+3.0.7 Thu Oct 10 10:06:00 PST 2019
+ - Fix undeclared variables introduced in fixes for Issue #51
+3.0.6 Mon Oct 07 10:03:00 PST 2019
+ - Fix memory leaks (Issue #51)
+3.0.5 Fri Dec 01 10:03:00 PST 2017
+ - Fix cookie handling with MMR configuration
+ - Fix ASN1 encoding of sync cookie
3.0.4 Mon Nov 30 19:00:00 PST 2015
- Fix undef comparison
- Misc variable initializations to quiet warnings
diff --git a/LDAPapi.pm b/LDAPapi.pm
index 6e01fb7..7cd1582 100644
--- a/LDAPapi.pm
+++ b/LDAPapi.pm
@@ -232,7 +232,7 @@ require AutoLoader;
LDAP_TAG_IM_RES_VALUE
LDAP_TAG_SASL_RES_CREDS
);
-$VERSION = '3.0.4';
+$VERSION = '3.0.7';
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -296,7 +296,10 @@ sub new
syncCookie ::= OCTET STRING
syncRequestValue ::= SEQUENCE {
- mode ENUMERATED,
+ mode ENUMERATED {
+ refreshOnly (1),
+ refreshAndPersist (3)
+ },
cookie syncCookie OPTIONAL,
reloadHint BOOLEAN
}
@@ -881,11 +884,9 @@ sub next_changed_entries {
$cookie = $syncStateValues->{'cookie'};
if( $cookie ) {
# save the cookie
- open(COOKIE_FILE,">".$self->{"cookie"}) ||
- die("Cannot open file '".$self->{"cookie"}."' for writing.");
- print COOKIE_FILE $cookie;
- close(COOKIE_FILE);
+ save_cookie($cookie, $self->{"cookie"});
}
+ ldap_control_free($ctrl);
}
} elsif( $msgtype eq $self->LDAP_RES_INTERMEDIATE ) {
@@ -916,10 +917,7 @@ sub next_changed_entries {
# see if we got any and save it.
if( $cookie ) {
- open(COOKIE_FILE,">".$self->{"cookie"}) ||
- die("Cannot open file '".$self->{"cookie"}."' for writing.");
- print COOKIE_FILE $cookie;
- close(COOKIE_FILE);
+ save_cookie($cookie, $self->{"cookie"});
}
}
}
@@ -928,6 +926,52 @@ sub next_changed_entries {
return @entries;
} # next_changed_entries
+sub save_cookie
+{
+ my ($self,@args) = @_;
+ my $cookiestr = $_[0];
+ my $cookie = $_[1];
+
+ # Skip all if there's no csn value
+ if ($cookiestr =~ m/csn=/) {
+
+ # Get new CSN array and a copy
+ chomp(my @newcsns = split(';',$cookiestr =~ s/(rid=\d{3},)|(sid=\d{3},)|(csn=)//rg));
+
+ # These will be the CSNs to write to the cookie file
+ # All CSNs from the new cookie must be used
+ # my @outcsns = @newcsns;
+ my @outcsns = @newcsns;
+
+ # Get the old cookie for comparison/persisting
+ if (-w $cookie) {
+ open(COOKIE_FILE, "<", $cookie) || die("Cannot open file '".$cookie."' for reading.");
+ chomp(my @oldcsns = <COOKIE_FILE>);
+ close(COOKIE_FILE);
+
+ # Look for old CSNs with SIDs that don't match any of the new
+ # CSNs. If there are no matches, push the old CSN to the list
+ # of CSNs to be written to the cookie file.
+ foreach my $oldcsn (@oldcsns) {
+ my $match = 0;
+ my $p_sid = ($oldcsn =~ /(#\d{3}#)/i)[0];
+ foreach my $newcsn (@newcsns) {
+ if ($newcsn =~ m/\Q$p_sid/) {
+ $match = 1;
+ last;
+ }
+ }
+ if (!$match) { push @outcsns,$oldcsn; }
+ }
+ }
+
+ # Write the cookie
+ open(COOKIE_FILE, ">", $cookie) || die("Cannot open file '".$cookie."' for writing.");
+ print COOKIE_FILE "$_\n" for @outcsns;
+ close(COOKIE_FILE);
+ }
+} # end save_cookie
+
sub first_entry
{
@@ -1529,14 +1573,15 @@ sub listen_for_changes
my ($msgid, $status, $sctrls, $the_cookie, $syncRequestBerval);
my ($basedn, $scope, $filter, $attrs,
- $attrsonly, $timeout, $sizelimit, $cookie) =
+ $attrsonly, $timeout, $sizelimit, $cookie, $rid) =
$self->rearrange(['BASEDN', 'SCOPE', 'FILTER', 'ATTRS',
- 'ATTRSONLY', 'TIMEOUT', 'SIZELIMIT', 'COOKIE'], @args);
+ 'ATTRSONLY', 'TIMEOUT', 'SIZELIMIT', 'COOKIE', 'RID'], @args);
croak("No Filter Specified") if (!defined($filter));
croak("No cookie file specified") unless $cookie;
$self->{"cookie"} = $cookie;
+ $self->{"rid"} = defined($rid) ? $rid : '000';
if( !defined($attrs) ) {
my @null_array = ();
@@ -1545,7 +1590,10 @@ sub listen_for_changes
# load cookie from the file
if( open(COOKIE, $cookie) ) {
- read COOKIE, $the_cookie, 1024, 0;
+ chomp(my @csns = <COOKIE>);
+ if (scalar(@csns)) {
+ $the_cookie = sprintf("rid=%d,csn=%s",$rid,join(';',@csns));
+ }
} else {
warn "Failed to open file '".$cookie."' for reading.\n";
}
@@ -1555,9 +1603,9 @@ sub listen_for_changes
# refreshAndPersist mode
if( $the_cookie ) { # we have the cookie
- $syncRequestBerval = $asn->encode(mode => 3, cookie => $the_cookie, reloadHint => 1);
+ $syncRequestBerval = $syncRequestValue->encode(mode => 3, cookie => $the_cookie, reloadHint => 1);
} else {
- $syncRequestBerval = $asn->encode(mode => 3, reloadHint => 1);
+ $syncRequestBerval = $syncRequestValue->encode(mode => 3, reloadHint => 1);
}
my $ctrl_persistent =
diff --git a/LDAPapi.xs b/LDAPapi.xs
index 9de1944..2e2d127 100644
--- a/LDAPapi.xs
+++ b/LDAPapi.xs
@@ -334,11 +334,9 @@ ldap_b2_interact(LDAP *ld, unsigned flags, void *def, void *inter)
return LDAP_SUCCESS;
}
-static struct timeval *
-sv2timeval(SV *data)
+static void
+sv2timeval(SV *data, struct timeval *tv)
{
- struct timeval *tv = NULL;
-
if (SvPOK(data))
{
/* set the NV flag if it's readable as a double */
@@ -346,13 +344,9 @@ sv2timeval(SV *data)
}
if (SvIOK(data) || SvNOK(data)) {
- Newx(tv, 1, struct timeval);
-
tv->tv_sec = SvIV(data);
tv->tv_usec = ((SvNV(data) - SvIV(data))*1000000);
}
-
- return tv;
}
static SV *
@@ -415,7 +409,7 @@ ldap_set_option(ld,option,optdata)
{
void *optptr = NULL;
- bool must_safefree = 0;
+ struct timeval tv;
int sv_i;
@@ -424,8 +418,8 @@ ldap_set_option(ld,option,optdata)
#ifdef OPENLDAP
case LDAP_OPT_TIMEOUT:
case LDAP_OPT_NETWORK_TIMEOUT:
- optptr = (void *) sv2timeval(optdata);
- must_safefree = 1;
+ sv2timeval(optdata, &tv);
+ optptr = (void *)&tv;
break;
#endif
@@ -440,11 +434,6 @@ ldap_set_option(ld,option,optdata)
}
RETVAL = ldap_set_option(ld,option,optptr);
-
- if (must_safefree)
- {
- Safefree(optptr);
- }
}
OUTPUT:
RETVAL
@@ -704,7 +693,7 @@ ldap_search_ext(ld, base, scope, filter, attrs, attrsonly, sctrls, cctrls, timeo
char **attrs_char;
SV **current;
int arraylen,count;
- struct timeval *tv_timeout = NULL;
+ struct timeval tv_timeout;
if (SvTYPE(SvRV(attrs)) != SVt_PVAV)
{
@@ -726,12 +715,11 @@ ldap_search_ext(ld, base, scope, filter, attrs, attrsonly, sctrls, cctrls, timeo
attrs_char[arraylen+1] = NULL;
}
- tv_timeout = sv2timeval(timeout);
+ sv2timeval(timeout, &tv_timeout);
RETVAL = ldap_search_ext(ld, base, scope, filter, attrs_char,
- attrsonly, sctrls, cctrls, tv_timeout, sizelimit,
+ attrsonly, sctrls, cctrls, &tv_timeout, sizelimit,
&msgidp);
- Safefree(tv_timeout);
Safefree(attrs_char);
}
OUTPUT:
@@ -756,7 +744,7 @@ ldap_search_ext_s(ld, base, scope, filter, attrs, attrsonly, sctrls, cctrls, tim
char **attrs_char;
SV **current;
int arraylen,count;
- struct timeval *tv_timeout = NULL;
+ struct timeval tv_timeout;
if (SvTYPE(SvRV(attrs)) == SVt_PVAV)
{
@@ -778,11 +766,10 @@ ldap_search_ext_s(ld, base, scope, filter, attrs, attrsonly, sctrls, cctrls, tim
XSRETURN(1);
}
- tv_timeout = sv2timeval(timeout);
+ sv2timeval(timeout, &tv_timeout);
- RETVAL = ldap_search_ext_s(ld,base,scope,filter,attrs_char,attrsonly,sctrls,cctrls,tv_timeout,sizelimit,&res);
+ RETVAL = ldap_search_ext_s(ld,base,scope,filter,attrs_char,attrsonly,sctrls,cctrls,&tv_timeout,sizelimit,&res);
- Safefree(tv_timeout);
Safefree(attrs_char);
}
OUTPUT:
@@ -903,12 +890,11 @@ ldap_result(ld, msgid, all, timeout, result)
LDAPMessage * result = NO_INIT
CODE:
{
- struct timeval *tv_timeout = NULL;
+ struct timeval tv_timeout;
- tv_timeout = sv2timeval(timeout);
+ sv2timeval(timeout, &tv_timeout);
- RETVAL = ldap_result(ld, msgid, all, tv_timeout, &result);
- Safefree(tv_timeout);
+ RETVAL = ldap_result(ld, msgid, all, &tv_timeout, &result);
}
OUTPUT:
RETVAL
@@ -1046,11 +1032,7 @@ ldap_get_entry_controls(ld, entry, serverctrls_ref)
AV *serverctrls_av = (AV *)SvRV(serverctrls_ref);
- LDAPControl **serverctrls = malloc(sizeof(LDAPControl **));
- if( serverctrls == NULL ) {
- croak("In ldap_parse_result(...) failed to allocate memory for serverctrls.");
- XSRETURN(-1);
- }
+ LDAPControl **serverctrls = NULL;
RETVAL = ldap_get_entry_controls( ld, entry, &serverctrls);
@@ -1072,8 +1054,8 @@ ldap_parse_result(ld, msg, errorcodep, matcheddnp, errmsgp, referrals_ref, serve
LDAP * ld
LDAPMessage * msg
int errorcodep = NO_INIT
- char * matcheddnp = NO_INIT
- char * errmsgp = NO_INIT
+ SV * matcheddnp
+ SV * errmsgp
SV * referrals_ref
SV * serverctrls_ref
int freeit
@@ -1095,23 +1077,13 @@ ldap_parse_result(ld, msg, errorcodep, matcheddnp, errmsgp, referrals_ref, serve
AV *serverctrls_av = (AV *)SvRV(serverctrls_ref);
AV *referrals_av = (AV *)SvRV(referrals_ref);
-
- LDAPControl **serverctrls = malloc(sizeof(LDAPControl **));
- if( serverctrls == NULL ) {
- croak("In ldap_parse_result(...) failed to allocate memory for serverctrls.");
- XSRETURN(-1);
- }
-
- char **referrals = malloc(sizeof(char **));
- if( referrals == NULL ) {
- croak("In ldap_parse_result(...) failed to allocate memory for referrals.");
- free(referrals);
- XSRETURN(-1);
- }
+ char *matcheddn = NULL, *errmsg = NULL;
+ LDAPControl **serverctrls = NULL;
+ char **referrals = NULL;
RETVAL =
- ldap_parse_result(ld, msg, &errorcodep, &matcheddnp,
- &errmsgp, &referrals, &serverctrls, freeit);
+ ldap_parse_result(ld, msg, &errorcodep, &matcheddn,
+ &errmsg, &referrals, &serverctrls, freeit);
// transfer returned referrals to the perl code
if( referrals != NULL ) {
@@ -1125,6 +1097,14 @@ ldap_parse_result(ld, msg, errorcodep, matcheddnp, errmsgp, referrals_ref, serve
av_push(serverctrls_av, newSViv((IV)serverctrls[i]));
}
+ if (matcheddn) {
+ sv_setpv(matcheddnp, matcheddn);
+ free(matcheddn);
+ }
+ if (errmsg) {
+ sv_setpv(errmsgp, errmsg);
+ free(errmsg);
+ }
free(serverctrls);
free(referrals);
@@ -1141,41 +1121,42 @@ int
ldap_parse_extended_result(ld, msg, retoidp, retdatap, freeit)
LDAP * ld
LDAPMessage * msg
- char * retoidp = NO_INIT
- char * retdatap = NO_INIT
+ SV * retoidp
+ SV * retdatap
int freeit
CODE:
{
- struct berval *retdata;
+ struct berval *retdata = NULL;
+ char *retoid;
- retdata = ber_memalloc(sizeof(struct berval *));
-
RETVAL =
- ldap_parse_extended_result(ld, msg, &retoidp,
+ ldap_parse_extended_result(ld, msg, &retoid,
&retdata, freeit);
- if (retdata != NULL)
- retdatap = ldap_strdup(retdata->bv_val);
-
- ber_memfree(retdata);
+ sv_setpv(retoidp, retoid);
+ if (retdata != NULL) {
+ sv_setpvn(retdatap, retdata->bv_val, retdata->bv_len);
+ ber_bvfree(retdata);
+ }
}
OUTPUT:
RETVAL
retoidp
- retdatap
+ retdatap
int
ldap_parse_intermediate(ld, msg, retoidp, retdatap, serverctrls_ref, freeit)
LDAP * ld
LDAPMessage * msg
- char * retoidp = NO_INIT
- char * retdatap = NO_INIT
+ SV * retoidp
+ SV * retdatap
SV * serverctrls_ref
int freeit
CODE:
{
int i;
- struct berval *retdata;
+ struct berval *retdata = NULL;
+ char *retoid;
if (SvTYPE(SvRV(serverctrls_ref)) != SVt_PVAV)
{
@@ -1185,20 +1166,17 @@ ldap_parse_intermediate(ld, msg, retoidp, retdatap, serverctrls_ref, freeit)
AV *serverctrls_av = (AV *)SvRV(serverctrls_ref);
- LDAPControl **serverctrls = malloc(sizeof(LDAPControl **));
- if( serverctrls == NULL ) {
- croak("In ldap_parse_intermediate(...) failed to allocate memory for serverctrls.");
- XSRETURN(-1);
- }
-
- retdata = malloc(sizeof(struct berval *));
+ LDAPControl **serverctrls = NULL;
RETVAL =
- ldap_parse_intermediate(ld, msg, &retoidp,
+ ldap_parse_intermediate(ld, msg, &retoid,
&retdata, &serverctrls, freeit);
- if( retdata != NULL )
- retdatap = ldap_strdup(retdata->bv_val);
+ sv_setpv(retoidp, retoid);
+ if( retdata != NULL ) {
+ sv_setpvn(retdatap, retdata->bv_val, retdata->bv_len);
+ ber_bvfree(retdata);
+ }
// transfer returned controls to the perl code
if( serverctrls != NULL ) {
@@ -1207,7 +1185,7 @@ ldap_parse_intermediate(ld, msg, retoidp, retdatap, serverctrls_ref, freeit)
}
free(serverctrls);
- free(retdata);
+ free(retoid);
SvRV( serverctrls_ref ) = (SV *)serverctrls_av;
}
@@ -1220,20 +1198,18 @@ int
ldap_parse_whoami(ld, msg, authzid)
LDAP * ld
LDAPMessage * msg
- char * authzid = NO_INIT
+ SV * authzid
CODE:
{
- struct berval *retdata;
+ struct berval *retdata = NULL;
- retdata = ber_memalloc(sizeof(struct berval *));
-
RETVAL =
ldap_parse_whoami(ld, msg, &retdata);
- if (retdata != NULL)
- authzid = ldap_strdup(retdata->bv_val);
-
- ber_memfree(retdata);
+ if (retdata != NULL) {
+ sv_setpvn(authzid, retdata->bv_val, retdata->bv_len);
+ ber_bvfree(retdata);
+ }
}
OUTPUT:
RETVAL
@@ -1676,12 +1652,11 @@ ldap_url_search_st(ld,url,attrsonly,timeout,result)
LDAPMessage * result = NO_INIT
CODE:
{
- struct timeval *tv_timeout = NULL;
+ struct timeval tv_timeout;
- tv_timeout = sv2timeval(timeout);
+ sv2timeval(timeout, &tv_timeout);
- RETVAL = ldap_url_search_st(ld,url,attrsonly,tv_timeout,&result);
- Safefree(tv_timeout);
+ RETVAL = ldap_url_search_st(ld,url,attrsonly,&tv_timeout,&result);
}
OUTPUT:
RETVAL
diff --git a/Makefile.PL b/Makefile.PL
index fcb8f8c..089240e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -124,7 +124,7 @@ WriteMakefile(
'DEFINE' => '-DMOZILLA_LDAP',
) : (
'LIBS' => ["-L$lib_ldap $ldap_lib"],
- 'DEFINE' => '-DOPENLDAP',
+ 'DEFINE' => '-DOPENLDAP -DLDAP_DEPRECATED=1',
)),
'depend' => { 'LDAPapi.c' => 'constant.h' },
'clean' => { 'FILES' => 'constant.h' },
diff --git a/README b/README
index 5756693..35221d4 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
=======================================================================
- Net::LDAPapi Module v3.0.x for Perl5
- by Quanah Gibson-Mount @ Zimbra, Inc.
+ Net::LDAPapi Module v3.0.7 for Perl5
+ by Quanah Gibson-Mount @ Symas, Inc.
based on version 2.00 by Quanah Gibson-Mount @ Stanford University
based on version 1.50 by Howard Chu @ Symas Corporation
based on version 1.43 by Clayton Donley, <donley@wwa.com>
@@ -8,7 +8,7 @@
COPYRIGHT
=========
-
+ Copyright (c) 2017-2109 Quanah Gibson-Mount. All rights reserved
Copyright (c) 2007 Quanah Gibson-Mount. All rights reserved
Copyright (c) 2007 Board of Trustees, Leland Stanford Jr. University
Copyright (c) 2003 Howard Chu. All rights reserved.
diff --git a/debian/changelog b/debian/changelog
index e62682f..62dd44a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,61 @@
+libnet-ldapapi-perl (3.0.7-4) unstable; urgency=medium
+
+ [ Bill MacAllister ]
+ * Add patch to enable prototypes for deprecated functions, fixing builds
+ with the latest dpkg. (Closes: #1066630)
+
+ -- Russ Allbery <rra@debian.org> Sat, 06 Apr 2024 20:54:07 -0700
+
+libnet-ldapapi-perl (3.0.7-3) unstable; urgency=medium
+
+ [ Debian Janitor ]
+ * Set upstream metadata fields: Repository-Browse.
+ * Use canonical URL in Vcs-Git.
+
+ [ Russ Allbery ]
+ * Update standards version to 4.6.2 (no changes required).
+ * Add Bug-Database field to upstream metadata.
+
+ -- Russ Allbery <rra@debian.org> Tue, 20 Dec 2022 08:52:56 -0800
+
+libnet-ldapapi-perl (3.0.7-2) unstable; urgency=medium
+
+ * Update to debhelper compatibility level v13.
+ - Depend on debhelper-compat instead of using debian/compat.
+ * Update debian/watch to version 4 and point to GitHub instead of
+ SourceForge.
+ * Update source URL in debian/copyright.
+ * Add Vcs-* headers for the packaging repository.
+ * Update standards version to 4.5.1 (no changes required).
+
+ -- Russ Allbery <rra@debian.org> Thu, 24 Dec 2020 17:08:50 -0800
+
+libnet-ldapapi-perl (3.0.7-1) unstable; urgency=medium
+
+ * Import new upstream release.
+ * Remove obsolete Debian version patch.
+
+ -- Bill MacAllister <bill@ca-zephyr.org> Tue, 14 Jan 2020 08:05:29 +0000
+
+libnet-ldapapi-perl (3.0.5-1) unstable; urgency=medium
+
+ [ Bill MacAllister ]
+ * New upstream release.
+ * Fix cookie handling with MMR configuration
+ * Fix ASN1 encoding of sync cookie
+
+ [ Russ Allbery ]
+ * Enable bindnow build hardening.
+ * Remove unnecessary quilt build dependency.
+ * Update debhelper compatibility level to V11.
+ - Remove unnecessary binary-arch target.
+ * Add Rules-Requires-Root: no.
+ * Update debian/copyright to copyright-format 1.0.
+ * Update standards version to 4.1.2 (no changes required).
+ * Run wrap-and-sort -ast.
+
+ -- Russ Allbery <rra@debian.org> Sun, 24 Dec 2017 21:44:28 -0800
+
libnet-ldapapi-perl (3.0.4-1) unstable; urgency=medium
* New upstream release.
@@ -76,14 +134,13 @@ libnet-ldapapi-perl (3.0.3-3) unstable; urgency=low
libnet-ldapapi-perl (3.0.3-2) unstable; urgency=low
- * Fix up the package to make sure the module is installed in the
+ * Fix up the package to make sure the module is installed in the
correct directory.
-- Bill MacAllister <whm@stanford.edu> Thu, 4 Sep 2008 00:20:02 -0700
libnet-ldapapi-perl (3.0.3-1) unstable; urgency=low
- * Initial release
+ * Initial release
-- Bill MacAllister <whm@stanford.edu> Wed, 3 Sep 2008 22:51:50 -0700
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7f8f011..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/debian/control b/debian/control
index c72b85d..87aeea9 100644
--- a/debian/control
+++ b/debian/control
@@ -1,18 +1,29 @@
Source: libnet-ldapapi-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7.0.50), perl, libldap2-dev, libsasl2-dev
+Build-Depends:
+ debhelper-compat (= 13),
+ libldap2-dev,
+ libsasl2-dev,
+ perl,
+Rules-Requires-Root: no
Maintainer: Bill MacAllister <bill@ca-zephyr.org>
-Uploaders: Russ Allbery <rra@debian.org>
-Standards-Version: 3.9.8
+Uploaders:
+ Russ Allbery <rra@debian.org>,
+Standards-Version: 4.6.2
Homepage: https://github.com/quanah/net-ldapapi
+Vcs-Browser: https://github.com/whm/libnet-ldapapi-perl
+Vcs-Git: https://github.com/whm/libnet-ldapapi-perl.git
Package: libnet-ldapapi-perl
Architecture: any
-Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends},
- libconvert-asn1-perl
+Depends:
+ libconvert-asn1-perl,
+ ${misc:Depends},
+ ${perl:Depends},
+ ${shlibs:Depends},
Description: Perl bindings for OpenLDAP C API
- Net::LDAPapi provides a Perl interface to the OpenLDAP C libraries.
+ Net::LDAPapi provides a Perl interface to the OpenLDAP C libraries.
Both the original "C API" and new "Perl OO" style interface methods
- are supported. This module differs from Net::LDAP in that it
+ are supported. This module differs from Net::LDAP in that it
uses C bindings to achieve significant performance improvements.
diff --git a/debian/copyright b/debian/copyright
index d4e766d..195e36a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,20 +1,19 @@
-Format-Specification:
- http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=443
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: https://github.com/quanah/net-ldapapi
+Upstream-Contact: Quanah Gibson-Mount <mishikal@yahoo.com>
Upstream-Name: Net-LDAPapi
-Upstream-Maintainer: Quanah Gibson-Mount <mishikal@yahoo.com>
-Upstream-Source: http://sf.net/projects/net-ldapapi/
Files: *
-Copyright: 2007 Quanah Gibson-Mount. All rights reserved
+Copyright: 2007, 2017-2019 Quanah Gibson-Mount. All rights reserved
2007, 2008, 2009 Board of Trustees, Leland Stanford Jr. University
2003 Howard Chu. All rights reserved.
1998 Clayton Donley. All rights reserved.
-License: GPL-1+ | Artistic
+License: GPL-1+ or Artistic
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
.
Perl is distributed under either the Artistic License or the GPL (version
- 1 or later). The full text of the current version of the GPL is
- available in Debian systems in /usr/share/common-licenses/GPL. The full
- text of the Artistic License is available on Debian systems in
+ 1 or later). The full text of the GPL version 1 is available in Debian
+ systems in /usr/share/common-licenses/GPL-1. The full text of the
+ Artistic License is available on Debian systems in
/usr/share/common-licenses/Artistic.
diff --git a/debian/patches/10-t64.patch b/debian/patches/10-t64.patch
new file mode 100644
index 0000000..b9bfb4d
--- /dev/null
+++ b/debian/patches/10-t64.patch
@@ -0,0 +1,31 @@
+Description: Bug#1066630: libnet-ldapapi-perl: FTBFS: LDAPapi.c
+ This bug was caused by a change in dpkg 1.22.6, that enabled
+ -Werror=implicit-function-declaration. In dpkg version 1.22.6, the
+ compiler flag -Werror=implicit-function-declaration was enabled by
+ default for all architectures in build flags (in dpkg 1.22.5 it had
+ been enabled conditionally on the abi time64 feature, so only on most
+ 32-bit architectures). The reason for doing this is avoiding
+ misbehavior of software affected by the ReleaseGoals/64bit-time
+ transition. When using a function with a time_t argument with an
+ implicit declaration, its type would be assumed to be int causing
+ silent truncation, or no symbol redirection (to their _time64
+ counterparts) would take effect.
+Author: Quanah Gibson-Mount <quanah@fast-mail.org>
+Origin: upstream, https://github.com/quanah/net-ldapapi
+Applied-Upstream: https://github.com/quanah/net-ldapapi/commit/0b7b45808bb644acfef4cd703d8d167e3a09007f
+Reviewed-by: Bill MacAllister <bill@ca-zephyr.org>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: libnet-ldapapi-perl/Makefile.PL
+===================================================================
+--- libnet-ldapapi-perl.orig/Makefile.PL 2024-03-29 07:00:25.037139644 +0000
++++ libnet-ldapapi-perl/Makefile.PL 2024-04-02 07:07:21.401195313 +0000
+@@ -124,7 +124,7 @@
+ 'DEFINE' => '-DMOZILLA_LDAP',
+ ) : (
+ 'LIBS' => ["-L$lib_ldap $ldap_lib"],
+- 'DEFINE' => '-DOPENLDAP',
++ 'DEFINE' => '-DOPENLDAP -DLDAP_DEPRECATED=1',
+ )),
+ 'depend' => { 'LDAPapi.c' => 'constant.h' },
+ 'clean' => { 'FILES' => 'constant.h' },
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0c0d15e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+10-t64.patch
diff --git a/debian/rules b/debian/rules
index 68f73ff..bf696ee 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,7 @@
#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
+
%:
dh $@
@@ -10,24 +13,3 @@ override_dh_auto_test:
override_dh_compress:
dh_compress -X examples
-
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installdocs Todo README
- dh_installexamples
- dh_installchangelogs Changes
- dh_link
- dh_strip
- dh_compress -X examples
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_perl
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..d701484
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,2 @@
+Bug-Database: https://github.com/quanah/net-ldapapi/issues
+Repository-Browse: https://github.com/quanah/net-ldapapi
diff --git a/debian/watch b/debian/watch
index a6336b0..7942f09 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,4 @@
-version=3
-http://sf.net/net-ldapapi/Net-LDAPapi-([\d.]+)\.tar\.gz
+version=4
+opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \
+ https://github.com/quanah/net-ldapapi/releases \
+ (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate