Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.6.4
-
None
-
Incompatible change
-
Description
When a directory permission is modified using hdfs dfs chmod command and when octal/numeric format is used, the leading sticky bit is not fully honored.
1. Create a dir dir_test_with_sticky_bit
2. Apply sticky bit permission on the dir : hdfs dfs -chmod 1755 /dir_test_with_sticky_bit
3. Remove sticky bit permission on the dir: hdfs dfs -chmod 755 /dir_test_with_sticky_bit
Expected: Remove the sticky bit on the dir, as it happens on Mac/Linux native filesystem with native chmod.
4. However, removing sticky bit permission by explicitly turning off the bit works. hdfs dfs -chmod 0755 /dir_test_with_sticky_bit
manoj@~/work/hadev-pp: hdfs dfs -chmod 1755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit <=== sticky bit still intact drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 0755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp:
Attachments
Attachments
Activity
Release Note | Hdfs dfs chmod command will reset sticky bit permission on a file/directory when the leading sticky bit is omitted in the octal mode (like 644). So when a file/directory permission is applied using octal mode and sticky bit permission needs to be preserved, then it has to be explicitly mentioned in the permission bits (like 1644). This behavior is similar to many other filesystems on Linux/BSD. |
Fix Version/s | 3.0.0-alpha1 [ 12335732 ] | |
Resolution | Fixed [ 1 ] | |
Status | Patch Available [ 10002 ] | Resolved [ 5 ] |
Attachment | HDFS-10689.004.patch [ 12820753 ] |
Summary | "hdfs dfs -chmod 777" does not remove sticky bit | Hdfs dfs chmod should reset sticky bit permission when the bit is omitted in the octal mode |
Attachment | HDFS-10689.003.patch [ 12820608 ] |
Attachment | HDFS-10689.002.patch [ 12820602 ] |
Hadoop Flags | Incompatible change [ 10342 ] | |
Target Version/s | 3.0.0-alpha1 [ 12335732 ] | |
Affects Version/s | 2.6.4 [ 12334241 ] | |
Description |
When a directory permission is modified using hdfs dfs chmod command and when octal/numeric format is used, the leading sticky bit is not fully honored. 1. Create a dir dir_test_with_sticky_bit 2. Apply sticky bit permission on the dir : hdfs dfs -chmod 1755 /dir_test_with_sticky_bit 3. Remove sticky bit permission on the dir: hdfs dfs -chmod 755 /dir_test_with_sticky_bit Expected: Remove the sticky bit on the dir, as it happens on Mac/Linux native filesystem with native chmod. 4. However, removing sticky bit permission by explicitly turning off the bit works. hdfs dfs -chmod 0755 /dir_test_with_sticky_bit {noformat} manoj@~/work/hadev-pp: hdfs dfs -chmod 1755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit <=== sticky bit still intact drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 0755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: {noformat} |
When a directory permission is modified using hdfs dfs chmod command and when octal/numeric format is used, the leading sticky bit is not fully honored. 1. Create a dir dir_test_with_sticky_bit 2. Apply sticky bit permission on the dir : hdfs dfs -chmod 1755 /dir_test_with_sticky_bit 3. Remove sticky bit permission on the dir: hdfs dfs -chmod 755 /dir_test_with_sticky_bit Expected: Remove the sticky bit on the dir, as it happens on Mac/Linux native filesystem with native chmod. 4. However, removing sticky bit permission by explicitly turning off the bit works. hdfs dfs -chmod 0755 /dir_test_with_sticky_bit {noformat} manoj@~/work/hadev-pp: hdfs dfs -chmod 1755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-t - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit <=== sticky bit still intact drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: hdfs dfs -chmod 0755 /dir_test_with_sticky_bit manoj@~/work/hadev-pp: hdfs dfs -ls / Found 2 items drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /dir_test_with_sticky_bit drwxr-xr-x - manoj supergroup 0 2016-07-25 11:42 /user manoj@~/work/hadev-pp: {noformat} |
Status | Open [ 1 ] | Patch Available [ 10002 ] |
Field | Original Value | New Value |
---|---|---|
Attachment | HDFS-10689.001.patch [ 12820332 ] |
SUCCESS: Integrated in Hadoop-trunk-Commit #10172 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10172/)
HDFS-10689. Hdfs dfs chmod should reset sticky bit permission when the (lei: rev a3d0cba81071977ffc22a42f60b2ca07da25ae15)