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

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

i2ptunnel: Don't default to a private key file that exists (ticket #1628)

Fix build.xml war dependency tracking
parent d28f983c
No related branches found
No related tags found
No related merge requests found
......@@ -235,6 +235,7 @@
<target name="warUpToDate">
<uptodate property="war.uptodate" targetfile="build/i2ptunnel.war" >
<srcfiles dir= "../jsp" excludes="web.xml, web-fragment.xml, **/*.java, *.jsp" />
<srcfiles dir= "build/obj" includes="**/ui/*.class **/web/*.class" />
</uptodate>
<condition property="shouldListChanges2" >
<and>
......
......@@ -267,13 +267,21 @@ public class GeneralHelper {
public String getPrivateKeyFile(int tunnel) {
return getPrivateKeyFile(_group, tunnel);
}
public static String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
public String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
TunnelController tun = getController(tcg, tunnel);
if (tun != null && tun.getPrivKeyFile() != null)
return tun.getPrivKeyFile();
if (tunnel < 0)
tunnel = tcg == null ? 999 : tcg.getControllers().size();
return "i2ptunnel" + tunnel + "-privKeys.dat";
String rv = "i2ptunnel" + tunnel + "-privKeys.dat";
// Don't default to a file that already exists,
// which could happen after other tunnels are deleted.
int i = 0;
while ((new File(_context.getConfigDir(), rv)).exists()) {
rv = "i2ptunnel" + tunnel + '.' + (++i) + "-privKeys.dat";
}
return rv;
}
public String getClientInterface(int tunnel) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment