From 525ec01c1e787d8e298dc0331833e88a90393f26 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Tue, 2 Jun 2015 15:41:42 +0000 Subject: [PATCH] Console: Don't allow unbanning of all-zero hash --- .../java/src/net/i2p/router/web/BanlistRenderer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java index a57b70d8ae..d59c32fe4e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java @@ -61,7 +61,9 @@ public class BanlistRenderer { buf.append("<li>").append(_context.commSystem().renderPeerHTML(key)); buf.append(' '); String expireString = DataHelper.formatDuration2(expires); - if (expires < 5l*24*60*60*1000) + if (key.equals(Hash.FAKE_HASH)) + buf.append(_("Permanently banned")); + else if (expires < 5l*24*60*60*1000) buf.append(_("Temporary ban expiring in {0}", expireString)); else buf.append(_("Banned until restart or in {0}", expireString)); @@ -75,8 +77,10 @@ public class BanlistRenderer { else buf.append(_(entry.cause)); } - buf.append(" (<a href=\"configpeer?peer=").append(key.toBase64()) - .append("#unsh\">").append(_("unban now")).append("</a>)"); + if (!key.equals(Hash.FAKE_HASH)) { + buf.append(" (<a href=\"configpeer?peer=").append(key.toBase64()) + .append("#unsh\">").append(_("unban now")).append("</a>)"); + } buf.append("</li>\n"); } buf.append("</ul>\n"); -- GitLab