Skip to content
Snippets Groups Projects
Commit 860ac7b4 authored by Matthias Goebl's avatar Matthias Goebl
Browse files

Added fix for 'Permission denied' while reading Dropbear PID.

parent 36f36a02
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DroidSSHdaemon</name>
<name>DroidSSHdaemon-mg</name>
<comment></comment>
<projects>
</projects>
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.bott.droidsshd"
android:installLocation="auto"
android:versionName="0.6-mg"
android:versionName="0.6-mg2"
android:versionCode="6">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Loading
Loading
Loading
Loading
@@ -301,6 +301,7 @@ public class DroidSSHd extends Activity {
String cmd = "kill -2 " + pid;
// Util.doRun(cmd, Base.runDaemonAsRoot(), mLogviewHandler);
Util.doRun(cmd, Base.runDaemonAsRoot(), null);
Util.doRun("killall -2 dropbear", Base.runDaemonAsRoot(), null);
stopService(mDropbearDaemonHandlerService);
}
startLongRunningOperation();
Loading
Loading
Loading
Loading
@@ -132,6 +132,7 @@ public class DroidSSHdService extends Service{
String cmd = "kill -2 " + pid;
//Util.doRun(cmd, Base.runDaemonAsRoot(), mLogviewHandler);
Util.doRun(cmd, Base.runDaemonAsRoot(), null);
Util.doRun("killall -2 dropbear", Base.runDaemonAsRoot(), null);
Util.releaseWakeLock();
Util.releaseWifiLock();
hideNotification();
Loading
Loading
Loading
Loading
@@ -100,6 +100,20 @@ public class Util {
Log.d(TAG, "pidFile = " + pid + " - " + pidFile.getAbsolutePath() + " = " + tmp);
}
}
catch (FileNotFoundException ex) {
if(ex.getMessage().contains("EACCES")) {
if (Base.debug) {
Log.d(TAG, "Permission denied reading Dropbear PID file " + pidFile.getAbsolutePath() + ". Running command to fix this.");
}
doRun("chmod 0644 " + path, true, null);
} else {
ex.printStackTrace();
if (Base.debug) {
Log.d(TAG, "Can't read Dropbear PID file " + pidFile.getAbsolutePath());
}
return pid;
}
}
catch (Exception ex) {
ex.printStackTrace();
if (Base.debug) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment