Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 12 Apr 2012 23:14:01 +0400
From: Solar Designer <solar@...nwall.com>
To: lftp-devel@...yar.ac.ru
Cc: owl-dev@...ts.openwall.com
Subject: torrent my_peer_id fix for large PIDs

Alexander,

Attached is a patch against lftp 4.3.6 to fix
my_peer_id.length()==PEER_ID_LEN assertion failure when lftp's PID is
above 0xffff.  I think you may apply this as-is or you may choose to
unambiguously encode larger PIDs in my_peer_id somehow.

Thanks,

Alexander

--- lftp-4.3.6/src/Torrent.cc.orig	2012-02-14 10:09:24 +0000
+++ lftp-4.3.6/src/Torrent.cc	2012-04-12 18:56:46 +0000
@@ -173,7 +173,7 @@ Torrent::Torrent(const char *mf,const ch
    }
    if(!my_peer_id) {
       my_peer_id.set("-lftp43-");
-      my_peer_id.appendf("%04x",(unsigned)getpid());
+      my_peer_id.appendf("%04x",(unsigned)getpid() & 0xffff);
       my_peer_id.appendf("%08x",(unsigned)now.UnixTime());
       assert(my_peer_id.length()==PEER_ID_LEN);
    }

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ