aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-09-05 04:28:40 -0500
committerRob Landley <rob@landley.net>2013-09-05 04:28:40 -0500
commit314dc6881f0439478f483d26726c52c1c3f536ff (patch)
tree1b8affa10549d3f7ac5fd98eee6f17501cf2aa91 /scripts
parent829497311b541b63e08aa17768c8e67e95b73638 (diff)
downloadtoybox-314dc6881f0439478f483d26726c52c1c3f536ff.tar.gz
Make chdir handle permissions according to posix, reported by Jacek Bukarewicz..
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test/mkdir.test20
1 files changed, 18 insertions, 2 deletions
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