summaryrefslogtreecommitdiff
path: root/security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2005-10-05 16:31:43 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2005-10-05 16:31:43 +0000
commitef82fc20c75ad5d2a32c8a7a761ea933fb51af8c (patch)
tree7088b158e56aa6a214c6040a5994afc3a910a2b3 /security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm
parentIntroduce a versioned dependency on p5-Net-DNS. Earlier versions look fishy (diff)
New port
The Authen::CyrusSASL module provides a simple class that allows you to send request to the cyrus-sasl's authen daemon. This module is based on the Authen::Radius module with the similar interface. PR: 86943 Submitted by: Attila Nagy <bra@fsn.hu> Approved by: pav (mentor)
Notes
Notes: svn path=/head/; revision=144309
Diffstat (limited to 'security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm')
-rw-r--r--security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm49
1 files changed, 49 insertions, 0 deletions
diff --git a/security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm b/security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm
new file mode 100644
index 000000000000..9c67c8bcd7ff
--- /dev/null
+++ b/security/p5-Authen-CyrusSASL/files/patch-CyrusSASL.pm
@@ -0,0 +1,49 @@
+--- Authen/CyrusSASL.pm.orig Mon Sep 24 15:41:30 2001
++++ Authen/CyrusSASL.pm Fri Aug 26 13:34:21 2005
+@@ -76,10 +76,13 @@
+ }
+
+ sub check_pwd {
+- my ($self, $name, $pwd) = @_;
++ my ($self, $name, $pwd, $service, $realm) = @_;
+ my ($req, $res, $sh);
+
+- $req = "$name\0$pwd\0";
++ $service = "imap" unless defined ($service);
++ $realm = "" unless defined ($realm);
++
++ $req = sprintf ("\0%c%s\0%c%s\0%c%s\0%c%s", length $name, $name, length $pwd, $pwd, length $service, $service, length $realm, $realm);
+ $res = ' ' x 1024;
+
+ # send request
+@@ -93,7 +96,7 @@
+ # sock->recv does not work
+ #$self->{'sock'}->recv ($res, 1024, 0) or return SASL_FAIL;
+
+- if (substr($res, 0, 2) ne 'OK') {
++ if (substr($res, 2, 2) ne 'OK') {
+ $! = substr($res, 3);
+ return SASL_BADAUTH;
+ }
+@@ -113,10 +116,10 @@
+ use Authen::CyrusSASL;
+
+ $p = new Authen::CyrusSASL(Type => SASL_AUTHD, Dir => '/var/run/saslauthd');
+- print "check=", $r->check_pwd('username', 'userpass'), "\n";
++ print "check=", $r->check_pwd('username', 'userpass', 'service', 'realm'), "\n";
+
+ $p = new Authen::CyrusSASL(Type => SASL_PWCHECK, Dir => '/var/run/pwcheck');
+- print "check=", $r->check_pwd('username', 'userpass'), "\n";
++ print "check=", $r->check_pwd('username', 'userpass', 'service', 'realm'), "\n";
+
+ =head1 DESCRIPTION
+
+@@ -154,7 +157,7 @@
+
+ =over 4
+
+-=item check_pwd ( USERNAME, PASSWORD )
++=item check_pwd ( USERNAME, PASSWORD, SERVICE, REALM )
+
+ Checks with the SASL server if the specified C<PASSWORD> is valid for user
+ C<USERNAME>. It returns SASL_OK if the C<PASSWORD> is correct,