]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
Allow chown to uid:0 to succeed.
authorDickon Reed <dickon.reed@gmail.com>
Fri, 18 Mar 2011 19:25:38 +0000 (12:25 -0700)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 20 Mar 2011 07:22:54 +0000 (00:22 -0700)
The test case assumed that it was not possible to set uid:0 on a file,
which is to say that the current user is not a member of group
0. That's an environmental assumption which is not universal (I am a
counterexample).

Modified lib/bup/t/tmetadata.py

lib/bup/t/tmetadata.py

index d6af988aea5f07c0e1b0e8edb3c8fded20d78d52..17cec0128fe8c0f9cac1cf2188f6afafbdf9f3b4 100644 (file)
@@ -173,7 +173,7 @@ def test_restore_restricted_user_group():
         m.gid = 0;
         m.apply_to_path(path, restore_numeric_ids=True)
         errmsg = str(helpers.saved_errors[0]) if helpers.saved_errors else ''
-        WVPASS(errmsg.startswith('lchown: '))
+        WVPASS(errmsg.startswith('lchown: ') or os.stat(path).st_gid == m.gid)
         clear_errors()
     finally:
         subprocess.call(['rm', '-rf', tmpdir])