diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/Verifier.java b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/Verifier.java index f3202a1d33..3c0e5fe36e 100644 --- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/Verifier.java +++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/Verifier.java @@ -41,12 +41,18 @@ protected Verifier(AuthFlavor flavor) { public static Verifier readFlavorAndVerifier(XDR xdr) { AuthFlavor flavor = AuthFlavor.fromValue(xdr.readInt()); final Verifier verifer; - if(flavor == AuthFlavor.AUTH_NONE) { + if (flavor == AuthFlavor.AUTH_NONE) { verifer = new VerifierNone(); - } else if(flavor == AuthFlavor.RPCSEC_GSS) { + } else if (flavor == AuthFlavor.AUTH_SYS) { + // Added in HADOOP-15307 based on HDFS-5085: + // When the auth flavor is AUTH_SYS, the corresponding verifier is + // AUTH_NONE. I.e., it is impossible to have a verifier with auth + // flavor AUTH_SYS. + verifer = new VerifierNone(); + } else if (flavor == AuthFlavor.RPCSEC_GSS) { verifer = new VerifierGSS(); } else { - throw new UnsupportedOperationException("Unsupported verifier flavor" + throw new UnsupportedOperationException("Unsupported verifier flavor: " + flavor); } verifer.read(xdr);