/** The same as getUserName(Snapshot.CURRENT_STATE_ID). */ @Override public final String getUserName() { return getUserName(Snapshot.CURRENT_STATE_ID); }
@Override public final String getUserName(int snapshotId) { return referred.getUserName(snapshotId); }
/** The same as getUserName(Snapshot.CURRENT_STATE_ID). */ @Override public final String getUserName() { return getUserName(Snapshot.CURRENT_STATE_ID); }
/** The same as getUserName(Snapshot.CURRENT_STATE_ID). */ @Override public final String getUserName() { return getUserName(Snapshot.CURRENT_STATE_ID); }
@Override public final String getUserName(int snapshotId) { return referred.getUserName(snapshotId); }
@Override public final String getUserName(int snapshotId) { return referred.getUserName(snapshotId); }
inode.getAccessTime(snapshot), inode.getFsPermission(snapshot), inode.getUserName(snapshot), inode.getGroupName(snapshot), symlink,
private void checkOwner(INode inode) throws AccessControlException { if (inode != null && user.equals(inode.getUserName())) { return; } throw new AccessControlException("Permission denied"); }
private void checkOwner(INode inode) throws AccessControlException { if (inode != null && user.equals(inode.getUserName())) { return; } throw new AccessControlException("Permission denied"); }
private void checkOwner(INode inode) throws AccessControlException { if (inode != null && user.equals(inode.getUserName())) { return; } throw new AccessControlException("Permission denied"); }
private static final void logAuditEvent(UserGroupInformation ugi, InetAddress addr, String cmd, String src, String dst, INode node) { final StringBuilder builder = auditStringBuilder.get(); builder.setLength(0); builder.append("ugi=").append(ugi).append("\t"). append("ip=").append(addr).append("\t"). append("cmd=").append(cmd).append("\t"). append("src=").append(src).append("\t"). append("dst=").append(dst).append("\t"). append("perm="); if (node == null) { builder.append("null"); } else { builder.append(node.getUserName() + ':' + node.getGroupName() + ':' + node.getFsPermission()); } auditLog.info(builder.toString()); }
static AclStatus getAclStatus( FSDirectory fsd, FSPermissionChecker pc, String src) throws IOException { checkAclsConfigFlag(fsd); fsd.readLock(); try { INodesInPath iip = fsd.resolvePath(pc, src, DirOp.READ); // There is no real inode for the path ending in ".snapshot", so return a // non-null, unpopulated AclStatus. This is similar to getFileInfo. if (iip.isDotSnapshotDir() && fsd.getINode4DotSnapshot(iip) != null) { return new AclStatus.Builder().owner("").group("").build(); } INode inode = FSDirectory.resolveLastINode(iip); int snapshotId = iip.getPathSnapshotId(); List<AclEntry> acl = AclStorage.readINodeAcl(fsd.getAttributes(iip)); FsPermission fsPermission = inode.getFsPermission(snapshotId); return new AclStatus.Builder() .owner(inode.getUserName()).group(inode.getGroupName()) .stickyBit(fsPermission.getStickyBit()) .setPermission(fsPermission) .addEntries(acl).build(); } catch (AclException e){ throw new AclException(e.getMessage() + " Path: " + src, e); } finally { fsd.readUnlock(); } }
/** Get the {@link PermissionStatus} */ protected PermissionStatus getPermissionStatus() { return new PermissionStatus(getUserName(),getGroupName(),getFsPermission()); } private synchronized void updatePermissionStatus(
/** Get the {@link PermissionStatus} */ protected PermissionStatus getPermissionStatus() { return new PermissionStatus(getUserName(),getGroupName(),getFsPermission()); } private synchronized void updatePermissionStatus(
out.writeLong(node.getDsQuota()); FILE_PERM.fromShort(node.getFsPermissionShort()); PermissionStatus.write(out, node.getUserName(), node.getGroupName(), FILE_PERM);
private void check(INode inode, FsAction access ) throws AccessControlException { if (inode == null) { return; } FsPermission mode = inode.getFsPermission(); if (user.equals(inode.getUserName())) { //user class if (mode.getUserAction().implies(access)) { return; } } else if (groups.contains(inode.getGroupName())) { //group class if (mode.getGroupAction().implies(access)) { return; } } else { //other class if (mode.getOtherAction().implies(access)) { return; } } throw new AccessControlException("Permission denied: user=" + user + ", access=" + access + ", inode=" + inode); } }
private void check(INode inode, FsAction access ) throws AccessControlException { if (inode == null) { return; } FsPermission mode = inode.getFsPermission(); if (user.equals(inode.getUserName())) { //user class if (mode.getUserAction().implies(access)) { return; } } else if (groups.contains(inode.getGroupName())) { //group class if (mode.getGroupAction().implies(access)) { return; } } else { //other class if (mode.getOtherAction().implies(access)) { return; } } throw new AccessControlException("Permission denied: user=" + user + ", access=" + access + ", inode=" + inode); } }
private void check(INode inode, FsAction access ) throws AccessControlException { if (inode == null) { return; } FsPermission mode = inode.getFsPermission(); if (user.equals(inode.getUserName())) { //user class if (mode.getUserAction().implies(access)) { return; } } else if (groups.contains(inode.getGroupName())) { //group class if (mode.getGroupAction().implies(access)) { return; } } else { //other class if (mode.getOtherAction().implies(access)) { return; } } throw new AccessControlException("Permission denied: user=" + user + ", access=" + access + ", inode=" + inode); } }
/** * Create HdfsFileStatus by file INode */ static FileStatus createFileStatus(String path, INode node) { // length is zero for directories return new FileStatus(node.isDirectory() ? 0 : node.computeContentSummary().getLength(), node.isDirectory(), node.isDirectory() ? 0 : ((INodeFile)node).getReplication(), node.isDirectory() ? 0 : ((INodeFile)node).getPreferredBlockSize(), node.getModificationTime(), node.getAccessTime(), node.getFsPermission(), node.getUserName(), node.getGroupName(), new Path(path)); }
/** * Create FileStatus by file INode */ private static FileStatus createFileStatus(String path, INode node) { // length is zero for directories return new FileStatus(node.isDirectory() ? 0 : node.computeContentSummary().getLength(), node.isDirectory(), node.isDirectory() ? 0 : ((INodeFile)node).getReplication(), node.isDirectory() ? 0 : ((INodeFile)node).getPreferredBlockSize(), node.getModificationTime(), node.getAccessTime(), node.getFsPermission(), node.getUserName(), node.getGroupName(), new Path(path)); } }