Hive
  1. Hive
  2. HIVE-2405

get_privilege does not get user level privilege

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: Authorization, Security
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      hive> set hive.security.authorization.enabled=true;
      hive> grant all to user heyongqiang;
      hive> show grant user heyongqiang;
      principalName heyongqiang
      principalType USER
      privilege All
      grantTime Wed Aug 24 11:51:54 PDT 2011
      grantor heyongqiang
      Time taken: 0.032 seconds
      hive> CREATE TABLE src (foo INT, bar STRING);
      Authorization failed:No privilege 'Create' found for outputs

      { database:default}

      . Use show grant to get more details.

      1. HIVE-2405.2.patch
        5 kB
        He Yongqiang
      2. HIVE-2405.1.patch
        4 kB
        He Yongqiang

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #952 (See https://builds.apache.org/job/Hive-trunk-h0.21/952/)
        HIVE-2405. get_privilege does not get user level privilege
        (He Yongqiang via jvs)

        jvs : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170398
        Files :

        • /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
        • /hive/trunk/ql/src/test/queries/clientpositive/authorization_7.q
        • /hive/trunk/ql/src/test/results/clientpositive/authorization_7.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #952 (See https://builds.apache.org/job/Hive-trunk-h0.21/952/ ) HIVE-2405 . get_privilege does not get user level privilege (He Yongqiang via jvs) jvs : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170398 Files : /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java /hive/trunk/ql/src/test/queries/clientpositive/authorization_7.q /hive/trunk/ql/src/test/results/clientpositive/authorization_7.q.out
        Hide
        John Sichi added a comment -

        Committed to trunk. Thanks Yongqiang!

        Show
        John Sichi added a comment - Committed to trunk. Thanks Yongqiang!
        Hide
        John Sichi added a comment -

        +1. Will commit when tests pass.

        Show
        John Sichi added a comment - +1. Will commit when tests pass.
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1646/#review1774
        -----------------------------------------------------------

        trunk/ql/src/test/queries/clientpositive/authorization_7.q
        <https://reviews.apache.org/r/1646/#comment4051>

        yes. what we want to do is to test the global privilege. The first command is to grant a global privilege, and after that do test with that.

        • Yongqiang

        On 2011-08-24 22:23:39, Yongqiang He wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/1646/

        -----------------------------------------------------------

        (Updated 2011-08-24 22:23:39)

        Review request for hive and Ning Zhang.

        Summary

        -------

        get_privilege does not get user level privilege and should return emptylist instead of null

        This addresses bug HIVE-2405.

        https://issues.apache.org/jira/browse/HIVE-2405

        Diffs

        -----

        trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232

        trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION

        trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION

        Diff: https://reviews.apache.org/r/1646/diff

        Testing

        -------

        Thanks,

        Yongqiang

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1646/#review1774 ----------------------------------------------------------- trunk/ql/src/test/queries/clientpositive/authorization_7.q < https://reviews.apache.org/r/1646/#comment4051 > yes. what we want to do is to test the global privilege. The first command is to grant a global privilege, and after that do test with that. Yongqiang On 2011-08-24 22:23:39, Yongqiang He wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1646/ ----------------------------------------------------------- (Updated 2011-08-24 22:23:39) Review request for hive and Ning Zhang. Summary ------- get_privilege does not get user level privilege and should return emptylist instead of null This addresses bug HIVE-2405 . https://issues.apache.org/jira/browse/HIVE-2405 Diffs ----- trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232 trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION Diff: https://reviews.apache.org/r/1646/diff Testing ------- Thanks, Yongqiang
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1646/#review1632
        -----------------------------------------------------------

        Just a minor clarification. Otherwise looks good to me.

        trunk/ql/src/test/queries/clientpositive/authorization_7.q
        <https://reviews.apache.org/r/1646/#comment3671>

        is it necessary to set this after GRANT ALL ...?

        • Ning

        On 2011-08-24 22:23:39, Yongqiang He wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/1646/

        -----------------------------------------------------------

        (Updated 2011-08-24 22:23:39)

        Review request for hive and Ning Zhang.

        Summary

        -------

        get_privilege does not get user level privilege and should return emptylist instead of null

        This addresses bug HIVE-2405.

        https://issues.apache.org/jira/browse/HIVE-2405

        Diffs

        -----

        trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232

        trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION

        trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION

        Diff: https://reviews.apache.org/r/1646/diff

        Testing

        -------

        Thanks,

        Yongqiang

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1646/#review1632 ----------------------------------------------------------- Just a minor clarification. Otherwise looks good to me. trunk/ql/src/test/queries/clientpositive/authorization_7.q < https://reviews.apache.org/r/1646/#comment3671 > is it necessary to set this after GRANT ALL ...? Ning On 2011-08-24 22:23:39, Yongqiang He wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1646/ ----------------------------------------------------------- (Updated 2011-08-24 22:23:39) Review request for hive and Ning Zhang. Summary ------- get_privilege does not get user level privilege and should return emptylist instead of null This addresses bug HIVE-2405 . https://issues.apache.org/jira/browse/HIVE-2405 Diffs ----- trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232 trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION Diff: https://reviews.apache.org/r/1646/diff Testing ------- Thanks, Yongqiang
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1646/
        -----------------------------------------------------------

        Review request for hive and Ning Zhang.

        Summary
        -------

        get_privilege does not get user level privilege and should return emptylist instead of null

        This addresses bug HIVE-2405.
        https://issues.apache.org/jira/browse/HIVE-2405

        Diffs


        trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232
        trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION
        trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION

        Diff: https://reviews.apache.org/r/1646/diff

        Testing
        -------

        Thanks,

        Yongqiang

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1646/ ----------------------------------------------------------- Review request for hive and Ning Zhang. Summary ------- get_privilege does not get user level privilege and should return emptylist instead of null This addresses bug HIVE-2405 . https://issues.apache.org/jira/browse/HIVE-2405 Diffs trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232 trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION Diff: https://reviews.apache.org/r/1646/diff Testing ------- Thanks, Yongqiang
        Hide
        He Yongqiang added a comment -

        a new patch merged with HIVE-2406

        Show
        He Yongqiang added a comment - a new patch merged with HIVE-2406
        Hide
        He Yongqiang added a comment -

        this patch can also be applied to 0.7

        Show
        He Yongqiang added a comment - this patch can also be applied to 0.7
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/1644/
        -----------------------------------------------------------

        Review request for hive.

        Summary
        -------

        get_privilege does not get user level privilege

        This addresses bug HIVE-2405.
        https://issues.apache.org/jira/browse/HIVE-2405

        Diffs


        trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232
        trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION
        trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION

        Diff: https://reviews.apache.org/r/1644/diff

        Testing
        -------

        added a new testcase

        Thanks,

        Yongqiang

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1644/ ----------------------------------------------------------- Review request for hive. Summary ------- get_privilege does not get user level privilege This addresses bug HIVE-2405 . https://issues.apache.org/jira/browse/HIVE-2405 Diffs trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1161232 trunk/ql/src/test/queries/clientpositive/authorization_7.q PRE-CREATION trunk/ql/src/test/results/clientpositive/authorization_7.q.out PRE-CREATION Diff: https://reviews.apache.org/r/1644/diff Testing ------- added a new testcase Thanks, Yongqiang

          People

          • Assignee:
            He Yongqiang
            Reporter:
            He Yongqiang
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development