HBASE-6963 unable to run hbck on a secure cluster

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1396810 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jxiang 2012-10-10 21:29:33 +00:00
parent 264db4cb7d
commit 0c113c7ddb
1 changed files with 2 additions and 2 deletions

View File

@ -1311,7 +1311,7 @@ public abstract class FSUtils {
*/ */
public static void checkAccess(UserGroupInformation ugi, FileStatus file, public static void checkAccess(UserGroupInformation ugi, FileStatus file,
FsAction action) throws AccessControlException { FsAction action) throws AccessControlException {
if (ugi.getUserName().equals(file.getOwner())) { if (ugi.getShortUserName().equals(file.getOwner())) {
if (file.getPermission().getUserAction().implies(action)) { if (file.getPermission().getUserAction().implies(action)) {
return; return;
} }
@ -1323,7 +1323,7 @@ public abstract class FSUtils {
return; return;
} }
throw new AccessControlException("Permission denied:" + " action=" + action throw new AccessControlException("Permission denied:" + " action=" + action
+ " path=" + file.getPath() + " user=" + ugi.getUserName()); + " path=" + file.getPath() + " user=" + ugi.getShortUserName());
} }
private static boolean contains(String[] groups, String user) { private static boolean contains(String[] groups, String user) {