From 2600519c4de58577877dfed179377a8cd795e07c Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Sun, 15 Jan 2012 10:43:49 -0500 Subject: [PATCH] sets the install chmod perms to 700 properly --- .../android/service/TorBinaryInstaller.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/org/torproject/android/service/TorBinaryInstaller.java b/src/org/torproject/android/service/TorBinaryInstaller.java index 9a560040..68ce745c 100644 --- a/src/org/torproject/android/service/TorBinaryInstaller.java +++ b/src/org/torproject/android/service/TorBinaryInstaller.java @@ -34,7 +34,8 @@ public class TorBinaryInstaller implements TorServiceConstants { Context context; private static int isARMv6 = -1; - + private static String CHMOD_EXEC = "700"; + public TorBinaryInstaller (Context context, File installFolder) { this.installFolder = installFolder; @@ -116,7 +117,6 @@ public class TorBinaryInstaller implements TorServiceConstants { } while ((bytecount = stm.read(buffer)) > 0) - { stmOut.write(buffer, 0, bytecount); @@ -229,26 +229,17 @@ public class TorBinaryInstaller implements TorServiceConstants { File file = new File(ctx.getDir("bin",0), "iptables"); if ((!file.exists()) && isARMv6()) { - copyRawFile(ctx, R.raw.iptables_g1, file, "755"); + copyRawFile(ctx, R.raw.iptables_g1, file, CHMOD_EXEC); changed = true; } // Check iptables_n1 file = new File(ctx.getDir("bin",0), "iptables"); if ((!file.exists()) && (!isARMv6())) { - copyRawFile(ctx, R.raw.iptables_n1, file, "755"); + copyRawFile(ctx, R.raw.iptables_n1, file, CHMOD_EXEC); changed = true; } - // Check busybox - /* - file = new File(ctx.getDir("bin",0), "busybox_g1"); - if (!file.exists()) { - copyRawFile(ctx, R.raw.busybox_g1, file, "755"); - changed = true; - } - */ - return true; }