commit 92d19e3402874a9e77803e34f6d2779a780b7c5d
Author: Nathan Freitas <nat...@freitas.net>
Date:   Sun Jan 12 22:14:30 2014 -0500

    ensures binary permissions are set
---
 src/org/torproject/android/service/TorService.java |   21 +++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/org/torproject/android/service/TorService.java 
b/src/org/torproject/android/service/TorService.java
index b052951..f27f835 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -587,19 +587,30 @@ public class TorService extends Service implements 
TorServiceConstants, TorConst
                        boolean success = installer.installResources();
                                
                }
-                       
+               
+               try
+               {
+                       setBinaryPerms();
+               }
+               catch (Exception e)
+               {
+                       logNotice("Error setting binary permissions: " + 
e.toString());
+               }
                
     }
 
-    
-    /*
     private void setBinaryPerms () throws Exception
     {
+       
+       logNotice("Is Tor binary exec? " + fileTorOrig.canExecute());
+       logNotice("Is Tor binary exec? " + filePrivoxy.canExecute());
+       logNotice("Is Tor binary exec? " + fileObfsProxy.canExecute());
+       
        
                StringBuilder log = new StringBuilder ();
                
                logNotice("(re)Setting permission on Tor binary");
-               String[] cmd1 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' 
+ fileTor.getAbsolutePath()};
+               String[] cmd1 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' 
+ fileTorOrig.getAbsolutePath()};
                TorServiceUtils.doShellCommand(cmd1, log, false, true);
                
                logNotice("(re)Setting permission on Privoxy binary");
@@ -610,7 +621,7 @@ public class TorService extends Service implements 
TorServiceConstants, TorConst
                String[] cmd3 = {SHELL_CMD_CHMOD + ' ' + CHMOD_EXE_VALUE + ' ' 
+ fileObfsProxy.getAbsolutePath()};
                TorServiceUtils.doShellCommand(cmd3, log, false, true);
                
-    }*/
+    }
     
     private boolean mHasRoot = false;
     private boolean mEnableTransparentProxy = false;



_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to