Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

global overhaul: use single-quoted strings where possible

  • Loading branch information...
commit db02c55bb8156d4a8742428faf45c8ab04249e5a 1 parent 7516fce
@marschap authored
Showing with 250 additions and 250 deletions.
  1. +14 −14 lib/LWP/Protocol/ldap.pm
  2. +37 −37 lib/Net/LDAP.pm
  3. +1 −1  lib/Net/LDAP/ASN.pm
  4. +4 −4 lib/Net/LDAP/Bind.pm
  5. +2 −2 lib/Net/LDAP/Constant.pm
  6. +1 −1  lib/Net/LDAP/Control.pm
  7. +1 −1  lib/Net/LDAP/Control/Assertion.pm
  8. +1 −1  lib/Net/LDAP/Control/EntryChange.pm
  9. +1 −1  lib/Net/LDAP/Control/ManageDsaIT.pm
  10. +2 −2 lib/Net/LDAP/Control/MatchedValues.pm
  11. +1 −1  lib/Net/LDAP/Control/Paged.pm
  12. +1 −1  lib/Net/LDAP/Control/PasswordPolicy.pm
  13. +1 −1  lib/Net/LDAP/Control/PersistentSearch.pm
  14. +1 −1  lib/Net/LDAP/Control/PostRead.pm
  15. +1 −1  lib/Net/LDAP/Control/PreRead.pm
  16. +2 −2 lib/Net/LDAP/Control/ProxyAuth.pm
  17. +3 −3 lib/Net/LDAP/Control/Sort.pm
  18. +1 −1  lib/Net/LDAP/Control/SortResult.pm
  19. +1 −1  lib/Net/LDAP/Control/SyncDone.pm
  20. +1 −1  lib/Net/LDAP/Control/SyncRequest.pm
  21. +1 −1  lib/Net/LDAP/Control/SyncState.pm
  22. +1 −1  lib/Net/LDAP/Control/VLV.pm
  23. +1 −1  lib/Net/LDAP/Control/VLVResponse.pm
  24. +17 −17 lib/Net/LDAP/DSML.pm
  25. +9 −9 lib/Net/LDAP/Entry.pm
  26. +1 −1  lib/Net/LDAP/Extension.pm
  27. +1 −1  lib/Net/LDAP/Extension/Cancel.pm
  28. +1 −1  lib/Net/LDAP/Extension/Refresh.pm
  29. +1 −1  lib/Net/LDAP/Extension/SetPassword.pm
  30. +1 −1  lib/Net/LDAP/Extension/WhoAmI.pm
  31. +1 −1  lib/Net/LDAP/Extra.pm
  32. +1 −1  lib/Net/LDAP/Extra/AD.pm
  33. +16 −16 lib/Net/LDAP/Filter.pm
  34. +1 −1  lib/Net/LDAP/Intermediate.pm
  35. +1 −1  lib/Net/LDAP/Intermediate/SyncInfo.pm
  36. +29 −29 lib/Net/LDAP/LDIF.pm
  37. +4 −4 lib/Net/LDAP/Message.pm
  38. +1 −1  lib/Net/LDAP/RootDSE.pm
  39. +6 −6 lib/Net/LDAP/Schema.pm
  40. +3 −3 lib/Net/LDAP/Search.pm
  41. +74 −74 lib/Net/LDAP/Util.pm
  42. +1 −1  lib/Net/LDAPI.pm
  43. +1 −1  lib/Net/LDAPS.pm
View
28 lib/LWP/Protocol/ldap.pm
@@ -13,7 +13,7 @@ use LWP::MediaTypes ();
require LWP::Protocol;
our @ISA = qw(LWP::Protocol);
-our $VERSION = "1.23";
+our $VERSION = '1.23';
use strict;
eval {
@@ -61,7 +61,7 @@ sub request {
$init_failed);
}
- my ($user, $password) = defined($userinfo) ? split(":", $userinfo, 2) : ();
+ my ($user, $password) = defined($userinfo) ? split(':', $userinfo, 2) : ();
my %extn = $url->extensions;
my $tls = exists($extn{'x-tls'}) ? 1 : 0;
my $format = lc($extn{'x-format'} || 'html');
@@ -79,7 +79,7 @@ sub request {
# we only accept Basic authorization for now
if ($authorization =~ /^Basic\s+([A-Z0-9+\/=]+)$/i) {
require MIME::Base64;
- ($user, $password) = split(":", MIME::Base64::decode_base64($1), 2);
+ ($user, $password) = split(':', MIME::Base64::decode_base64($1), 2);
}
}
}
@@ -88,7 +88,7 @@ sub request {
my $ldap = new Net::LDAP($url->as_string);
if (!$ldap) {
return $self->_error(HTTP_BAD_REQUEST,
- "Connection to LDAP server failed", "$@");
+ 'Connection to LDAP server failed', "$@");
}
# optional: startTLS
@@ -116,7 +116,7 @@ sub request {
return $self->_ldap_error($mesg) if ($mesg->code);
# Create an initial response object
- my $response = HTTP::Response->new(HTTP_OK, "Document follows");
+ my $response = HTTP::Response->new(HTTP_OK, 'Document follows');
$response->request($request);
# return data in the format requested
@@ -125,8 +125,8 @@ sub request {
if ($format eq 'ldif') {
require Net::LDAP::LDIF;
- open(my $fh, ">", \$content);
- my $ldif = Net::LDAP::LDIF->new($fh, "w", version => 1);
+ open(my $fh, '>', \$content);
+ my $ldif = Net::LDAP::LDIF->new($fh, 'w', version => 1);
while (my $entry = $mesg->shift_entry) {
$ldif->write_entry($entry);
@@ -137,7 +137,7 @@ sub request {
elsif ($format eq 'dsml') {
require Net::LDAP::DSML;
- open(my $fh, ">", \$content);
+ open(my $fh, '>', \$content);
my $dsml = Net::LDAP::DSML->new(output => $fh, pretty_print => 1);
$dsml->start_dsml();
@@ -181,7 +181,7 @@ sub request {
$content .= q{<tr><td align="right" valign="top"};
$content .= q{ rowspan="} . scalar(@$vals) . q{"}
if (@$vals > 1);
- $content .= ">" . $attr . "&nbsp</td>\n";
+ $content .= '>' . $attr . "&nbsp</td>\n";
my $j = 0;
foreach my $val (@$vals) {
@@ -193,10 +193,10 @@ sub request {
}
}
- $content .= "</table>" if $index;
- $content .= "<hr>";
- $content .= $index ? sprintf("%s Match%s found", $index, $index>1 ? "es" : "")
- : "<b>No Matches found</b>";
+ $content .= '</table>' if $index;
+ $content .= '<hr>';
+ $content .= $index ? sprintf('%s Match%s found', $index, $index>1 ? 'es' : '')
+ : '<b>No Matches found</b>';
$content .= "</body>\n";
}
$response->header('Content-Type' => $mime_type.'; charset=utf-8');
@@ -223,7 +223,7 @@ sub _error
my $res = HTTP::Response->new($code, $message);
if ($content) {
- $res->content_type("text/plain");
+ $res->content_type('text/plain');
$res->content($content);
}
View
74 lib/Net/LDAP.pm
@@ -30,7 +30,7 @@ use Net::LDAP::Constant qw(LDAP_SUCCESS
use constant CAN_IPV6 => eval { require IO::Socket::INET6 } ? 1 : 0;
-our $VERSION = "0.51";
+our $VERSION = '0.51';
our @ISA = qw(Tie::StdHash Net::LDAP::Extra);
our $LDAP_VERSION = 3; # default LDAP protocol version
@@ -53,7 +53,7 @@ sub _options {
my $once = 0;
for my $v (grep { /^-/ } keys %ret) {
require Carp;
- $once++ or Carp::carp("deprecated use of leading - for options");
+ $once++ or Carp::carp('deprecated use of leading - for options');
$ret{substr($v, 1)} = $ret{$v};
}
@@ -75,7 +75,7 @@ sub _dn_options {
sub _err_msg {
my $mesg = shift;
my $errstr = $mesg->dn || '';
- $errstr .= ": " if $errstr;
+ $errstr .= ': ' if $errstr;
$errstr . $mesg->error;
}
@@ -209,7 +209,7 @@ sub _SSL_context_init_args {
$verify = 0 + (exists $ssl_verify{$v} ? $ssl_verify{$v} : $verify);
if ($verify) {
- $verifycn_ctx{SSL_verifycn_scheme} = "ldap";
+ $verifycn_ctx{SSL_verifycn_scheme} = 'ldap';
$verifycn_ctx{SSL_verifycn_name} = $arg->{sslserver}
if (defined $arg->{sslserver});
}
@@ -221,13 +221,13 @@ sub _SSL_context_init_args {
$clientkey = $arg->{clientkey};
} else {
require Carp;
- Carp::croak("Setting client public key but not client private key");
+ Carp::croak('Setting client public key but not client private key');
}
}
if ($arg->{checkcrl} && !$arg->{capath}) {
require Carp;
- Carp::croak("Cannot check CRL without having CA certificates");
+ Carp::croak('Cannot check CRL without having CA certificates');
}
if (exists $arg->{keydecrypt}) {
@@ -258,7 +258,7 @@ sub _SSL_context_init_args {
sub connect_ldapi {
my ($ldap, $peer, $arg) = @_;
- $peer = $ENV{LDAPI_SOCK} || "/var/run/ldapi"
+ $peer = $ENV{LDAPI_SOCK} || '/var/run/ldapi'
unless length $peer;
require IO::Socket::UNIX;
@@ -341,7 +341,7 @@ sub unbind {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
$mesg->encode(
unbindRequest => 1,
@@ -357,7 +357,7 @@ sub unbind {
sub ldapbind {
require Carp;
- Carp::carp("->ldapbind deprecated, use ->bind") if $^W;
+ Carp::carp('->ldapbind deprecated, use ->bind') if $^W;
goto &bind;
}
@@ -386,7 +386,7 @@ sub bind {
my $dn = delete $arg->{dn} || '';
my $control = delete $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my %stash = (
name => ref($dn) ? $dn->dn : $dn,
@@ -399,18 +399,18 @@ sub bind {
while (my($param, $type) = each %ptype) {
if (exists $arg->{$param}) {
($auth_type, $passwd) = $type eq 'anon' ? (simple => '') : ($type, $arg->{$param});
- return _error($ldap, $mesg, LDAP_INAPPROPRIATE_AUTH, "No password, did you mean noauth or anonymous ?")
+ return _error($ldap, $mesg, LDAP_INAPPROPRIATE_AUTH, 'No password, did you mean noauth or anonymous ?')
if $type eq 'simple' and $passwd eq '';
last;
}
}
- return _error($ldap, $mesg, LDAP_INAPPROPRIATE_AUTH, "No AUTH supplied")
+ return _error($ldap, $mesg, LDAP_INAPPROPRIATE_AUTH, 'No AUTH supplied')
unless $auth_type;
if ($auth_type eq 'sasl') {
- return _error($ldap, $mesg, LDAP_PARAM_ERROR, "SASL requires LDAPv3")
+ return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'SASL requires LDAPv3')
if $ldap->{net_ldap_version} < 3;
my $sasl = $passwd;
@@ -429,7 +429,7 @@ sub bind {
$sasl_conn = eval {
local ($SIG{__DIE__});
- $sasl->client_new("ldap", $connected_name);
+ $sasl->client_new('ldap', $connected_name);
};
}
else {
@@ -486,7 +486,7 @@ sub search {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $base = $arg->{base} || '';
my $filter;
@@ -495,7 +495,7 @@ sub search {
require Net::LDAP::Filter;
my $f = Net::LDAP::Filter->new;
$f->parse($filter)
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Bad filter");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Bad filter');
$filter = $f;
}
@@ -537,10 +537,10 @@ sub add {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $entry = $arg->{dn}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No DN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No DN specified');
unless (ref $entry) {
require Net::LDAP::Entry;
@@ -568,10 +568,10 @@ sub modify {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $dn = $arg->{dn}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No DN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No DN specified');
my @ops;
my $opcode;
@@ -662,10 +662,10 @@ sub delete {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $dn = $arg->{dn}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No DN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No DN specified');
$mesg->encode(
delRequest => ref($dn) ? $dn->dn : $dn,
@@ -685,13 +685,13 @@ sub moddn {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $dn = $arg->{dn}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No DN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No DN specified');
my $new = $arg->{newrdn} || $arg->{new}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No NewRDN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No NewRDN specified');
$mesg->encode(
modDNRequest => {
@@ -717,22 +717,22 @@ sub compare {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
my $dn = $arg->{dn}
- or return _error($ldap, $mesg, LDAP_PARAM_ERROR, "No DN specified");
+ or return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'No DN specified');
my $attr = exists $arg->{attr}
? $arg->{attr}
: exists $arg->{attrs} #compat
? $arg->{attrs}[0]
- : "";
+ : '';
my $value = exists $arg->{value}
? $arg->{value}
: exists $arg->{attrs} #compat
? $arg->{attrs}[1]
- : "";
+ : '';
$mesg->encode(
@@ -760,7 +760,7 @@ sub abandon {
my $control = $arg->{control}
and $ldap->{net_ldap_version} < 3
- and return _error($ldap, $mesg, LDAP_PARAM_ERROR, "Controls require LDAPv3");
+ and return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'Controls require LDAPv3');
$mesg->encode(
abandonRequest => ref($id) ? $id->mesg_id : $id,
@@ -777,7 +777,7 @@ sub extension {
require Net::LDAP::Extension;
my $mesg = $ldap->message('Net::LDAP::Extension' => $arg);
- return _error($ldap, $mesg, LDAP_LOCAL_ERROR, "ExtendedRequest requires LDAPv3")
+ return _error($ldap, $mesg, LDAP_LOCAL_ERROR, 'ExtendedRequest requires LDAPv3')
if $ldap->{net_ldap_version} < 3;
$mesg->encode(
@@ -809,7 +809,7 @@ sub sync {
sub disconnect {
my $self = shift;
- _drop_conn($self, LDAP_USER_CANCELED, "Explicit disconnect");
+ _drop_conn($self, LDAP_USER_CANCELED, 'Explicit disconnect');
}
sub _sendmesg {
@@ -874,7 +874,7 @@ sub process {
for ($ready = 1 ; $ready ; $ready = $sel->can_read(0) || (ref($sock) eq 'IO::Socket::SSL' && $sock->pending())) {
my $pdu;
asn_read($sock, $pdu)
- or return _drop_conn($ldap, LDAP_OPERATIONS_ERROR, "Communications Error");
+ or return _drop_conn($ldap, LDAP_OPERATIONS_ERROR, 'Communications Error');
my $debug;
if ($debug = $ldap->debug) {
@@ -898,7 +898,7 @@ sub process {
if (my $ext = $result->{protocolOp}{extendedResp}) {
if (($ext->{responseName} || '') eq '1.3.6.1.4.1.1466.20036') {
# notice of disconnection
- return _drop_conn($ldap, LDAP_SERVER_DOWN, "Notice of Disconnection");
+ return _drop_conn($ldap, LDAP_SERVER_DOWN, 'Notice of Disconnection');
}
}
@@ -1044,10 +1044,10 @@ sub start_tls {
require Net::LDAP::Extension;
my $mesg = $ldap->message('Net::LDAP::Extension' => $arg);
- return _error($ldap, $mesg, LDAP_OPERATIONS_ERROR, "TLS already started")
+ return _error($ldap, $mesg, LDAP_OPERATIONS_ERROR, 'TLS already started')
if $sock->isa('IO::Socket::SSL');
- return _error($ldap, $mesg, LDAP_PARAM_ERROR, "StartTLS requires LDAPv3")
+ return _error($ldap, $mesg, LDAP_PARAM_ERROR, 'StartTLS requires LDAPv3')
if $ldap->version < 3;
$mesg->encode(
@@ -1126,7 +1126,7 @@ sub TIEHASH {
sub DESTROY {
my $ldap = shift;
my $inner = tied(%$ldap) or return;
- _drop_conn($inner, LDAP_UNAVAILABLE, "Implicit disconnect")
+ _drop_conn($inner, LDAP_UNAVAILABLE, 'Implicit disconnect')
unless --$inner->{net_ldap_refcnt};
}
View
2  lib/Net/LDAP/ASN.pm
@@ -1,7 +1,7 @@
package Net::LDAP::ASN;
-our $VERSION = "0.10";
+our $VERSION = '0.10';
use Convert::ASN1;
View
8 lib/Net/LDAP/Bind.pm
@@ -9,7 +9,7 @@ use Net::LDAP qw(LDAP_SASL_BIND_IN_PROGRESS LDAP_DECODING_ERROR LDAP_SUCCESS
LDAP_LOCAL_ERROR);
use Net::LDAP::Message;
-our $VERSION = "1.04";
+our $VERSION = '1.04';
our @ISA = qw(Net::LDAP::Message);
sub _sasl_info {
@@ -21,7 +21,7 @@ sub decode {
my $self = shift;
my $result = shift;
my $bind = $result->{protocolOp}{bindResponse}
- or $self->set_error(LDAP_DECODING_ERROR, "LDAP decode error")
+ or $self->set_error(LDAP_DECODING_ERROR, 'LDAP decode error')
and return;
my $sasl = $self->{sasl};
@@ -30,9 +30,9 @@ sub decode {
my $resp;
if ($bind->{resultCode} == LDAP_SASL_BIND_IN_PROGRESS or
($bind->{resultCode} == LDAP_SUCCESS and $bind->{serverSaslCreds})) {
- $sasl or $self->set_error(LDAP_LOCAL_ERROR, "no sasl object"), return;
+ $sasl or $self->set_error(LDAP_LOCAL_ERROR, 'no sasl object'), return;
($resp) = $sasl->client_step($bind->{serverSaslCreds})
- or $self->set_error(LDAP_DECODING_ERROR, "LDAP decode error"), return;
+ or $self->set_error(LDAP_DECODING_ERROR, 'LDAP decode error'), return;
}
if ($sasl and $bind->{resultCode} == LDAP_SUCCESS) {
View
4 lib/Net/LDAP/Constant.pm
@@ -4,7 +4,7 @@
package Net::LDAP::Constant;
-our $VERSION = "0.17";
+our $VERSION = '0.17';
use Exporter qw(import);
@@ -29,7 +29,7 @@ while (<DATA>) {
sub Net::LDAP::Util::ldap_error_name {
my $code = 0 + (ref($_[0]) ? $_[0]->code : $_[0]);
- $err2name[$code] || sprintf("LDAP error code %d(0x%02X)", $code, $code);
+ $err2name[$code] || sprintf('LDAP error code %d(0x%02X)', $code, $code);
}
View
2  lib/Net/LDAP/Control.pm
@@ -26,7 +26,7 @@ use Net::LDAP::Constant qw(
LDAP_CONTROL_ASSERTION
);
-our $VERSION = "0.13";
+our $VERSION = '0.13';
my %Pkg2Type = (
View
2  lib/Net/LDAP/Control/Assertion.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::Assertion;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::Filter;
use Net::LDAP::ASN qw(Filter);
View
2  lib/Net/LDAP/Control/EntryChange.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::EntryChange;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::ASN qw(EntryChangeNotification);
use strict;
View
2  lib/Net/LDAP/Control/ManageDsaIT.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::ManageDsaIT;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::ASN qw(ManageDsaIT);
use strict;
View
4 lib/Net/LDAP/Control/MatchedValues.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::MatchedValues;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::ASN qw(ValuesReturnFilter);
use strict;
@@ -152,7 +152,7 @@ package Net::LDAP::FilterList;
use Net::LDAP::Filter;
our @ISA = qw(Net::LDAP::Filter);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
# filter = "(" 1*item ")"
# item = simple / present / substring / extensible
View
2  lib/Net/LDAP/Control/Paged.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::Paged;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(realSearchControlValue);
use strict;
View
2  lib/Net/LDAP/Control/PasswordPolicy.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::PasswordPolicy;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(ppControlResponse);
use strict;
View
2  lib/Net/LDAP/Control/PersistentSearch.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::PersistentSearch;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::ASN qw(PersistentSearch);
use strict;
View
2  lib/Net/LDAP/Control/PostRead.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::PostRead;
use Net::LDAP::Control::PreRead;
our @ISA = qw(Net::LDAP::Control::PreRead);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
1;
View
2  lib/Net/LDAP/Control/PreRead.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::PreRead;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Net::LDAP::ASN qw(AttributeDescriptionList prSearchResultEntry);
use Net::LDAP::Entry;
View
4 lib/Net/LDAP/Control/ProxyAuth.pm
@@ -7,13 +7,13 @@ package Net::LDAP::Control::ProxyAuth;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "1.07";
+our $VERSION = '1.07';
use Net::LDAP::Constant qw(LDAP_CONTROL_PROXYAUTHORIZATION);
use Net::LDAP::ASN qw(proxyAuthValue);
use strict;
-sub LDAP_CONTROL_PROXYAUTHORIZATION_OLD { "2.16.840.1.113730.3.4.12"; }
+sub LDAP_CONTROL_PROXYAUTHORIZATION_OLD { '2.16.840.1.113730.3.4.12'; }
sub init {
my($self) = @_;
View
6 lib/Net/LDAP/Control/Sort.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::Sort;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(SortRequest);
use strict;
@@ -43,9 +43,9 @@ sub value {
}
$self->{order} = [ map {
- ($_->{reverseOrder} ? "-" : "")
+ ($_->{reverseOrder} ? '-' : '')
. $_->{type}
- . (defined($_->{orderingRule}) ? ":$_->{orderingRule}" : "")
+ . (defined($_->{orderingRule}) ? ":$_->{orderingRule}" : '')
} @{$asn->{order}}];
return $self->{value} = $value;
View
2  lib/Net/LDAP/Control/SortResult.pm
@@ -8,7 +8,7 @@ use Net::LDAP::ASN qw(SortResult);
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
sub init {
my($self) = @_;
View
2  lib/Net/LDAP/Control/SyncDone.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::SyncDone;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(syncDoneValue);
use strict;
View
2  lib/Net/LDAP/Control/SyncRequest.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::SyncRequest;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(syncRequestValue);
use strict;
View
2  lib/Net/LDAP/Control/SyncState.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::SyncState;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(syncStateValue);
use strict;
View
2  lib/Net/LDAP/Control/VLV.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::VLV;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.04";
+our $VERSION = '0.04';
use Net::LDAP::ASN qw(VirtualListViewRequest);
use strict;
View
2  lib/Net/LDAP/Control/VLVResponse.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Control::VLVResponse;
use Net::LDAP::Control;
our @ISA = qw(Net::LDAP::Control);
-our $VERSION = "0.04";
+our $VERSION = '0.04';
use Net::LDAP::ASN qw(VirtualListViewResponse);
use strict;
View
34 lib/Net/LDAP/DSML.pm
@@ -11,7 +11,7 @@ use XML::SAX::Base;
use Net::LDAP::Entry;
our @ISA = qw(XML::SAX::Base);
-our $VERSION = "0.14";
+our $VERSION = '0.14';
# OO purists will hate this :)
my %schema_typemap = qw(
@@ -124,7 +124,7 @@ schema_element:
my $value;
- if (defined($value = $Attrs->{"{}type"}{Value})) {
+ if (defined($value = $Attrs->{'{}type'}{Value})) {
$elem->{lc $value} = 1;
}
@@ -138,7 +138,7 @@ schema_element:
}
$elem->{superior} = $value
- if defined($value = $Attrs->{"{}superior"}{Value});
+ if defined($value = $Attrs->{'{}superior'}{Value});
return;
}
@@ -247,7 +247,7 @@ schema_element:
$name = $oid;
}
else {
- croak "Schema element without a name or object-identifier";
+ croak 'Schema element without a name or object-identifier';
}
$elem->{oid} ||= $name;
@@ -392,12 +392,12 @@ sub write_entry {
foreach my $entry (@_) {
my $asn = $entry->asn;
@data{qw(Name LocalName)} = qw(dsml:entry entry);
- %attr = ( '{}dn' => { Value => $asn->{objectName}, Name => "dn"} );
+ %attr = ( '{}dn' => { Value => $asn->{objectName}, Name => 'dn'} );
$handler->start_element(\%data);
foreach my $attr ( @{$asn->{attributes}} ) {
my $name = $attr->{type};
- my $is_oc = lc($name) eq "objectclass";
+ my $is_oc = lc($name) eq 'objectclass';
if ($is_oc) {
@data{qw(Name LocalName)} = qw(dsml:objectclass objectclass);
@@ -407,7 +407,7 @@ sub write_entry {
}
else {
@data{qw(Name LocalName)} = qw(dsml:attr attr);
- %attr = ( "{}name" => { Value => $name, Name => "name" } );
+ %attr = ( '{}name' => { Value => $name, Name => 'name' } );
$handler->start_element(\%data);
@data{qw(Name LocalName)} = qw(dsml:value value);
}
@@ -416,8 +416,8 @@ sub write_entry {
foreach my $val (@{$attr->{vals}}) {
if ($val =~ /(^[ :]|[\x00-\x1f\x7f-\xff])/) {
require MIME::Base64;
- $chdata{Data} = MIME::Base64::encode($val, "");
- %attr = ( '{}encoding' => { Value => 'base64', Name => "encoding"} );
+ $chdata{Data} = MIME::Base64::encode($val, '');
+ %attr = ( '{}encoding' => { Value => 'base64', Name => 'encoding'} );
}
else {
$chdata{Data} = $val;
@@ -463,8 +463,8 @@ sub write_schema {
if (my $sup = $attr->{superior}) {
my $sup_a = $schema->attribute($sup);
- $attr{"{}superior"} = {
- Value => "#" . ($sup_a ? $sup_a->{name} : $sup),
+ $attr{'{}superior'} = {
+ Value => '#' . ($sup_a ? $sup_a->{name} : $sup),
Name => 'superior'
};
}
@@ -473,7 +473,7 @@ sub write_schema {
Value => 'true', Name => $flag
} if $attr->{$flag};
}
- $attr{"{}user-modification"} = {
+ $attr{'{}user-modification'} = {
Value => 'false',
Name => 'user-modification',
} unless $attr->{'user-modification'};
@@ -496,7 +496,7 @@ sub write_schema {
}
}
if (my $oid = $attr->{oid}) {
- @data{qw(Name LocalName)} = ("dsml:object-identifier", "object-identifier");
+ @data{qw(Name LocalName)} = ('dsml:object-identifier', 'object-identifier');
$handler->start_element(\%data);
$handler->characters({Data => $oid});
$handler->end_element(\%data);
@@ -537,19 +537,19 @@ sub write_schema {
if (my $sup = $oc->{superior}) {
my $sup_a = $schema->objectclass($sup);
- $attr{"{}superior"} = {
- Value => "#" . ($sup_a ? $sup_a->{name} : $sup),
+ $attr{'{}superior'} = {
+ Value => '#' . ($sup_a ? $sup_a->{name} : $sup),
Name => 'superior'
};
}
if (my $type = (grep { $oc->{$_} } qw(structural abstract auxilary))[0]) {
- $attr{"{}type"} = {
+ $attr{'{}type'} = {
Value => $type,
Name => 'type',
};
}
if ($oc->{obsolete}) {
- $attr{"{}type"} = {
+ $attr{'{}type'} = {
Value => 'true',
Name => 'obsolete',
};
View
18 lib/Net/LDAP/Entry.pm
@@ -15,7 +15,7 @@ BEGIN {
if (CHECK_UTF8);
}
-our $VERSION = "0.25";
+our $VERSION = '0.25';
sub new {
my $self = shift;
@@ -95,13 +95,13 @@ sub dn {
sub get_attribute {
require Carp;
- Carp::carp("->get_attribute deprecated, use ->get_value") if $^W;
+ Carp::carp('->get_attribute deprecated, use ->get_value') if $^W;
shift->get_value(@_, asref => !wantarray);
}
sub get {
require Carp;
- Carp::carp("->get deprecated, use ->get_value") if $^W;
+ Carp::carp('->get deprecated, use ->get_value') if $^W;
shift->get_value(@_, asref => !wantarray);
}
@@ -283,7 +283,7 @@ sub update {
else {
require Net::LDAP::Message;
$mesg = Net::LDAP::Message->new( $target );
- $mesg->set_error(LDAP_LOCAL_ERROR, "No attributes to update");
+ $mesg->set_error(LDAP_LOCAL_ERROR, 'No attributes to update');
}
}
elsif (ref($target) && UNIVERSAL::isa($target, 'Net::LDAP::LDIF')) {
@@ -302,9 +302,9 @@ sub ldif {
my %opt = @_;
require Net::LDAP::LDIF;
- open(my $fh, ">", \my $buffer);
+ open(my $fh, '>', \my $buffer);
my $change = exists $opt{change} ? $opt{change} : $self->changes ? 1 : 0;
- my $ldif = Net::LDAP::LDIF->new($fh, "w", change => $change);
+ my $ldif = Net::LDAP::LDIF->new($fh, 'w', change => $change);
$ldif->write_entry($self);
return $buffer;
}
@@ -317,8 +317,8 @@ sub dump {
my $fh = @_ ? shift : select;
my $asn = $self->{asn};
- print $fh "-" x 72, "\n";
- print $fh "dn:", $asn->{objectName}, "\n\n" if $asn->{objectName};
+ print $fh '-' x 72, "\n";
+ print $fh 'dn:', $asn->{objectName}, "\n\n" if $asn->{objectName};
my $l = 0;
@@ -326,7 +326,7 @@ sub dump {
$l = length if length > $l;
}
- my $spc = "\n " . " " x $l;
+ my $spc = "\n " . ' ' x $l;
foreach my $attr (@{$asn->{attributes}}) {
my $val = $attr->{vals};
View
2  lib/Net/LDAP/Extension.pm
@@ -5,7 +5,7 @@
package Net::LDAP::Extension;
our @ISA = qw(Net::LDAP::Message);
-our $VERSION = "1.03";
+our $VERSION = '1.03';
#fetch the response name
sub response_name {
View
2  lib/Net/LDAP/Extension/Cancel.pm
@@ -4,7 +4,7 @@ package Net::LDAP::Extension::Cancel;
require Net::LDAP::Extension;
our @ISA = qw(Net::LDAP::Extension);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use Convert::ASN1;
View
2  lib/Net/LDAP/Extension/Refresh.pm
@@ -2,7 +2,7 @@ package Net::LDAP::Extension::Refresh;
require Net::LDAP::Extension;
our @ISA = qw(Net::LDAP::Extension);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Convert::ASN1;
View
2  lib/Net/LDAP/Extension/SetPassword.pm
@@ -4,7 +4,7 @@ package Net::LDAP::Extension::SetPassword;
require Net::LDAP::Extension;
our @ISA = qw(Net::LDAP::Extension);
-our $VERSION = "0.05";
+our $VERSION = '0.05';
use Convert::ASN1;
my $passwdModReq = Convert::ASN1->new;
View
2  lib/Net/LDAP/Extension/WhoAmI.pm
@@ -3,7 +3,7 @@ package Net::LDAP::Extension::WhoAmI;
require Net::LDAP::Extension;
-our $VERSION = "0.02";
+our $VERSION = '0.02';
our @ISA = qw(Net::LDAP::Extension);
sub Net::LDAP::who_am_i {
View
2  lib/Net/LDAP/Extra.pm
@@ -9,7 +9,7 @@ use strict;
require Net::LDAP;
require Carp;
-our $VERSION = "0.02";
+our $VERSION = '0.02';
sub import {
shift;
View
2  lib/Net/LDAP/Extra/AD.pm
@@ -6,7 +6,7 @@ use Encode;
use Exporter qw(import);
use Net::LDAP::RootDSE;
-our $VERSION = "0.03";
+our $VERSION = '0.03';
our @EXPORT = qw(is_AD is_ADAM reset_ADpassword change_ADpassword);
View
32 lib/Net/LDAP/Filter.pm
@@ -6,7 +6,7 @@ package Net::LDAP::Filter;
use strict;
-our $VERSION = "0.18";
+our $VERSION = '0.18';
# filter = "(" filtercomp ")"
# filtercomp = and / or / not / item
@@ -87,7 +87,7 @@ sub _unescape {
$_[0];
}
-sub _escape { (my $t = $_[0]) =~ s/([\\\(\)\*\0-\37\177-\377])/sprintf("\\%02x", ord($1))/sge; $t }
+sub _escape { (my $t = $_[0]) =~ s/([\\\(\)\*\0-\37\177-\377])/sprintf('\\%02x', ord($1))/sge; $t }
# encode a triplet ($attr,$op,$val) representing a single filter item
sub _encode {
@@ -167,14 +167,14 @@ sub parse {
# a filter is required
if (!defined $filter) {
- $ErrStr = "Undefined filter";
+ $ErrStr = 'Undefined filter';
return undef;
}
# Algorithm depends on /^\(/;
$filter =~ s/^\s*//;
- $filter = "(" . $filter . ")"
+ $filter = '(' . $filter . ')'
unless $filter =~ /^\(/;
while (length($filter)) {
@@ -192,7 +192,7 @@ sub parse {
elsif ($filter =~ s/^\)\s*//o) {
unless (@stack) {
- $ErrStr = "Bad filter, unmatched )";
+ $ErrStr = 'Bad filter, unmatched )';
return undef;
}
my($myop, $mydata) = ($op, $cur);
@@ -221,11 +221,11 @@ sub parse {
if (length $filter) {
# If we have anything left in the filter, then there is a problem
- $ErrStr = "Bad filter, error before " . substr($filter, 0, 20);
+ $ErrStr = 'Bad filter, error before ' . substr($filter, 0, 20);
return undef;
}
if (@stack) {
- $ErrStr = "Bad filter, unmatched (";
+ $ErrStr = 'Bad filter, unmatched (';
return undef;
}
@@ -245,27 +245,27 @@ sub print {
sub as_string { _string(%{$_[0]}) }
sub _string { # prints things of the form (<op> (<list>) ... )
- my $str = "";
+ my $str = '';
for ($_[0]) {
- /^and/ and return "(&" . join("", map { _string(%$_) } @{$_[1]}) . ")";
- /^or/ and return "(|" . join("", map { _string(%$_) } @{$_[1]}) . ")";
- /^not/ and return "(!" . _string(%{$_[1]}) . ")";
+ /^and/ and return '(&' . join('', map { _string(%$_) } @{$_[1]}) . ')';
+ /^or/ and return '(|' . join('', map { _string(%$_) } @{$_[1]}) . ')';
+ /^not/ and return '(!' . _string(%{$_[1]}) . ')';
/^present/ and return "($_[1]=*)";
/^(equalityMatch|greaterOrEqual|lessOrEqual|approxMatch)/
- and return "(" . $_[1]->{attributeDesc} . $Rop{$1} . _escape($_[1]->{assertionValue}) .")";
+ and return '(' . $_[1]->{attributeDesc} . $Rop{$1} . _escape($_[1]->{assertionValue}) .')';
/^substrings/ and do {
- my $str = join("*", "", map { _escape($_) } map { values %$_ } @{$_[1]->{substrings}});
+ my $str = join('*', '', map { _escape($_) } map { values %$_ } @{$_[1]->{substrings}});
$str =~ s/^.// if exists $_[1]->{substrings}[0]{initial};
$str .= '*' unless exists $_[1]->{substrings}[-1]{final};
return "($_[1]->{type}=$str)";
};
/^extensibleMatch/ and do {
- my $str = "(";
+ my $str = '(';
$str .= $_[1]->{type} if defined $_[1]->{type};
- $str .= ":dn" if $_[1]->{dnAttributes};
+ $str .= ':dn' if $_[1]->{dnAttributes};
$str .= ":$_[1]->{matchingRule}" if defined $_[1]->{matchingRule};
- $str .= ":=" . _escape($_[1]->{matchValue}) . ")";
+ $str .= ':=' . _escape($_[1]->{matchValue}) . ')';
return $str;
};
}
View
2  lib/Net/LDAP/Intermediate.pm
@@ -10,7 +10,7 @@ use Net::LDAP::Constant qw(
LDAP_SYNC_INFO
);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
my %Class2ResponseName = (
View
2  lib/Net/LDAP/Intermediate/SyncInfo.pm
@@ -7,7 +7,7 @@ package Net::LDAP::Intermediate::SyncInfo;
use Net::LDAP::Intermediate;
our @ISA = qw(Net::LDAP::Intermediate);
-our $VERSION = "0.03";
+our $VERSION = '0.03';
use Net::LDAP::ASN qw(syncInfoValue);
use strict;
View
58 lib/Net/LDAP/LDIF.pm
@@ -15,15 +15,15 @@ BEGIN {
if (CHECK_UTF8);
}
-our $VERSION = "0.19";
+our $VERSION = '0.19';
my %mode = qw(w > r < a >>);
sub new {
my $pkg = shift;
- my $file = shift || "-";
- my $mode = shift || "r";
+ my $file = shift || '-';
+ my $mode = shift || 'r';
my %opt = @_;
my $fh;
my $opened_fh = 0;
@@ -32,12 +32,12 @@ sub new {
$fh = $file;
}
else {
- if ($file eq "-") {
- if ($mode eq "w") {
- ($file, $fh) = ("STDOUT", \*STDOUT);
+ if ($file eq '-') {
+ if ($mode eq 'w') {
+ ($file, $fh) = ('STDOUT', \*STDOUT);
}
else {
- ($file, $fh) = ("STDIN", \*STDIN);
+ ($file, $fh) = ('STDIN', \*STDIN);
}
}
else {
@@ -45,7 +45,7 @@ sub new {
$fh = Symbol::gensym();
my $open = $file =~ /^\| | \|$/x
? $file
- : (($mode{$mode} || "<") . $file);
+ : (($mode{$mode} || '<') . $file);
open($fh, $open) or return;
$opened_fh = 1;
}
@@ -64,7 +64,7 @@ sub new {
$opt{version} ||= 0;
my $self = {
- changetype => "modify",
+ changetype => 'modify',
modify => 'add',
wrap => 78,
%opt,
@@ -76,7 +76,7 @@ sub new {
};
# fetch glob for URL type attributes (one per LDIF object)
- if ($mode eq "r") {
+ if ($mode eq 'r') {
require Symbol;
$self->{_attr_fh} = Symbol::gensym();
}
@@ -155,7 +155,7 @@ sub _read_url_attribute {
}
close($fh);
} else {
- $self->_error("unsupported URL type", @ldif);
+ $self->_error('unsupported URL type', @ldif);
return;
}
@@ -175,7 +175,7 @@ sub _read_entry {
@ldif = $self->_read_lines;
unless (@ldif) { # empty records are errors if not at eof
- $self->_error("illegal empty LDIF entry") if (!$self->eof());
+ $self->_error('illegal empty LDIF entry') if (!$self->eof());
return;
}
@@ -187,11 +187,11 @@ sub _read_entry {
}
if (@ldif < 1) {
- $self->_error("LDIF entry is not valid", @ldif);
+ $self->_error('LDIF entry is not valid', @ldif);
return;
}
elsif (not ( $ldif[0] =~ s/^dn:(:?) *//) ) {
- $self->_error("First line of LDIF entry does not begin with 'dn:'", @ldif);
+ $self->_error('First line of LDIF entry does not begin with "dn:"', @ldif);
return;
}
@@ -216,10 +216,10 @@ sub _read_entry {
? shift(@ldif) : $self->{changetype};
$entry->changetype($changetype);
- return $entry if ($changetype eq "delete");
+ return $entry if ($changetype eq 'delete');
unless (@ldif) {
- $self->_error("LDAP entry is not valid", @ldif);
+ $self->_error('LDAP entry is not valid', @ldif);
return;
}
@@ -227,9 +227,9 @@ sub _read_entry {
my $modify = $self->{modify};
my $modattr;
my $lastattr;
- if($changetype eq "modify") {
+ if($changetype eq 'modify') {
unless ( (my $tmp = shift @ldif) =~ s/^(add|delete|replace|increment):\s*([-;\w]+)// ) {
- $self->_error("LDAP entry is not valid", @ldif);
+ $self->_error('LDAP entry is not valid', @ldif);
return;
}
$lastattr = $modattr = $2;
@@ -241,7 +241,7 @@ sub _read_entry {
my $attr;
my $xattr;
- if ($line eq "-") {
+ if ($line eq '-') {
if (defined $lastattr) {
if (CHECK_UTF8 && $self->{raw}) {
map { $_ = Encode::decode_utf8($_) } @values
@@ -273,7 +273,7 @@ sub _read_entry {
}
if( defined($modattr) && $attr ne $modattr ) {
- $self->_error("LDAP entry is not valid", @ldif);
+ $self->_error('LDAP entry is not valid', @ldif);
return;
}
@@ -303,7 +303,7 @@ sub _read_entry {
else {
my @attr;
- my $last = "";
+ my $last = '';
my $vals = [];
my $attr;
my $xattr;
@@ -352,7 +352,7 @@ sub read_entry {
my $self = shift;
unless ($self->{fh}) {
- $self->_error("LDIF file handle not valid");
+ $self->_error('LDIF file handle not valid');
return;
}
$self->_read_entry();
@@ -388,8 +388,8 @@ sub _wrap {
use integer;
my $l2 = $len-1;
my $x = (length($_[0]) - $len) / $l2;
- my $extra = (length($_[0]) == ($l2 * $x + $len)) ? "" : "a*";
- join("\n ", unpack("a$len" . "a$l2" x $x . $extra,$_[0]));
+ my $extra = (length($_[0]) == ($l2 * $x + $len)) ? '' : 'a*';
+ join("\n ", unpack("a$len" . "a$l2" x $x . $extra, $_[0]));
}
sub _write_attr {
@@ -403,10 +403,10 @@ sub _write_attr {
if (CHECK_UTF8 and Encode::is_utf8($v));
if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff])/) {
require MIME::Base64;
- $ln .= ":: " . MIME::Base64::encode($v, "");
+ $ln .= ':: ' . MIME::Base64::encode($v, '');
}
else {
- $ln .= ": " . $v;
+ $ln .= ': ' . $v;
}
$res &&= print _wrap($ln, $wrap), "\n";
}
@@ -447,7 +447,7 @@ sub _write_dn {
$dn = "dn: $dn";
} elsif ($encode =~ /base64/i) {
require MIME::Base64;
- $dn = "dn:: " . MIME::Base64::encode($dn, "");
+ $dn = 'dn:: ' . MIME::Base64::encode($dn, '');
} else {
$dn = "dn: $dn";
}
@@ -492,7 +492,7 @@ sub _write_entry {
local($\, $,); # output field and record separators
unless ($self->{fh}) {
- $self->_error("LDIF file handle not valid");
+ $self->_error('LDIF file handle not valid');
return;
}
my $saver = SelectSaver->new($self->{fh});
@@ -545,7 +545,7 @@ sub _write_entry {
$res &&= print "-\n" if (!$self->{version} && $dash++);
my $attr = $chg->[$i++];
my $val = $chg->[$i++];
- $res &&= print $type, ": ", $attr, "\n";
+ $res &&= print $type, ': ', $attr, "\n";
$res &&= _write_attr($attr, $val, $wrap, $lower);
$res &&= print "-\n" if ($self->{version});
}
View
8 lib/Net/LDAP/Message.pm
@@ -8,7 +8,7 @@ use Net::LDAP::Constant qw(LDAP_SUCCESS LDAP_COMPARE_TRUE LDAP_COMPARE_FALSE);
use Net::LDAP::ASN qw(LDAPRequest);
use strict;
-our $VERSION = "1.12";
+our $VERSION = '1.12';
my $MsgID = 0;
@@ -122,7 +122,7 @@ sub sync {
until(exists $self->{resultCode}) {
$err = $ldap->sync($self->mesg_id) or next;
- $self->set_error($err, "Protocol Error")
+ $self->set_error($err, 'Protocol Error')
unless exists $self->{resultCode};
return $err;
}
@@ -266,8 +266,8 @@ sub Net::LDAP::Compare::is_error {
sub decode { shift }
sub abandon { shift }
sub code { shift->{resultCode} || LDAP_SUCCESS }
- sub error { shift->{errorMessage} || "" }
- sub dn { "" }
+ sub error { shift->{errorMessage} || '' }
+ sub dn { '' }
sub done { 1 }
}
View
2  lib/Net/LDAP/RootDSE.pm
@@ -8,7 +8,7 @@ package Net::LDAP::RootDSE;
use Net::LDAP::Entry;
our @ISA = qw(Net::LDAP::Entry);
-our $VERSION = "0.02";
+our $VERSION = '0.02';
use strict;
View
12 lib/Net/LDAP/Schema.pm
@@ -6,7 +6,7 @@ package Net::LDAP::Schema;
use strict;
-our $VERSION = "0.9906";
+our $VERSION = '0.9906';
#
# Get schema from the server (or read from LDIF) and parse it into
@@ -56,7 +56,7 @@ sub parse {
}
elsif ( -f $arg ) {
require Net::LDAP::LDIF;
- my $ldif = Net::LDAP::LDIF->new( $arg, "r" );
+ my $ldif = Net::LDAP::LDIF->new( $arg, 'r' );
$entry = $ldif->read();
unless ( $entry ) {
$schema->_error("Cannot parse LDIF from file [$arg]");
@@ -91,7 +91,7 @@ sub dump {
my $fh = @_ ? shift : \*STDOUT;
my $entry = $self->{entry} or return;
require Net::LDAP::LDIF;
- Net::LDAP::LDIF->new($fh, "w", wrap => 0)->write($entry);
+ Net::LDAP::LDIF->new($fh, 'w', wrap => 0)->write($entry);
1;
}
@@ -122,7 +122,7 @@ sub superclass {
my $oc = shift;
my $elem = $self->objectclass( $oc )
- or return scalar _error($self, "Not an objectClass");
+ or return scalar _error($self, 'Not an objectClass');
return @{$elem->{sup} || []};
}
@@ -141,9 +141,9 @@ sub _must_or_may {
#
# If called with an entry, get the OC names and continue
#
- if ( ref($oc[0]) && UNIVERSAL::isa( $oc[0], "Net::LDAP::Entry" ) ) {
+ if ( ref($oc[0]) && UNIVERSAL::isa( $oc[0], 'Net::LDAP::Entry' ) ) {
my $entry = $oc[0];
- @oc = $entry->get_value( "objectclass" )
+ @oc = $entry->get_value( 'objectclass' )
or return;
}
View
6 lib/Net/LDAP/Search.pm
@@ -13,7 +13,7 @@ use Net::LDAP::Filter;
use Net::LDAP::Constant qw(LDAP_SUCCESS LDAP_DECODING_ERROR);
our @ISA = qw(Net::LDAP::Message);
-our $VERSION = "0.14";
+our $VERSION = '0.14';
sub first_entry { # compat
@@ -47,7 +47,7 @@ sub decode {
my $entry = Net::LDAP::Entry->new;
$entry->decode($data, raw => $self->{raw})
- or $self->set_error(LDAP_DECODING_ERROR, "LDAP decode error")
+ or $self->set_error(LDAP_DECODING_ERROR, 'LDAP decode error')
and return;
push(@{$self->{entries} ||= []}, $entry);
@@ -67,7 +67,7 @@ sub decode {
return $self;
}
- $self->set_error(LDAP_DECODING_ERROR, "LDAP decode error");
+ $self->set_error(LDAP_DECODING_ERROR, 'LDAP decode error');
return;
}
View
148 lib/Net/LDAP/Util.pm
@@ -54,7 +54,7 @@ our %EXPORT_TAGS = (
escape_dn_value unescape_dn_value) ],
);
-our $VERSION = "0.14";
+our $VERSION = '0.14';
=item ldap_error_name ( ERR )
@@ -87,28 +87,28 @@ error code.
=cut
my @err2desc = (
- "Success", # 0x00 LDAP_SUCCESS
- "Operations error", # 0x01 LDAP_OPERATIONS_ERROR
- "Protocol error", # 0x02 LDAP_PROTOCOL_ERROR
- "Timelimit exceeded", # 0x03 LDAP_TIMELIMIT_EXCEEDED
- "Sizelimit exceeded", # 0x04 LDAP_SIZELIMIT_EXCEEDED
- "Compare false", # 0x05 LDAP_COMPARE_FALSE
- "Compare true", # 0x06 LDAP_COMPARE_TRUE
- "Strong authentication not supported", # 0x07 LDAP_STRONG_AUTH_NOT_SUPPORTED
- "Strong authentication required", # 0x08 LDAP_STRONG_AUTH_REQUIRED
- "Partial results and referral received", # 0x09 LDAP_PARTIAL_RESULTS
- "Referral received", # 0x0a LDAP_REFERRAL
- "Admin limit exceeded", # 0x0b LDAP_ADMIN_LIMIT_EXCEEDED
- "Critical extension not available", # 0x0c LDAP_UNAVAILABLE_CRITICAL_EXT
- "Confidentiality required", # 0x0d LDAP_CONFIDENTIALITY_REQUIRED
- "SASL bind in progress", # 0x0e LDAP_SASL_BIND_IN_PROGRESS
+ 'Success', # 0x00 LDAP_SUCCESS
+ 'Operations error', # 0x01 LDAP_OPERATIONS_ERROR
+ 'Protocol error', # 0x02 LDAP_PROTOCOL_ERROR
+ 'Timelimit exceeded', # 0x03 LDAP_TIMELIMIT_EXCEEDED
+ 'Sizelimit exceeded', # 0x04 LDAP_SIZELIMIT_EXCEEDED
+ 'Compare false', # 0x05 LDAP_COMPARE_FALSE
+ 'Compare true', # 0x06 LDAP_COMPARE_TRUE
+ 'Strong authentication not supported', # 0x07 LDAP_STRONG_AUTH_NOT_SUPPORTED
+ 'Strong authentication required', # 0x08 LDAP_STRONG_AUTH_REQUIRED
+ 'Partial results and referral received', # 0x09 LDAP_PARTIAL_RESULTS
+ 'Referral received', # 0x0a LDAP_REFERRAL
+ 'Admin limit exceeded', # 0x0b LDAP_ADMIN_LIMIT_EXCEEDED
+ 'Critical extension not available', # 0x0c LDAP_UNAVAILABLE_CRITICAL_EXT
+ 'Confidentiality required', # 0x0d LDAP_CONFIDENTIALITY_REQUIRED
+ 'SASL bind in progress', # 0x0e LDAP_SASL_BIND_IN_PROGRESS
undef,
- "No such attribute", # 0x10 LDAP_NO_SUCH_ATTRIBUTE
- "Undefined attribute type", # 0x11 LDAP_UNDEFINED_TYPE
- "Inappropriate matching", # 0x12 LDAP_INAPPROPRIATE_MATCHING
- "Constraint violation", # 0x13 LDAP_CONSTRAINT_VIOLATION
- "Type or value exists", # 0x14 LDAP_TYPE_OR_VALUE_EXISTS
- "Invalid syntax", # 0x15 LDAP_INVALID_SYNTAX
+ 'No such attribute', # 0x10 LDAP_NO_SUCH_ATTRIBUTE
+ 'Undefined attribute type', # 0x11 LDAP_UNDEFINED_TYPE
+ 'Inappropriate matching', # 0x12 LDAP_INAPPROPRIATE_MATCHING
+ 'Constraint violation', # 0x13 LDAP_CONSTRAINT_VIOLATION
+ 'Type or value exists', # 0x14 LDAP_TYPE_OR_VALUE_EXISTS
+ 'Invalid syntax', # 0x15 LDAP_INVALID_SYNTAX
undef,
undef,
undef,
@@ -119,11 +119,11 @@ my @err2desc = (
undef,
undef,
undef,
- "No such object", # 0x20 LDAP_NO_SUCH_OBJECT
- "Alias problem", # 0x21 LDAP_ALIAS_PROBLEM
- "Invalid DN syntax", # 0x22 LDAP_INVALID_DN_SYNTAX
- "Object is a leaf", # 0x23 LDAP_IS_LEAF
- "Alias dereferencing problem", # 0x24 LDAP_ALIAS_DEREF_PROBLEM
+ 'No such object', # 0x20 LDAP_NO_SUCH_OBJECT
+ 'Alias problem', # 0x21 LDAP_ALIAS_PROBLEM
+ 'Invalid DN syntax', # 0x22 LDAP_INVALID_DN_SYNTAX
+ 'Object is a leaf', # 0x23 LDAP_IS_LEAF
+ 'Alias dereferencing problem', # 0x24 LDAP_ALIAS_DEREF_PROBLEM
undef,
undef,
undef,
@@ -134,62 +134,62 @@ my @err2desc = (
undef,
undef,
undef,
- "Proxy authorization failure", # 0x2F LDAP_PROXY_AUTHZ_FAILURE
- "Inappropriate authentication", # 0x30 LDAP_INAPPROPRIATE_AUTH
- "Invalid credentials", # 0x31 LDAP_INVALID_CREDENTIALS
- "Insufficient access", # 0x32 LDAP_INSUFFICIENT_ACCESS
- "DSA is busy", # 0x33 LDAP_BUSY
- "DSA is unavailable", # 0x34 LDAP_UNAVAILABLE
- "DSA is unwilling to perform", # 0x35 LDAP_UNWILLING_TO_PERFORM
- "Loop detected", # 0x36 LDAP_LOOP_DETECT
+ 'Proxy authorization failure', # 0x2F LDAP_PROXY_AUTHZ_FAILURE
+ 'Inappropriate authentication', # 0x30 LDAP_INAPPROPRIATE_AUTH
+ 'Invalid credentials', # 0x31 LDAP_INVALID_CREDENTIALS
+ 'Insufficient access', # 0x32 LDAP_INSUFFICIENT_ACCESS
+ 'DSA is busy', # 0x33 LDAP_BUSY
+ 'DSA is unavailable', # 0x34 LDAP_UNAVAILABLE
+ 'DSA is unwilling to perform', # 0x35 LDAP_UNWILLING_TO_PERFORM
+ 'Loop detected', # 0x36 LDAP_LOOP_DETECT
undef,
undef,
undef,
undef,
undef,
- "Sort control missing", # 0x3C LDAP_SORT_CONTROL_MISSING
- "Index range error", # 0x3D LDAP_INDEX_RANGE_ERROR
+ 'Sort control missing', # 0x3C LDAP_SORT_CONTROL_MISSING
+ 'Index range error', # 0x3D LDAP_INDEX_RANGE_ERROR
undef,
undef,
- "Naming violation", # 0x40 LDAP_NAMING_VIOLATION
- "Object class violation", # 0x41 LDAP_OBJECT_CLASS_VIOLATION
- "Operation not allowed on nonleaf", # 0x42 LDAP_NOT_ALLOWED_ON_NONLEAF
- "Operation not allowed on RDN", # 0x43 LDAP_NOT_ALLOWED_ON_RDN
- "Already exists", # 0x44 LDAP_ALREADY_EXISTS
- "Cannot modify object class", # 0x45 LDAP_NO_OBJECT_CLASS_MODS
- "Results too large", # 0x46 LDAP_RESULTS_TOO_LARGE
- "Affects multiple servers", # 0x47 LDAP_AFFECTS_MULTIPLE_DSAS
+ 'Naming violation', # 0x40 LDAP_NAMING_VIOLATION
+ 'Object class violation', # 0x41 LDAP_OBJECT_CLASS_VIOLATION
+ 'Operation not allowed on nonleaf', # 0x42 LDAP_NOT_ALLOWED_ON_NONLEAF
+ 'Operation not allowed on RDN', # 0x43 LDAP_NOT_ALLOWED_ON_RDN
+ 'Already exists', # 0x44 LDAP_ALREADY_EXISTS
+ 'Cannot modify object class', # 0x45 LDAP_NO_OBJECT_CLASS_MODS
+ 'Results too large', # 0x46 LDAP_RESULTS_TOO_LARGE
+ 'Affects multiple servers', # 0x47 LDAP_AFFECTS_MULTIPLE_DSAS
undef,
undef,
undef,
undef,
- "VLV error", # 0x4C LDAP_VLV_ERROR
+ 'VLV error', # 0x4C LDAP_VLV_ERROR
undef,
undef,
undef,
- "Unknown error", # 0x50 LDAP_OTHER
- "Can't contact LDAP server", # 0x51 LDAP_SERVER_DOWN
- "Local error", # 0x52 LDAP_LOCAL_ERROR
- "Encoding error", # 0x53 LDAP_ENCODING_ERROR
- "Decoding error", # 0x54 LDAP_DECODING_ERROR
- "Timed out", # 0x55 LDAP_TIMEOUT
- "Unknown authentication method", # 0x56 LDAP_AUTH_UNKNOWN
- "Bad search filter", # 0x57 LDAP_FILTER_ERROR
- "Canceled", # 0x58 LDAP_USER_CANCELED
- "Bad parameter to an ldap routine", # 0x59 LDAP_PARAM_ERROR
- "Out of memory", # 0x5a LDAP_NO_MEMORY
- "Can't connect to the LDAP server", # 0x5b LDAP_CONNECT_ERROR
- "Not supported by this version of the LDAP protocol", # 0x5c LDAP_NOT_SUPPORTED
- "Requested LDAP control not found", # 0x5d LDAP_CONTROL_NOT_FOUND
- "No results returned", # 0x5e LDAP_NO_RESULTS_RETURNED
- "More results to return", # 0x5f LDAP_MORE_RESULTS_TO_RETURN
- "Client detected loop", # 0x60 LDAP_CLIENT_LOOP
- "Referral hop limit exceeded", # 0x61 LDAP_REFERRAL_LIMIT_EXCEEDED
+ 'Unknown error', # 0x50 LDAP_OTHER
+ 'Can\'t contact LDAP server', # 0x51 LDAP_SERVER_DOWN
+ 'Local error', # 0x52 LDAP_LOCAL_ERROR
+ 'Encoding error', # 0x53 LDAP_ENCODING_ERROR
+ 'Decoding error', # 0x54 LDAP_DECODING_ERROR
+ 'Timed out', # 0x55 LDAP_TIMEOUT
+ 'Unknown authentication method', # 0x56 LDAP_AUTH_UNKNOWN
+ 'Bad search filter', # 0x57 LDAP_FILTER_ERROR
+ 'Canceled', # 0x58 LDAP_USER_CANCELED
+ 'Bad parameter to an ldap routine', # 0x59 LDAP_PARAM_ERROR
+ 'Out of memory', # 0x5a LDAP_NO_MEMORY
+ 'Can\'t connect to the LDAP server', # 0x5b LDAP_CONNECT_ERROR
+ 'Not supported by this version of the LDAP protocol', # 0x5c LDAP_NOT_SUPPORTED
+ 'Requested LDAP control not found', # 0x5d LDAP_CONTROL_NOT_FOUND
+ 'No results returned', # 0x5e LDAP_NO_RESULTS_RETURNED
+ 'More results to return', # 0x5f LDAP_MORE_RESULTS_TO_RETURN
+ 'Client detected loop', # 0x60 LDAP_CLIENT_LOOP
+ 'Referral hop limit exceeded', # 0x61 LDAP_REFERRAL_LIMIT_EXCEEDED
);
sub ldap_error_desc {
my $code = (ref($_[0]) ? $_[0]->code : $_[0]);
- $err2desc[$code] || sprintf("LDAP error code %d(0x%02X)", $code, $code);
+ $err2desc[$code] || sprintf('LDAP error code %d(0x%02X)', $code, $code);
}
@@ -295,19 +295,19 @@ sub canonical_dn($%) {
my $val = $rdn->{$_};
if ( ref($val) ) {
- $val = '#' . unpack("H*", $$val);
+ $val = '#' . unpack('H*', $$val);
} else {
#escape insecure characters and optionally MBCs
if ( $opt{mbcescape} ) {
$val =~ s/([\x00-\x1f\/\\",=+<>#;\x7f-\xff])/
- sprintf("\\%02x", ord($1))/xeg;
+ sprintf('\\%02x', ord($1))/xeg;
} else {
$val =~ s/([\x00-\x1f\/\\",=+<>#;])/
- sprintf("\\%02x", ord($1))/xeg;
+ sprintf('\\%02x', ord($1))/xeg;
}
#escape leading and trailing whitespace
$val =~ s/(^\s+|\s+$)/
- "\\20" x length $1/xeg;
+ '\\20' x length $1/xeg;
#compact multiple spaces
$val =~ s/\s+/ /g;
}
@@ -512,7 +512,7 @@ sub escape_filter_value(@)
{
my @values = @_;
- map { $_ =~ s/([\x00-\x1F\*\(\)\\])/"\\".unpack("H2", $1)/oge; } @values;
+ map { $_ =~ s/([\x00-\x1F\*\(\)\\])/'\\'.unpack('H2', $1)/oge; } @values;
return(wantarray ? @values : $values[0]);
}
@@ -536,7 +536,7 @@ sub unescape_filter_value(@)
{
my @values = @_;
- map { $_ =~ s/\\([0-9a-fA-F]{2})/pack("H2", $1)/oge; } @values;
+ map { $_ =~ s/\\([0-9a-fA-F]{2})/pack('H2', $1)/oge; } @values;
return(wantarray ? @values : $values[0]);
}
@@ -566,8 +566,8 @@ sub escape_dn_value(@)
my @values = @_;
map { $_ =~ s/([\\",=+<>#;])/\\$1/og;
- $_ =~ s/([\x00-\x1F])/"\\".unpack("H2", $1)/oge;
- $_ =~ s/(^ +| +$)/"\\20" x length($1)/oge; } @values;
+ $_ =~ s/([\x00-\x1F])/'\\'.unpack('H2', $1)/oge;
+ $_ =~ s/(^ +| +$)/'\\20' x length($1)/oge; } @values;
return(wantarray ? @values : $values[0]);
}
@@ -593,7 +593,7 @@ sub unescape_dn_value(@)
my @values = @_;
map { $_ =~ s/\\([\\",=+<>#;]|[0-9a-fA-F]{2})
- /(length($1)==1) ? $1 : pack("H2", $1)
+ /(length($1)==1) ? $1 : pack('H2', $1)
/ogex; } @values;
return(wantarray ? @values : $values[0]);
View
2  lib/Net/LDAPI.pm
@@ -9,7 +9,7 @@ use strict;
use Net::LDAP;
our @ISA = qw(Net::LDAP);
-our $VERSION = "0.04";
+our $VERSION = '0.04';
sub new {
shift->SUPER::new(@_, scheme => 'ldapi');
View
2  lib/Net/LDAPS.pm
@@ -9,7 +9,7 @@ use strict;
use Net::LDAP;
our @ISA = qw(Net::LDAP);
-our $VERSION = "0.06";
+our $VERSION = '0.06';
sub new {
shift->SUPER::new(@_, scheme => 'ldaps');
Please sign in to comment.
Something went wrong with that request. Please try again.