|
|
befaba |
From 93a1f2fd26cfef95c22530be07ca0e211f7e44d0 Mon Sep 17 00:00:00 2001
|
|
|
befaba |
From: Peter Marschall <peter@adpm.de>
|
|
|
befaba |
Date: Sat, 7 Jun 2014 15:38:36 +0200
|
|
|
befaba |
Subject: [PATCH] RT#96203: LDAP.pm: use correct length for syswrite
|
|
|
befaba |
MIME-Version: 1.0
|
|
|
befaba |
Content-Type: text/plain; charset=UTF-8
|
|
|
befaba |
Content-Transfer-Encoding: 8bit
|
|
|
befaba |
|
|
|
befaba |
Use correct length of bytes to write with syswrite() instead of default 15000
|
|
|
befaba |
in _sendmesg().
|
|
|
befaba |
|
|
|
befaba |
According to the bug reporter, it may cause error in case that the function
|
|
|
befaba |
WRITE was redefined (e.g. Authen-SASL RT#85294) and did not handle this case
|
|
|
befaba |
properly.
|
|
|
befaba |
|
|
|
befaba |
It should not change anything in Net::LDAP but help other modules not covering
|
|
|
befaba |
all WRITE cases.
|
|
|
befaba |
|
|
|
befaba |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
befaba |
---
|
|
|
befaba |
lib/Net/LDAP.pm | 3 ++-
|
|
|
befaba |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
befaba |
|
|
|
befaba |
diff --git a/lib/Net/LDAP.pm b/lib/Net/LDAP.pm
|
|
|
befaba |
index 2f873ad..6505276 100644
|
|
|
befaba |
--- a/lib/Net/LDAP.pm
|
|
|
befaba |
+++ b/lib/Net/LDAP.pm
|
|
|
befaba |
@@ -842,7 +842,8 @@ sub _sendmesg {
|
|
|
befaba |
my $to_send = \( $mesg->pdu );
|
|
|
befaba |
my $offset = 0;
|
|
|
befaba |
while ($offset < length($$to_send)) {
|
|
|
befaba |
- my $n = syswrite($socket, substr($$to_send, $offset, 15000), 15000)
|
|
|
befaba |
+ my $s = substr($$to_send, $offset, 15000);
|
|
|
befaba |
+ my $n = syswrite($socket, $s, length($s))
|
|
|
befaba |
or return _error($ldap, $mesg, LDAP_LOCAL_ERROR, "$!");
|
|
|
befaba |
$offset += $n;
|
|
|
befaba |
}
|
|
|
befaba |
--
|
|
|
befaba |
1.9.3
|
|
|
befaba |
|