Skip to content

Commit 20eb4e5

Browse files
stotyMikaelSmith
authored andcommitted
CDPD-90798: HDFS-17668 Treat null SASL negotiated QOP as auth in DataTransferSasl… (apache#7171)
(cherry picked from commit c4cdd997078aaeff163e44f34d2900c08c415b8c) Change-Id: I7d80fd4852df81a7d25649fc9709871a6f63c5e8
1 parent 4c7ddb3 commit 20eb4e5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

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

Lines changed: 7 additions & 2 deletions
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)