From 4feed9b2dbff7bc52871cde7e1ff31b862e4fe9a Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Fri, 15 Apr 2016 17:43:38 +0100 Subject: [PATCH] HADOOP-13026 Should not wrap IOExceptions into a AuthenticationException in KerberosAuthenticator. Xuan Gong via stevel --- .../authentication/client/KerberosAuthenticator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/KerberosAuthenticator.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/KerberosAuthenticator.java index 0f046ae9f3e..a69ee46bbae 100644 --- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/KerberosAuthenticator.java +++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/KerberosAuthenticator.java @@ -327,7 +327,11 @@ public class KerberosAuthenticator implements Authenticator { } }); } catch (PrivilegedActionException ex) { - throw new AuthenticationException(ex.getException()); + if (ex.getException() instanceof IOException) { + throw (IOException) ex.getException(); + } else { + throw new AuthenticationException(ex.getException()); + } } catch (LoginException ex) { throw new AuthenticationException(ex); }