BackupPC-users

[BackupPC-users] [Hack/Patch] Workaround for "void endpwent()(3) is not implemented on Android"

2013-08-22 17:43:57
Subject: [BackupPC-users] [Hack/Patch] Workaround for "void endpwent()(3) is not implemented on Android"
From: Wolfgang Karall <lists+backuppc-users AT karall-edv DOT at>
To: backuppc-users AT lists.sourceforge DOT net
Date: Thu, 22 Aug 2013 23:24:02 +0200
Hello,

just in case anyone is using BackupPC (thanks for that great piece of
software, Craig!) with current CyanogenMod stable (10.1.2, don't know if
other versions are affected):

Bbecause sshd/libc is complaining and print the output

void endpwent()(3) is not implemented on Android

whenever you log in via SSH, resulting in protocol version mismatch
when trying to transfer files with $Conf{XferMethod} = 'rsync', I
patched File::RsyncP like this (tested on Debian 7.1):

--- RsyncP.pm.orig      2010-07-25 22:50:02.000000000 +0200
+++ RsyncP.pm   2013-08-22 23:18:15.000000000 +0200
@@ -397,6 +397,12 @@ sub remoteStart
     $rs->log("Fetching remote protocol") if ( $rs->{logLevel} >= 5 );
     return -1 if ( $rs->getData(4) < 0 );
     my $data = $rs->{readData};
+    if ( $data =~ /^void endpwent\(\)\(3\) is not implemented on
Android/ ) {
+       $rs->log("Working around Android bug") if ( $rs->{logLevel} >= 1
);
+       $rs->{readData} = '';
+       return -1 if ( $rs->getData(4) < 0 );
+       $data = $rs->{readData};
+    }
     my $version = unpack("V", $rs->{readData});
     $rs->{readData} = substr($rs->{readData}, 4);
     $rs->{remote_protocol} = $version;

It's ugly, but it "works for me". :)

Cheers
Wolfgang

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>