Changeset f194f78


Ignore:
Timestamp:
Dec 12, 2010 10:09:04 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2880d61
Parents:
a5354f6
Message:

use base 64 for temp dir name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/I2PAppContext.java

    ra5354f6 rf194f78  
    44import java.util.HashSet;
    55import java.util.Properties;
     6import java.util.Random;
    67import java.util.Set;
    78
     
    2223import net.i2p.crypto.SessionKeyManager;
    2324import net.i2p.crypto.TransientSessionKeyManager;
     25import net.i2p.data.Base64;
    2426import net.i2p.data.RoutingKeyGenerator;
    2527import net.i2p.internal.InternalClientManager;
     
    365367                String d = getProperty("i2p.dir.temp", System.getProperty("java.io.tmpdir"));
    366368                // our random() probably isn't warmed up yet
    367                 String f = "i2p-" + Math.abs((new java.util.Random()).nextInt()) + ".tmp";
     369                byte[] rand = new byte[6];
     370                (new Random()).nextBytes(rand);
     371                String f = "i2p-" + Base64.encode(rand) + ".tmp";
    368372                _tmpDir = new SecureDirectory(d, f);
    369373                if (_tmpDir.exists()) {
    370                     // good or bad ?
     374                    // good or bad ? loop and try again?
    371375                } else if (_tmpDir.mkdir()) {
    372376                    _tmpDir.deleteOnExit();
Note: See TracChangeset for help on using the changeset viewer.