Skip to content

Commit e750aeb

Browse files
HDFS-16356. JournalNode short name missmatch
1 parent c9d64ba commit e750aeb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ protected boolean isValidRequestor(HttpServletRequest request, Configuration con
7979
throws IOException {
8080
String remotePrincipal = request.getUserPrincipal().getName();
8181
String remoteShortName = request.getRemoteUser();
82+
if (remoteShortName != null && remoteShortName.contains('/')) {
83+
remoteShortName = remoteShortName.substr(0, remoteShortName.indexOf('/'));
84+
}
8285
if (remotePrincipal == null) { // This really shouldn't happen...
8386
LOG.warn("Received null remoteUser while authorizing access to " +
8487
"GetJournalEditServlet");

0 commit comments

Comments
 (0)