From e63c9967423b5b9c6fc48d2b31a04e3c030bc16a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 15 Mar 2021 17:08:58 -0700 Subject: chmod: fix +X. I broke this when I added the masking out of the S_IFMT bits for macOS, because string_to_mode needs the full mode with those extra bits, specifically so that it can recognize directories for +X to work. I've duplicated chtest rather than change chtest to explicitly set the modes to 000 before running the given chmod command because I didn't want to touch *all* the tests and obscure the addition of just one. --- tests/chmod.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/chmod.test b/tests/chmod.test index cd4f8100..6c4de0c0 100755 --- a/tests/chmod.test +++ b/tests/chmod.test @@ -115,6 +115,11 @@ unset SKIP chtest +t "drwxr-xr-t\n-rw-r--r-T\n" chtest a=r+w+x "drwxrwxrwx\n-rwxrwxrwx\n" +# (chtest starts off with a directory that's +x...) +testing "+X" \ + "mkdir -m 000 Xd && touch Xf && chmod +X Xd Xf && ls -ld Xd Xf | cut -d' ' -f 1" \ + "d--x--x--x\n-rw-r--r--\n" "" "" + mkdir foo ln -s bar foo/baz # If you explicitly ask us, we'll try (and fail) to chmod a symlink. -- cgit v1.2.3