From 2e6063b00694dec5002366a59baef5bca30b0d2a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 17 May 2011 16:10:41 +0000 Subject: [PATCH] HADOOP-7296. The FsPermission(FsPermission) constructor does not use the sticky bit. Contributed by Siddharth Seth git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1104374 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ src/java/org/apache/hadoop/fs/permission/FsPermission.java | 1 + .../core/org/apache/hadoop/fs/permission/TestFsPermission.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 39adad725c..1619f6c472 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -693,6 +693,9 @@ Release 0.22.0 - Unreleased HADOOP-7068. Ivy resolve force mode should be turned off by default. (Luke Lu via tomwhite) + HADOOP-7296. The FsPermission(FsPermission) constructor does not use the + sticky bit. (Siddharth Seth via tomwhite) + Release 0.21.1 - Unreleased IMPROVEMENTS diff --git a/src/java/org/apache/hadoop/fs/permission/FsPermission.java b/src/java/org/apache/hadoop/fs/permission/FsPermission.java index c96c8c144b..0926bb1dc0 100644 --- a/src/java/org/apache/hadoop/fs/permission/FsPermission.java +++ b/src/java/org/apache/hadoop/fs/permission/FsPermission.java @@ -96,6 +96,7 @@ public FsPermission(FsPermission other) { this.useraction = other.useraction; this.groupaction = other.groupaction; this.otheraction = other.otheraction; + this.stickyBit = other.stickyBit; } /** diff --git a/src/test/core/org/apache/hadoop/fs/permission/TestFsPermission.java b/src/test/core/org/apache/hadoop/fs/permission/TestFsPermission.java index 3dc8417311..e46fb659f3 100644 --- a/src/test/core/org/apache/hadoop/fs/permission/TestFsPermission.java +++ b/src/test/core/org/apache/hadoop/fs/permission/TestFsPermission.java @@ -66,6 +66,8 @@ public void testConvertingPermissions() { for(FsAction o : FsAction.values()) { FsPermission f = new FsPermission(u, g, o, sb); assertEquals(s, f.toShort()); + FsPermission f2 = new FsPermission(f); + assertEquals(s, f2.toShort()); s++; } }