YARN-2743. Fixed a bug in ResourceManager that was causing RMDelegationToken identifiers to be tampered and thus causing app submission failures in secure mode. Contributed by Jian He.

(cherry picked from commit 018664550507981297fd9f91e29408e6b7801ea9)
HADOOP-11170. Pulling into branch-2.6 also, fixing CHANGES.txt.

(cherry picked from commit 9ada9284d82fd926e8085e571f953330fc87266f)
YARN-2734. Skipped sub-folders in the local log dir when aggregating logs. Contributed by Xuan Gong.

(cherry picked from commit caecd9fffe7c6216be31f3ab65349182045451fa)