diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-07-30 16:44:17 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-08-02 17:18:26 -0400 |
commit | 6290ce41f3ec1f889abb881cf90ca91da869b5b2 (patch) | |
tree | 679b1717100bd9f4c693d9d8b9463d51b195fd6c /tests | |
parent | b8a008dc9b84804d8b2c751daa9c04bd86d5e59c (diff) | |
download | bfs-6290ce41f3ec1f889abb881cf90ca91da869b5b2.tar.xz |
parse: Take umask into account in parse_mode()
POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1)
here, so for modes like +rw,-x with no "who" specified, apply the umask.
Link: https://www.austingroupbugs.net/view.php?id=1392
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bfs/perm_leading_plus_symbolic.out | 5 | ||||
-rw-r--r-- | tests/posix/perm_leading_plus_symbolic_minus.out | 5 | ||||
-rw-r--r-- | tests/posix/perm_leading_plus_umask.out | 10 | ||||
-rw-r--r-- | tests/posix/perm_leading_plus_umask.sh | 3 |
4 files changed, 21 insertions, 2 deletions
diff --git a/tests/bfs/perm_leading_plus_symbolic.out b/tests/bfs/perm_leading_plus_symbolic.out index fdc175d..09bc88f 100644 --- a/tests/bfs/perm_leading_plus_symbolic.out +++ b/tests/bfs/perm_leading_plus_symbolic.out @@ -1,2 +1,3 @@ -perms/drwxrwxrwx -perms/frwxrwxrwx +perms +perms/drwxr-xr-x +perms/frwxr-xr-x diff --git a/tests/posix/perm_leading_plus_symbolic_minus.out b/tests/posix/perm_leading_plus_symbolic_minus.out index fdc175d..38d0e1c 100644 --- a/tests/posix/perm_leading_plus_symbolic_minus.out +++ b/tests/posix/perm_leading_plus_symbolic_minus.out @@ -1,2 +1,7 @@ +perms +perms/drwxr-xr-x +perms/drwxrwxr-x perms/drwxrwxrwx +perms/frwxr-xr-x +perms/frwxrwxr-x perms/frwxrwxrwx diff --git a/tests/posix/perm_leading_plus_umask.out b/tests/posix/perm_leading_plus_umask.out new file mode 100644 index 0000000..6ed4b7f --- /dev/null +++ b/tests/posix/perm_leading_plus_umask.out @@ -0,0 +1,10 @@ +perms/drwxrwxr-x +perms/drwxrwxrwx +perms/f-w--w---- +perms/f-w--w--w- +perms/f-wx-wx--x +perms/f-wx-wx-wx +perms/frw-rw-r-- +perms/frw-rw-rw- +perms/frwxrwxr-x +perms/frwxrwxrwx diff --git a/tests/posix/perm_leading_plus_umask.sh b/tests/posix/perm_leading_plus_umask.sh new file mode 100644 index 0000000..948b4ad --- /dev/null +++ b/tests/posix/perm_leading_plus_umask.sh @@ -0,0 +1,3 @@ +# Test for https://www.austingroupbugs.net/view.php?id=1392 +umask 002 +bfs_diff perms -perm -+w |