Changeset b1f17255


Ignore:
Timestamp:
Oct 24, 2010 4:52:41 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
adab0cc
Parents:
4bb902a
Message:
  • Router: Set permissions on wrapper.log when not called by RouterLaunch?
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/SecureFileOutputStream.java

    r4bb902a rb1f17255  
    5757     *  ignores errors
    5858     */
    59     private static void setPerms(File f) {
     59    public static void setPerms(File f) {
    6060        if (!canSetPerms)
    6161            return;
  • router/java/src/net/i2p/router/Router.java

    r4bb902a rb1f17255  
    218218        // NOW we start all the activity
    219219        _context.initAll();
     220
     221        // Set wrapper.log permissions.
     222        // Just hope this is the right location, we don't know for sure,
     223        // but this is the same method used in LogsHelper and we have no complaints.
     224        // (we could look for the wrapper.config file and parse it I guess...)
     225        // If we don't have a wrapper, RouterLaunch does this for us.
     226        if (System.getProperty("wrapper.version") != null) {
     227            File f = new File(System.getProperty("java.io.tmpdir"), "wrapper.log");
     228            if (!f.exists())
     229                f = new File(_context.getBaseDir(), "wrapper.log");
     230            if (f.exists())
     231                SecureFileOutputStream.setPerms(f);
     232        }
    220233
    221234        _routerInfo = null;
Note: See TracChangeset for help on using the changeset viewer.