summaryrefslogtreecommitdiffhomepage
path: root/coreutils/chmod.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-03-08 13:37:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-03-08 13:37:43 +0000
commitcd27c42552b57a517a7abbe836eea0c52a896630 (patch)
tree6ce3089a3a06284296cf079a6499da9034626539 /coreutils/chmod.c
parent6c939e0cb41a366e901063ede1672434886fc9c5 (diff)
chown: support -H -L -P if ENABLE_DESKTOP
chmod: cosmetic fixes expr: smallish help for dumb compilers
Diffstat (limited to 'coreutils/chmod.c')
-rw-r--r--coreutils/chmod.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 74788bbbe..11c6731a1 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -118,10 +118,12 @@ int chmod_main(int argc, char **argv)
/*
Security: chmod is too important and too subtle.
This is a test script (busybox chmod versus coreutils).
-Run it in empty dir. Probably requires bash.
+Run it in empty directory.
#!/bin/sh
-function create() {
+t1="/tmp/busybox chmod"
+t2="/usr/bin/chmod"
+create() {
rm -rf $1; mkdir $1
(
cd $1 || exit 1
@@ -134,17 +136,16 @@ function create() {
ln -s ../up dir/up
)
}
-function tst() {
+tst() {
(cd test1; $t1 $1)
(cd test2; $t2 $1)
(cd test1; ls -lR) >out1
(cd test2; ls -lR) >out2
echo "chmod $1" >out.diff
if ! diff -u out1 out2 >>out.diff; then exit 1; fi
- mv out.diff out1.diff
+ rm out.diff
}
-t1="/tmp/busybox chmod"
-t2="/usr/bin/chmod"
+echo "If script produced 'out.diff' file, then at least one testcase failed"
create test1; create test2
tst "a+w file"
tst "a-w dir"