I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit b1f17255 authored by zzz's avatar zzz
Browse files

* Router: Set permissions on wrapper.log when not called by RouterLaunch

parent 4bb902a8
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ public class SecureFileOutputStream extends FileOutputStream { ...@@ -56,7 +56,7 @@ public class SecureFileOutputStream extends FileOutputStream {
* Tries to set the permissions to 600, * Tries to set the permissions to 600,
* ignores errors * ignores errors
*/ */
private static void setPerms(File f) { public static void setPerms(File f) {
if (!canSetPerms) if (!canSetPerms)
return; return;
try { try {
......
...@@ -218,6 +218,19 @@ public class Router { ...@@ -218,6 +218,19 @@ public class Router {
// NOW we start all the activity // NOW we start all the activity
_context.initAll(); _context.initAll();
// Set wrapper.log permissions.
// Just hope this is the right location, we don't know for sure,
// but this is the same method used in LogsHelper and we have no complaints.
// (we could look for the wrapper.config file and parse it I guess...)
// If we don't have a wrapper, RouterLaunch does this for us.
if (System.getProperty("wrapper.version") != null) {
File f = new File(System.getProperty("java.io.tmpdir"), "wrapper.log");
if (!f.exists())
f = new File(_context.getBaseDir(), "wrapper.log");
if (f.exists())
SecureFileOutputStream.setPerms(f);
}
_routerInfo = null; _routerInfo = null;
_higherVersionSeen = false; _higherVersionSeen = false;
_log = _context.logManager().getLog(Router.class); _log = _context.logManager().getLog(Router.class);
......
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