From 510f89fa636b551a8406d7cfbf1a636411e7724e Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sun, 31 Mar 2019 13:31:39 +0300 Subject: Test case for #73 --- tests/test_bindfs.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index 01327b5..69ca6e0 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -762,6 +762,16 @@ testenv("", :title => "mntdir with newline", :mntdir_name => "a\nb") do assert { File.exist?("a\nb/f") } end +# Pull Request #73 +if `uname`.strip == 'Linux' && `which unshare` != '' + root_testenv("--gid-offset=10000", :title => "setgid and gid-offset") do + system("chmod g+s src") + system("unshare --map-root-user --user #{$nobody} mkdir mnt/dir") + assert { File.stat("src/dir").gid == 0 } + assert { File.stat("mnt/dir").gid == 10000 } + end +end + if `uname`.strip != 'FreeBSD' # -o dev is not supported on FreeBSD root_testenv("-odev") do system("mknod mnt/zero c 1 5") -- cgit v1.2.3