@Override public AclStatus getAclStatus(Path path) throws IOException { return fs.getAclStatus(path); }
public HadoopFileStatus(Configuration conf, FileSystem fs, Path file) throws IOException { FileStatus fileStatus = fs.getFileStatus(file); AclStatus aclStatus = null; if (Objects.equal(conf.get("dfs.namenode.acls.enabled"), "true")) { //Attempt extended Acl operations only if its enabled, but don't fail the operation regardless. try { aclStatus = fs.getAclStatus(file); } catch (Exception e) { LOG.info("Skipping ACL inheritance: File system for path " + file + " " + "does not support ACLs but dfs.namenode.acls.enabled is set to true. "); LOG.debug("The details are: " + e, e); } }this.fileStatus = fileStatus; this.aclStatus = aclStatus; }
public HadoopFileStatus(Configuration conf, FileSystem fs, Path file) throws IOException { FileStatus fileStatus = fs.getFileStatus(file); AclStatus aclStatus = null; if (Objects.equal(conf.get("dfs.namenode.acls.enabled"), "true")) { //Attempt extended Acl operations only if its enabled, but don't fail the operation regardless. try { aclStatus = fs.getAclStatus(file); } catch (Exception e) { LOG.info("Skipping ACL inheritance: File system for path " + file + " " + "does not support ACLs but dfs.namenode.acls.enabled is set to true. "); LOG.debug("The details are: " + e, e); } }this.fileStatus = fileStatus; this.aclStatus = aclStatus; }
@Override public AclStatus getAclStatus(Path path) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(path), true); return res.targetFileSystem.getAclStatus(res.remainingPath); }
@Override protected void processPath(PathData item) throws IOException { out.println("# file: " + item); out.println("# owner: " + item.stat.getOwner()); out.println("# group: " + item.stat.getGroup()); FsPermission perm = item.stat.getPermission(); if (perm.getStickyBit()) { out.println("# flags: --" + (perm.getOtherAction().implies(FsAction.EXECUTE) ? "t" : "T")); } final AclStatus aclStatus; final List<AclEntry> entries; if (item.stat.hasAcl()) { aclStatus = item.fs.getAclStatus(item.path); entries = aclStatus.getEntries(); } else { aclStatus = null; entries = Collections.<AclEntry> emptyList(); } ScopedAclEntries scopedEntries = new ScopedAclEntries( AclUtil.getAclFromPermAndEntries(perm, entries)); printAclEntriesForSingleScope(aclStatus, perm, scopedEntries.getAccessEntries()); printAclEntriesForSingleScope(aclStatus, perm, scopedEntries.getDefaultEntries()); out.println(); }
FsPermission perm = src.stat.getPermission(); List<AclEntry> srcEntries = src.fs.getAclStatus(src.path).getEntries(); List<AclEntry> srcFullEntries = AclUtil.getAclFromPermAndEntries(perm, srcEntries);
@Override public AclStatus next(final FileSystem fs, final Path p) throws IOException { return fs.getAclStatus(p); } }.resolve(this, absF);
@Override public AclStatus next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getAclStatus(p); } }.resolve(this, absF);
@Override public AclStatus next(final FileSystem fs, final Path p) throws IOException, UnresolvedLinkException { return fs.getAclStatus(p); } }.resolve(this, absF);
@Override public AclStatus getAclStatus(Path path) throws IOException { try { return underlyingFs.getAclStatus(path); } catch(FSError e) { throw propagateFSError(e); } }
@Override public AclStatus getAclStatus(Path path) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(path), true); return res.targetFileSystem.getAclStatus(res.remainingPath); }
@Override public AclStatus getAclStatus(Path path) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(path), true); return res.targetFileSystem.getAclStatus(res.remainingPath); }
@Override public AclStatus getAclStatus(Path path) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(path), true); return res.targetFileSystem.getAclStatus(res.remainingPath); }
@Override public AclStatus getAclStatus(Path path) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(path), true); return res.targetFileSystem.getAclStatus(res.remainingPath); }
public AclStatus getAclStatus(Path path) throws IOException { if (getConf().getBoolean("stubfs.noRpcForGetAclStatus", false)) { throw new RemoteException(RpcNoSuchMethodException.class.getName(), "test exception"); } return super.getAclStatus(path); }
/** * Asserts the ACL entries returned by getAclStatus for a specific path. * * @param path String path to check * @param entries AclEntry[] expected ACL entries * @throws Exception if there is any error */ private static void assertAclEntries(String path, AclEntry[] entries) throws Exception { assertArrayEquals(entries, fs.getAclStatus(new Path(path)).getEntries() .toArray(new AclEntry[0])); }
public AclStatus getAclStatus(Path path) throws IOException { if (getConf().getBoolean("stubfs.noRpcForGetAclStatus", false)) { throw new RemoteException(RpcNoSuchMethodException.class.getName(), "test exception"); } return super.getAclStatus(path); }
@Test public void testRemoveAclMinimalAcl() throws IOException { fs.create(path).close(); fs.setPermission(path, FsPermission.createImmutable((short)0640)); fs.removeAcl(path); AclStatus s = fs.getAclStatus(path); AclEntry[] returned = s.getEntries().toArray(new AclEntry[0]); assertArrayEquals(new AclEntry[] { }, returned); assertPermission((short)0640); assertAclFeature(false); }
@Test public void testInternalGetAclStatus() throws IOException { final UserGroupInformation currentUser = UserGroupInformation.getCurrentUser(); AclStatus aclStatus = fsView.getAclStatus(new Path("/internalDir")); assertEquals(aclStatus.getOwner(), currentUser.getUserName()); assertEquals(aclStatus.getGroup(), currentUser.getGroupNames()[0]); assertEquals(aclStatus.getEntries(), AclUtil.getMinimalAcl(PERMISSION_555)); assertFalse(aclStatus.isStickyBit()); }
@Test public void testInternalGetAclStatus() throws IOException { final UserGroupInformation currentUser = UserGroupInformation.getCurrentUser(); AclStatus aclStatus = fsView.getAclStatus(new Path("/internalDir")); assertEquals(aclStatus.getOwner(), currentUser.getUserName()); assertEquals(aclStatus.getGroup(), currentUser.getGroupNames()[0]); assertEquals(aclStatus.getEntries(), AclUtil.getMinimalAcl(PERMISSION_555)); assertFalse(aclStatus.isStickyBit()); }