Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-19334

User.runAsLoginUser not work in AccessController because it use a short circuited connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      The short-circuited connection will bypass the RPC and the RPC context didn't change. So it still use the old RPC user to write ACL table and User.runAsLoginUser not work.

      AccessController's grant method.

              User.runAsLoginUser(new PrivilegedExceptionAction<Void>() {
                @Override
                public Void run() throws Exception {
                  // regionEnv is set at #start. Hopefully not null at this point.
                  try (Table table = regionEnv.getConnection().
                      getTable(AccessControlLists.ACL_TABLE_NAME)) {
                    AccessControlLists.addUserPermission(regionEnv.getConfiguration(), perm, table,
                        request.getMergeExistingPermissions());
                  }
                  return null;
                }
              });
      

      Attachments

        1. HBASE-19334.master.001.patch
          27 kB
          Guanghao Zhang

        Issue Links

          Activity

            People

              zghao Guanghao Zhang
              zghao Guanghao Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: