congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FSPermissionChecker.constructPath
Code IndexAdd Tabnine to your IDE (free)

How to use
constructPath
method
in
org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker

Best Java code snippets using org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.constructPath (Showing top 8 results out of 315)

origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkTraverse(INodeAttributes[] inodeAttrs, int last)
  throws AccessControlException {
 for (int i=0; i <= last; i++) {
  INodeAttributes inode = inodeAttrs[i];
  if (!inode.isDirectory()) {
   throw new AccessControlException(
     constructPath(inodeAttrs, i) + " (is not a directory)");
  }
  if (!hasPermission(inode, FsAction.EXECUTE)) {
   throw new AccessControlException(toAccessControlString(
     inode, constructPath(inodeAttrs, i), FsAction.EXECUTE));
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void check(INodeAttributes[] inodes, int i, FsAction access)
  throws AccessControlException {
 INodeAttributes inode = (i >= 0) ? inodes[i] : null;
 if (inode != null && !hasPermission(inode, access)) {
  throw new AccessControlException(
    toAccessControlString(inode, constructPath(inodes, i), access));
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void check(INodeAttributes[] inodes, int i, FsAction access)
  throws AccessControlException {
 INodeAttributes inode = (i >= 0) ? inodes[i] : null;
 if (inode != null && !hasPermission(inode, access)) {
  throw new AccessControlException(
    toAccessControlString(inode, constructPath(inodes, i), access));
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkOwner(INodeAttributes[] inodes, int i)
  throws AccessControlException {
 if (getUser().equals(inodes[i].getUserName())) {
  return;
 }
 throw new AccessControlException(
   "Permission denied. user=" + getUser() +
   " is not the owner of inode=" + constructPath(inodes, i));
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkOwner(INodeAttributes[] inodes, int i)
  throws AccessControlException {
 if (getUser().equals(inodes[i].getUserName())) {
  return;
 }
 throw new AccessControlException(
   "Permission denied. user=" + getUser() +
   " is not the owner of inode=" + constructPath(inodes, i));
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkTraverse(INodeAttributes[] inodeAttrs, int last)
  throws AccessControlException {
 for (int i=0; i <= last; i++) {
  INodeAttributes inode = inodeAttrs[i];
  if (!inode.isDirectory()) {
   throw new AccessControlException(
     constructPath(inodeAttrs, i) + " (is not a directory)");
  }
  if (!hasPermission(inode, FsAction.EXECUTE)) {
   throw new AccessControlException(toAccessControlString(
     inode, constructPath(inodeAttrs, i), FsAction.EXECUTE));
  }
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkStickyBit(INodeAttributes[] inodes, int index)
  throws AccessControlException {
 INodeAttributes parent = inodes[index];
 if (!parent.getFsPermission().getStickyBit()) {
  return;
 }
 // If this user is the directory owner, return
 if (parent.getUserName().equals(getUser())) {
  return;
 }
 INodeAttributes inode = inodes[index + 1];
 // if this user is the file owner, return
 if (inode.getUserName().equals(getUser())) {
  return;
 }
 throw new AccessControlException(String.format(
   "Permission denied by sticky bit: user=%s, path=\"%s\":%s:%s:%s%s, " +
   "parent=\"%s\":%s:%s:%s%s", user,
   constructPath(inodes, index + 1),
   inode.getUserName(), inode.getGroupName(),
   inode.isDirectory() ? "d" : "-", inode.getFsPermission().toString(),
   constructPath(inodes, index),
   parent.getUserName(), parent.getGroupName(),
   parent.isDirectory() ? "d" : "-", parent.getFsPermission().toString()));
}
origin: io.prestosql.hadoop/hadoop-apache

/** Guarded by {@link FSNamesystem#readLock()} */
private void checkStickyBit(INodeAttributes[] inodes, int index)
  throws AccessControlException {
 INodeAttributes parent = inodes[index];
 if (!parent.getFsPermission().getStickyBit()) {
  return;
 }
 // If this user is the directory owner, return
 if (parent.getUserName().equals(getUser())) {
  return;
 }
 INodeAttributes inode = inodes[index + 1];
 // if this user is the file owner, return
 if (inode.getUserName().equals(getUser())) {
  return;
 }
 throw new AccessControlException(String.format(
   "Permission denied by sticky bit: user=%s, path=\"%s\":%s:%s:%s%s, " +
   "parent=\"%s\":%s:%s:%s%s", user,
   constructPath(inodes, index + 1),
   inode.getUserName(), inode.getGroupName(),
   inode.isDirectory() ? "d" : "-", inode.getFsPermission().toString(),
   constructPath(inodes, index),
   parent.getUserName(), parent.getGroupName(),
   parent.isDirectory() ? "d" : "-", parent.getFsPermission().toString()));
}
org.apache.hadoop.hdfs.server.namenodeFSPermissionCheckerconstructPath

Popular methods of FSPermissionChecker

  • checkPermission
    Check whether current user have permissions to access the path. Traverse is always checked. Parent p
  • <init>
  • check
    Guarded by FSNamesystem#readLock()
  • checkOwner
    Guarded by FSNamesystem#readLock()
  • checkSubAccess
    Guarded by FSNamesystem#readLock()
  • checkTraverse
    Guarded by FSNamesystem#readLock()
  • checkStickyBit
    Guarded by FSNamesystem#readLock()
  • checkSuperuserPrivilege
    Verify if the caller has the required permission. This will result into an exception if the caller i
  • getAccessControlEnforcer
  • getAttributesProvider
  • getINodeAttrs
  • getUser
  • getINodeAttrs,
  • getUser,
  • hasAclPermission,
  • hasPermission,
  • isSuperUser,
  • toAccessControlString,
  • containsGroup,
  • isMemberOfGroup,
  • checkIsDirectory

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JList (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now