Revert HDFS-3639. JspHelper#getUGI should always verify the token if security is enabled.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1362760 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6981b14003
commit
d61c5bcb0b
|
@ -497,9 +497,6 @@ Branch-2 ( Unreleased changes )
|
||||||
|
|
||||||
HDFS-3615. Two BlockTokenSecretManager findbugs warnings. (atm)
|
HDFS-3615. Two BlockTokenSecretManager findbugs warnings. (atm)
|
||||||
|
|
||||||
HDFS-3639. JspHelper#getUGI should always verify the token if
|
|
||||||
security is enabled. (eli)
|
|
||||||
|
|
||||||
HDFS-470. libhdfs should handle 0-length reads from FSInputStream
|
HDFS-470. libhdfs should handle 0-length reads from FSInputStream
|
||||||
correctly. (Colin Patrick McCabe via eli)
|
correctly. (Colin Patrick McCabe via eli)
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.hdfs.BlockReader;
|
import org.apache.hadoop.hdfs.BlockReader;
|
||||||
import org.apache.hadoop.hdfs.BlockReaderFactory;
|
import org.apache.hadoop.hdfs.BlockReaderFactory;
|
||||||
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
||||||
import org.apache.hadoop.hdfs.DFSUtil;
|
import org.apache.hadoop.hdfs.DFSUtil;
|
||||||
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
|
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
|
||||||
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
|
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
|
||||||
|
@ -58,6 +59,7 @@ import org.apache.hadoop.hdfs.web.resources.DelegationParam;
|
||||||
import org.apache.hadoop.hdfs.web.resources.DoAsParam;
|
import org.apache.hadoop.hdfs.web.resources.DoAsParam;
|
||||||
import org.apache.hadoop.hdfs.web.resources.UserParam;
|
import org.apache.hadoop.hdfs.web.resources.UserParam;
|
||||||
import org.apache.hadoop.http.HtmlQuoting;
|
import org.apache.hadoop.http.HtmlQuoting;
|
||||||
|
import org.apache.hadoop.io.Text;
|
||||||
import org.apache.hadoop.net.NetUtils;
|
import org.apache.hadoop.net.NetUtils;
|
||||||
import org.apache.hadoop.security.AccessControlException;
|
import org.apache.hadoop.security.AccessControlException;
|
||||||
import org.apache.hadoop.security.SecurityUtil;
|
import org.apache.hadoop.security.SecurityUtil;
|
||||||
|
@ -557,8 +559,13 @@ public class JspHelper {
|
||||||
DataInputStream in = new DataInputStream(buf);
|
DataInputStream in = new DataInputStream(buf);
|
||||||
DelegationTokenIdentifier id = new DelegationTokenIdentifier();
|
DelegationTokenIdentifier id = new DelegationTokenIdentifier();
|
||||||
id.readFields(in);
|
id.readFields(in);
|
||||||
|
if (context != null) {
|
||||||
final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
|
final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
|
||||||
|
if (nn != null) {
|
||||||
|
// Verify the token.
|
||||||
nn.getNamesystem().verifyToken(id, token.getPassword());
|
nn.getNamesystem().verifyToken(id, token.getPassword());
|
||||||
|
}
|
||||||
|
}
|
||||||
ugi = id.getUser();
|
ugi = id.getUser();
|
||||||
if (ugi.getRealUser() == null) {
|
if (ugi.getRealUser() == null) {
|
||||||
//non-proxy case
|
//non-proxy case
|
||||||
|
|
Loading…
Reference in New Issue