summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fileutils/test_fileutils.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 68f363109d1..df07978b084 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -909,10 +909,17 @@ class TestFileUtils
assert_equal 04500, File.stat('tmp/a').mode & 07777
chmod "+s", 'tmp/a'
assert_equal 06500, File.stat('tmp/a').mode & 07777
- chmod "u+t,o+t", 'tmp/a'
- assert_equal 07500, File.stat('tmp/a').mode & 07777
- chmod "a-t,a-s", 'tmp/a'
- assert_equal 0500, File.stat('tmp/a').mode & 07777
+
+ # FreeBSD ufs and tmpfs don't allow to change sticky bit against
+ # regular file. It's slightly strange. Anyway it's no effect bit.
+ # see /usr/src/sys/ufs/ufs/ufs_chmod()
+ if /freebsd/ !~ RUBY_PLATFORM
+ chmod "u+t,o+t", 'tmp/a'
+ assert_equal 07500, File.stat('tmp/a').mode & 07777
+ chmod "a-t,a-s", 'tmp/a'
+ assert_equal 0500, File.stat('tmp/a').mode & 07777
+ end
+
end if have_file_perm?