[
https://issues.apache.org/jira/browse/SENTRY-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zephyr Guo updated SENTRY-1312:
-------------------------------
Status: Open (was: Patch Available)
> HDFS_PERMISSION_DEFAULT does not parse correctly
> ------------------------------------------------
>
> Key: SENTRY-1312
> URL: https://issues.apache.org/jira/browse/SENTRY-1312
> Project: Sentry
> Issue Type: Bug
> Components: Hdfs Plugin
> Affects Versions: 1.8.0
> Reporter: Zephyr Guo
> Assignee: Zephyr Guo
> Fix For: 1.8.0
>
> Attachments: SENTRY-1312-v1.patch
>
>
> {{HDFS_PERMISSION_DEFAULT}} set to *771*, but it is *1403(r------wt)* in fact.
> {code}
> permission = FsPermission.createImmutable(
> (short)
> newConf.getLong(SentryAuthorizationConstants.HDFS_PERMISSION_KEY,
> SentryAuthorizationConstants.HDFS_PERMISSION_DEFAULT)
> {code}
> {{FsPermission.createImmutable}} parse {{short}} by bit.
> {code}
> public void fromShort(short n) {
> FsAction[] v = FSACTION_VALUES;
> set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7], (((n >>> 9) & 1) == 1)
> );
> }
> // 771 => 0011 0000 0011 => 001 100 000 011 => 1403
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)