/** * Constructor * * @param length a file's length * @param isdir if the path is a directory * @param block_replication the file's replication factor * @param blocksize a file's block size * @param modification_time a file's modification time * @param access_time a file's access time * @param permission a file's permission * @param owner a file's owner * @param group a file's group * @param symlink symlink if the path is a symbolic link * @param path the path's qualified name * @param locations a file's block locations */ @Deprecated public LocatedFileStatus(long length, boolean isdir, int block_replication, long blocksize, long modification_time, long access_time, FsPermission permission, String owner, String group, Path symlink, Path path, BlockLocation[] locations) { this(length, isdir, block_replication, blocksize, modification_time, access_time, permission, owner, group, symlink, path, permission == null ? false : permission.getAclBit(), permission == null ? false : permission.getEncryptedBit(), permission == null ? false : permission.getErasureCodedBit(), locations); }
/** * Tell whether the underlying file or directory is encrypted or not. * * @return true if the underlying file is encrypted. */ public boolean isEncrypted() { return permission.getEncryptedBit(); }
/** * Tell whether the underlying file or directory is encrypted or not. * * @return true if the underlying file is encrypted. */ public boolean isEncrypted() { return permission.getEncryptedBit(); }
/** * Tell whether the underlying file or directory is encrypted or not. * * @return true if the underlying file is encrypted. */ public boolean isEncrypted() { return permission.getEncryptedBit(); }
/** * Tell whether the underlying file or directory is encrypted or not. * * @return true if the underlying file is encrypted. */ public boolean isEncrypted() { return permission.getEncryptedBit(); }
private static EnumSet<HdfsFileStatus.Flags> convertFlags( FsPermissionProto pbp) { EnumSet<HdfsFileStatus.Flags> f = EnumSet.noneOf(HdfsFileStatus.Flags.class); FsPermission p = new FsPermissionExtension((short)pbp.getPerm()); if (p.getAclBit()) { f.add(HdfsFileStatus.Flags.HAS_ACL); } if (p.getEncryptedBit()) { f.add(HdfsFileStatus.Flags.HAS_CRYPT); } if (p.getErasureCodedBit()) { f.add(HdfsFileStatus.Flags.HAS_EC); } return f; }
m.put("aclBit", true); if (perm.getEncryptedBit()) { m.put("encBit", true);
/** * Set redundant flags for compatibility with existing applications. */ static FsPermission convert(boolean isdir, boolean symlink, FsPermission p, Set<Flags> f) { if (p instanceof FsPermissionExtension) { // verify flags are set consistently assert p.getAclBit() == f.contains(HdfsFileStatus.Flags.HAS_ACL); assert p.getEncryptedBit() == f.contains(HdfsFileStatus.Flags.HAS_CRYPT); assert p.getErasureCodedBit() == f.contains(HdfsFileStatus.Flags.HAS_EC); return p; } if (null == p) { if (isdir) { p = FsPermission.getDirDefault(); } else if (symlink) { p = FsPermission.getDefault(); } else { p = FsPermission.getFileDefault(); } } return new FsPermissionExtension(p, f.contains(Flags.HAS_ACL), f.contains(Flags.HAS_CRYPT), f.contains(Flags.HAS_EC)); }
m.put("aclBit", true); if (perm.getEncryptedBit()) { m.put("encBit", true);
json.put(HttpFSFileSystem.ACL_BIT_JSON, true); if (fileStatus.getPermission().getEncryptedBit()) { json.put(HttpFSFileSystem.ENC_BIT_JSON, true);
/** * Checks for a given path whether the Other permissions on it * imply the permission in the passed FsAction * @param fs * @param path * @param action * @return true if the path in the uri is visible to all, false otherwise * @throws IOException */ private static boolean checkPermissionOfOther(FileSystem fs, Path path, FsAction action, Map<URI, FileStatus> statCache) throws IOException { FileStatus status = getFileStatus(fs, path.toUri(), statCache); FsPermission perms = status.getPermission(); // Encrypted files are always treated as private. This stance has two // important side effects. The first is that the encrypted files will be // downloaded as the job owner instead of the YARN user, which is required // for the KMS ACLs to work as expected. Second, it prevent a file with // world readable permissions that is stored in an encryption zone from // being localized as a publicly shared file with world readable // permissions. if (!perms.getEncryptedBit()) { FsAction otherAction = perms.getOtherAction(); if (otherAction.implies(action)) { return true; } } return false; }
/** * Checks for a given path whether the Other permissions on it * imply the permission in the passed FsAction * @param fs * @param path * @param action * @return true if the path in the uri is visible to all, false otherwise * @throws IOException */ private static boolean checkPermissionOfOther(FileSystem fs, Path path, FsAction action, Map<URI, FileStatus> statCache) throws IOException { FileStatus status = getFileStatus(fs, path.toUri(), statCache); FsPermission perms = status.getPermission(); // Encrypted files are always treated as private. This stance has two // important side effects. The first is that the encrypted files will be // downloaded as the job owner instead of the YARN user, which is required // for the KMS ACLs to work as expected. Second, it prevent a file with // world readable permissions that is stored in an encryption zone from // being localized as a publicly shared file with world readable // permissions. if (!perms.getEncryptedBit()) { FsAction otherAction = perms.getOtherAction(); if (otherAction.implies(action)) { return true; } } return false; }
/** * Checks for a given path whether the Other permissions on it * imply the permission in the passed FsAction * @param fs * @param path * @param action * @return true if the path in the uri is visible to all, false otherwise * @throws IOException */ private static boolean checkPermissionOfOther(FileSystem fs, Path path, FsAction action, Map<URI, FileStatus> statCache) throws IOException { FileStatus status = getFileStatus(fs, path.toUri(), statCache); FsPermission perms = status.getPermission(); // Encrypted files are always treated as private. This stance has two // important side effects. The first is that the encrypted files will be // downloaded as the job owner instead of the YARN user, which is required // for the KMS ACLs to work as expected. Second, it prevent a file with // world readable permissions that is stored in an encryption zone from // being localized as a publicly shared file with world readable // permissions. if (!perms.getEncryptedBit()) { FsAction otherAction = perms.getOtherAction(); if (otherAction.implies(action)) { return true; } } return false; }
m.put("aclBit", true); if (perm.getEncryptedBit()) { m.put("encBit", true);
m.put("aclBit", true); if (perm.getEncryptedBit()) { m.put("encBit", true);