From 314dc6881f0439478f483d26726c52c1c3f536ff Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 5 Sep 2013 04:28:40 -0500 Subject: Make chdir handle permissions according to posix, reported by Jacek Bukarewicz.. --- scripts/test/mkdir.test | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'scripts/test') diff --git a/scripts/test/mkdir.test b/scripts/test/mkdir.test index 035d6132..cbd425d4 100644 --- a/scripts/test/mkdir.test +++ b/scripts/test/mkdir.test @@ -32,13 +32,29 @@ testing "mkdir (default permissions)" \ "mkdir one && stat -c %a one" "654\n" "" "" rmdir one -umask 000 - testing "mkdir -m 124" \ "mkdir -m 124 one && stat -c %a one" "124\n" "" "" rmdir one +umask 000 testing "mkdir -p -m 653" \ "mkdir -p -m 653 one/two && stat -c %a one && stat -c %a one/two" \ "777\n653\n" "" "" rm -rf one + +testing "mkdir -p one/two/ (trailing slash)" \ + "mkdir -p one/two/ && [ -d one/two ] && echo yes" "yes\n" "" "" +rm -rf one + +umask 022 +testing "mkdir -p -m 777 (022 umask)" \ + "mkdir -p -m 777 one/two && stat -c %a one && stat -c %a one/two" \ + "755\n777\n" "" "" +rm -rf one + +umask 377 +testing "mkdir -p -m 777 (377 umask)" \ + "mkdir -p -m 777 one/two && stat -c %a one && stat -c %a one/two" \ + "700\n777\n" "" "" +umask 002 +rm -rf one -- cgit v1.2.3