[ https://issues.apache.org/jira/browse/HDFS-13951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635952#comment-16635952 ]
Steve Loughran commented on HDFS-13951: --------------------------------------- Patch 001 * adds a @VisibleForTesting entry point to main() which takes a {{Configuration}}. Allows tests to hand in a preconfigured Configuration instance. * tokens get to decode themselves * And if they are HDFS tokens, their stable string value is requested when !verbose * all uses of printUsage() have a return after them, so compilers and readers know that the code doesn't continue after its use. * made {{printTokensToString(}} public so tests out of the package can use it. There are no new tests here; they are in HADOOP-14556 which uses the new entrypoint and needs the decode fixup > HDFS DelegationTokenFetcher can't print non-HDFS tokens in a tokenfile > ---------------------------------------------------------------------- > > Key: HDFS-13951 > URL: https://issues.apache.org/jira/browse/HDFS-13951 > Project: Hadoop HDFS > Issue Type: Bug > Components: tools > Affects Versions: 3.2.0 > Reporter: Steve Loughran > Assignee: Steve Loughran > Priority: Minor > Attachments: HDFS-13951-001.patch > > > the fetchdt command can fetch tokens for filesystems other than hdfs (s3a, > abfs, etc), but it can't print them, as it assumes all tokens in the file are > subclasses of > {{org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier}} > & uses this fact in its decoding. It deserializes the token byte array > without checking kind and so ends up with invalid data. > Fix: ask the tokens to decode themselves; only call toStableString() if an > HDFS token. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org