950b794
diff -up bindfs-1.13.0/tests/test_bindfs.rb.nobody_gid bindfs-1.13.0/tests/test_bindfs.rb
950b794
--- bindfs-1.13.0/tests/test_bindfs.rb.nobody_gid	2015-09-27 00:11:40.000000000 +0200
950b794
+++ bindfs-1.13.0/tests/test_bindfs.rb	2015-11-15 15:09:02.871299551 +0100
950b794
@@ -36,7 +36,8 @@ end
950b794
 
950b794
 # Some useful shorthands
950b794
 $nobody_uid = nobody_uid = Etc.getpwnam('nobody').uid
950b794
-$nogroup_gid = nogroup_gid = Etc.getgrnam('nogroup').gid
950b794
+$nobody_gid = nobody_gid = Etc.getpwnam('nobody').gid
950b794
+$nobody_group = nobody_group = Etc.getgrgid(nobody_gid).name
950b794
 
950b794
 $tests_dir = File.dirname(File.realpath(__FILE__))
950b794
 
950b794
@@ -45,11 +46,11 @@ testenv("") do
950b794
     assert { File.basename(pwd) == TESTDIR_NAME }
950b794
 end
950b794
 
950b794
-testenv("-u nobody -g nogroup") do
950b794
+testenv("-u nobody -g #{nobody_group}") do
950b794
     touch('src/file')
950b794
 
950b794
     assert { File.stat('mnt/file').uid == nobody_uid }
950b794
-    assert { File.stat('mnt/file').gid == nogroup_gid }
950b794
+    assert { File.stat('mnt/file').gid == nobody_gid }
950b794
 end
950b794
 
950b794
 testenv("-p 0600:u+D") do
950b794
@@ -73,24 +74,24 @@ end
950b794
 
950b794
 root_testenv("", :title => "--create-as-user should be default for root") do
950b794
   chmod(0777, 'src')
950b794
-  `sudo -u nobody -g nogroup touch mnt/file`
950b794
-  `sudo -u nobody -g nogroup mkdir mnt/dir`
950b794
-  `sudo -u nobody -g nogroup ln -sf /tmp/foo mnt/lnk`
950b794
+  `sudo -u nobody -g #{nobody_group} touch mnt/file`
950b794
+  `sudo -u nobody -g #{nobody_group} mkdir mnt/dir`
950b794
+  `sudo -u nobody -g #{nobody_group} ln -sf /tmp/foo mnt/lnk`
950b794
 
950b794
   assert { File.stat('mnt/file').uid == nobody_uid }
950b794
-  assert { File.stat('mnt/file').gid == nogroup_gid }
950b794
+  assert { File.stat('mnt/file').gid == nobody_gid }
950b794
   assert { File.stat('src/file').uid == nobody_uid }
950b794
-  assert { File.stat('src/file').gid == nogroup_gid }
950b794
+  assert { File.stat('src/file').gid == nobody_gid }
950b794
 
950b794
   assert { File.stat('mnt/dir').uid == nobody_uid }
950b794
-  assert { File.stat('mnt/dir').gid == nogroup_gid }
950b794
+  assert { File.stat('mnt/dir').gid == nobody_gid }
950b794
   assert { File.stat('src/dir').uid == nobody_uid }
950b794
-  assert { File.stat('src/dir').gid == nogroup_gid }
950b794
+  assert { File.stat('src/dir').gid == nobody_gid }
950b794
 
950b794
   assert { File.lstat('mnt/lnk').uid == nobody_uid }
950b794
-  assert { File.lstat('mnt/lnk').gid == nogroup_gid }
950b794
+  assert { File.lstat('mnt/lnk').gid == nobody_gid }
950b794
   assert { File.lstat('src/lnk').uid == nobody_uid }
950b794
-  assert { File.lstat('src/lnk').gid == nogroup_gid }
950b794
+  assert { File.lstat('src/lnk').gid == nobody_gid }
950b794
 end
950b794
 
950b794
 testenv("--create-with-perms=og=r:ogd+x") do
950b794
@@ -168,8 +169,8 @@ def run_chown_chgrp_test_case(chown_flag
950b794
     mntfile = 'mnt/file'
950b794
     tests = [
950b794
         lambda { chown('nobody', nil, mntfile) },
950b794
-        lambda { chown(nil, 'nogroup', mntfile) },
950b794
-        lambda { chown('nobody', 'nogroup', mntfile) }
950b794
+        lambda { chown(nil, nobody_group, mntfile) },
950b794
+        lambda { chown('nobody', nobody_group, mntfile) }
950b794
     ]
950b794
 
950b794
     for testcase, expect in tests.zip expectations
950b794
@@ -185,16 +186,16 @@ def run_chown_chgrp_test_case(chown_flag
950b794
                 case expect
950b794
                 when :uid
950b794
                     assert { uid == $nobody_uid }
950b794
-                    assert { gid != $nogroup_gid }
950b794
+                    assert { gid != $nobody_gid }
950b794
                 when :gid
950b794
                     assert { uid != $nobody_uid }
950b794
-                    assert { gid == $nogroup_gid }
950b794
+                    assert { gid == $nobody_gid }
950b794
                 when :both
950b794
                     assert { uid == $nobody_uid }
950b794
-                    assert { gid == $nogroup_gid }
950b794
+                    assert { gid == $nobody_gid }
950b794
                 when nil
950b794
                     assert { uid != $nobody_uid }
950b794
-                    assert { gid != $nogroup_gid }
950b794
+                    assert { gid != $nobody_gid }
950b794
                 end
950b794
             end
950b794
         end
950b794
@@ -211,16 +212,16 @@ root_testenv("--chown-deny") do
950b794
     touch('src/file')
950b794
 
950b794
     assert_exception(EPERM) { chown('nobody', nil, 'mnt/file') }
950b794
-    assert_exception(EPERM) { chown('nobody', 'nogroup', 'mnt/file') }
950b794
-    chown(nil, 'nogroup', 'mnt/file')
950b794
+    assert_exception(EPERM) { chown('nobody', nobody_group, 'mnt/file') }
950b794
+    chown(nil, nobody_group, 'mnt/file')
950b794
 end
950b794
 
950b794
 root_testenv("--mirror=root") do
950b794
     touch('src/file')
950b794
-    chown('nobody', 'nogroup', 'src/file')
950b794
+    chown('nobody', nobody_group, 'src/file')
950b794
 
950b794
     assert { File.stat('mnt/file').uid == 0 }
950b794
-    assert { File.stat('mnt/file').gid == $nogroup_gid }
950b794
+    assert { File.stat('mnt/file').gid == $nobody_gid }
950b794
 end
950b794
 
950b794
 testenv("--chmod-allow-x --chmod-ignore") do
950b794
@@ -265,9 +266,9 @@ testenv("--chmod-filter=g-w,o-rwx") do
950b794
     assert { File.stat('src/file').mode & 0777 == 0640 }
950b794
 end
950b794
 
950b794
-root_testenv("--map=nobody/root:@nogroup/@root") do
950b794
+root_testenv("--map=nobody/root:@nobody/@root") do
950b794
     touch('src/file')
950b794
-    chown('nobody', 'nogroup', 'src/file')
950b794
+    chown('nobody', nobody_group, 'src/file')
950b794
 
950b794
     assert { File.stat('mnt/file').uid == 0 }
950b794
     assert { File.stat('mnt/file').gid == 0 }
950b794
@@ -276,9 +277,9 @@ root_testenv("--map=nobody/root:@nogroup
950b794
     mkdir('mnt/newdir')
950b794
 
950b794
     assert { File.stat('src/newfile').uid == $nobody_uid }
950b794
-    assert { File.stat('src/newfile').gid == $nogroup_gid }
950b794
+    assert { File.stat('src/newfile').gid == $nobody_gid }
950b794
     assert { File.stat('src/newdir').uid == $nobody_uid }
950b794
-    assert { File.stat('src/newdir').gid == $nogroup_gid }
950b794
+    assert { File.stat('src/newdir').gid == $nobody_gid }
950b794
 
950b794
     assert { File.stat('mnt/newfile').uid == 0 }
950b794
     assert { File.stat('mnt/newfile').gid == 0 }
950b794
@@ -286,9 +287,9 @@ root_testenv("--map=nobody/root:@nogroup
950b794
     assert { File.stat('mnt/newdir').gid == 0 }
950b794
 end
950b794
 
950b794
-root_testenv("--map=@nogroup/@root") do
950b794
+root_testenv("--map=@nobody/@root") do
950b794
     touch('src/file')
950b794
-    chown('nobody', 'nogroup', 'src/file')
950b794
+    chown('nobody', nobody_group, 'src/file')
950b794
 
950b794
     assert { File.stat('mnt/file').gid == 0 }
950b794
 end
950b794
@@ -360,14 +361,14 @@ end
950b794
 root_testenv("", :title => "setgid directories") do
950b794
     mkdir('mnt/dir')
950b794
     chmod("g+s", 'mnt/dir')
950b794
-    chown(nil, $nogroup_gid, 'mnt/dir')
950b794
+    chown(nil, $nobody_gid, 'mnt/dir')
950b794
 
950b794
     touch('mnt/dir/file')
950b794
 
950b794
     assert { File.stat('src/dir').mode & 07000 == 02000 }
950b794
-    assert { File.stat('src/dir/file').gid == $nogroup_gid }
950b794
+    assert { File.stat('src/dir/file').gid == $nobody_gid }
950b794
     assert { File.stat('mnt/dir').mode & 07000 == 02000 }
950b794
-    assert { File.stat('mnt/dir/file').gid == $nogroup_gid }
950b794
+    assert { File.stat('mnt/dir/file').gid == $nobody_gid }
950b794
 end
950b794
 
950b794
 testenv("", :title => "utimens on symlinks") do