HADOOP-10830. Missing lock in JavaKeyStoreProvider.createCredentialEntry. Contributed by Benoy Antony.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1612905 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc329d0d55
commit
a19e0b890d
|
@ -371,6 +371,9 @@ Release 2.5.0 - UNRELEASED
|
||||||
|
|
||||||
HADOOP-10801 dead link in site.xml (Akira AJISAKA via stevel)
|
HADOOP-10801 dead link in site.xml (Akira AJISAKA via stevel)
|
||||||
|
|
||||||
|
HADOOP-10830. Missing lock in JavaKeyStoreProvider.createCredentialEntry.
|
||||||
|
(Benoy Antony via umamahesh)
|
||||||
|
|
||||||
BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS
|
BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS
|
||||||
|
|
||||||
HADOOP-10520. Extended attributes definition and FileSystem APIs for
|
HADOOP-10520. Extended attributes definition and FileSystem APIs for
|
||||||
|
|
|
@ -194,15 +194,18 @@ public class JavaKeyStoreProvider extends CredentialProvider {
|
||||||
@Override
|
@Override
|
||||||
public CredentialEntry createCredentialEntry(String alias, char[] credential)
|
public CredentialEntry createCredentialEntry(String alias, char[] credential)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
writeLock.lock();
|
||||||
try {
|
try {
|
||||||
if (keyStore.containsAlias(alias) || cache.containsKey(alias)) {
|
if (keyStore.containsAlias(alias) || cache.containsKey(alias)) {
|
||||||
throw new IOException("Credential " + alias + " already exists in " + this);
|
throw new IOException("Credential " + alias + " already exists in " + this);
|
||||||
}
|
}
|
||||||
|
return innerSetCredential(alias, credential);
|
||||||
} catch (KeyStoreException e) {
|
} catch (KeyStoreException e) {
|
||||||
throw new IOException("Problem looking up credential " + alias + " in " + this,
|
throw new IOException("Problem looking up credential " + alias + " in " + this,
|
||||||
e);
|
e);
|
||||||
|
} finally {
|
||||||
|
writeLock.unlock();
|
||||||
}
|
}
|
||||||
return innerSetCredential(alias, credential);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue