remove local credential on download of config files from remote systems

(blacklists, language, skins) to reduce risk to expose md5-pwd.
- remove NoSuchElementException in loop
This commit is contained in:
reger 2016-01-01 06:08:41 +01:00
parent e9539b1086
commit 9636a74633
4 changed files with 5 additions and 9 deletions

View File

@ -72,12 +72,10 @@ public class BlacklistImpExp_p {
if (seed != null) hostList.put(seed.get(Seed.NAME, "nameless"),seed.hash);
}
String peername;
while ((peername = hostList.firstKey()) != null) {
for (String peername : hostList.keySet()) {
final String Hash = hostList.get(peername);
prop.putHTML(DISABLED + "otherHosts_" + peerCount + "_hash", Hash);
prop.putXML(DISABLED + "otherHosts_" + peerCount + "_name", peername);
hostList.remove(peername);
peerCount++;
}
} catch (final Exception e) {

View File

@ -102,7 +102,7 @@ public class ConfigAppearance_p {
final Iterator<String> it;
try {
final DigestURL u = new DigestURL(url);
it = FileUtils.strings(u.get(ClientIdentification.yacyInternetCrawlerAgent, sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, "admin"), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "")));
it = FileUtils.strings(u.get(ClientIdentification.yacyInternetCrawlerAgent, null, null));
} catch (final IOException e) {
prop.put("status", "1");// unable to get URL
prop.put("status_url", url);

View File

@ -46,7 +46,6 @@ import net.yacy.data.Translator;
import net.yacy.data.WorkTables;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@ -102,7 +101,7 @@ public class ConfigLanguage_p {
Iterator<String> it;
try {
final DigestURL u = new DigestURL(url);
it = FileUtils.strings(u.get(ClientIdentification.yacyInternetCrawlerAgent, sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, "admin"), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "")));
it = FileUtils.strings(u.get(ClientIdentification.yacyInternetCrawlerAgent, null, null));
} catch(final IOException e) {
prop.put("status", "1");//unable to get url
prop.put("status_url", url);

View File

@ -51,7 +51,6 @@ import net.yacy.peers.Seed;
import net.yacy.repository.Blacklist;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.search.query.SearchEventCache;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
@ -140,7 +139,7 @@ public class sharedBlacklist_p {
// get List
final DigestURL u = new DigestURL(downloadURLOld);
otherBlacklist = FileUtils.strings(u.get(agent, sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, "admin"), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "")));
otherBlacklist = FileUtils.strings(u.get(agent, null, null));
} catch (final Exception e) {
prop.put("status", STATUS_PEER_UNKNOWN);
prop.putHTML("status_name", hash);
@ -157,7 +156,7 @@ public class sharedBlacklist_p {
try {
final DigestURL u = new DigestURL(downloadURL);
otherBlacklist = FileUtils.strings(u.get(agent, sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_USER_NAME, "admin"), sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "")));
otherBlacklist = FileUtils.strings(u.get(agent, null, null));
} catch (final Exception e) {
prop.put("status", STATUS_URL_PROBLEM);
prop.putHTML("status_address",downloadURL);