Changeset 8086023


Ignore:
Timestamp:
Feb 27, 2016 4:17:25 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6e7f015
Parents:
d28f983c
Message:

i2ptunnel: Don't default to a private key file that exists (ticket #1628)
Fix build.xml war dependency tracking

Location:
apps/i2ptunnel/java
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/build.xml

    rd28f983c r8086023  
    236236        <uptodate property="war.uptodate" targetfile="build/i2ptunnel.war" >
    237237            <srcfiles dir= "../jsp" excludes="web.xml, web-fragment.xml, **/*.java, *.jsp" />
     238            <srcfiles dir= "build/obj" includes="**/ui/*.class **/web/*.class" />
    238239        </uptodate>
    239240        <condition property="shouldListChanges2" >
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java

    rd28f983c r8086023  
    268268        return getPrivateKeyFile(_group, tunnel);
    269269    }
    270     public static String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
     270
     271    public String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
    271272        TunnelController tun = getController(tcg, tunnel);
    272273        if (tun != null && tun.getPrivKeyFile() != null)
     
    274275        if (tunnel < 0)
    275276            tunnel = tcg == null ? 999 : tcg.getControllers().size();
    276         return "i2ptunnel" + tunnel + "-privKeys.dat";
     277        String rv = "i2ptunnel" + tunnel + "-privKeys.dat";
     278        // Don't default to a file that already exists,
     279        // which could happen after other tunnels are deleted.
     280        int i = 0;
     281        while ((new File(_context.getConfigDir(), rv)).exists()) {
     282            rv = "i2ptunnel" + tunnel + '.' + (++i) + "-privKeys.dat";
     283        }
     284        return rv;
    277285    }
    278286
Note: See TracChangeset for help on using the changeset viewer.