Skip to content

Commit 464d7d9

Browse files
authored
HDFS-17668 Treat null SASL negotiated QOP as auth in DataTransferSasl… (#7171)
1 parent 964e089 commit 464d7d9

File tree

1 file changed

+7
-2
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl

1 file changed

+7
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/DataTransferSaslUtil.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,15 @@ public static void checkSaslComplete(SaslParticipant sasl,
104104
String negotiatedQop = sasl.getNegotiatedQop();
105105
LOG.debug("{}: Verifying QOP: requested = {}, negotiated = {}",
106106
sasl, requestedQop, negotiatedQop);
107-
if (negotiatedQop != null && !requestedQop.contains(negotiatedQop)) {
107+
// Treat null negotiated QOP as "auth" for the purpose of verification
108+
// Code elsewhere does the same implicitly
109+
if(negotiatedQop == null) {
110+
negotiatedQop = "auth";
111+
}
112+
if (!requestedQop.contains(negotiatedQop)) {
108113
throw new IOException(String.format("SASL handshake completed, but " +
109114
"channel does not have acceptable quality of protection, " +
110-
"requested = %s, negotiated = %s", requestedQop, negotiatedQop));
115+
"requested = %s, negotiated(effective) = %s", requestedQop, negotiatedQop));
111116
}
112117
}
113118

0 commit comments

Comments
 (0)