diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-08 13:37:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-08 13:37:43 +0000 |
commit | cd27c42552b57a517a7abbe836eea0c52a896630 (patch) | |
tree | 6ce3089a3a06284296cf079a6499da9034626539 /coreutils/chmod.c | |
parent | 6c939e0cb41a366e901063ede1672434886fc9c5 (diff) | |
download | busybox-w32-cd27c42552b57a517a7abbe836eea0c52a896630.tar.gz busybox-w32-cd27c42552b57a517a7abbe836eea0c52a896630.tar.bz2 busybox-w32-cd27c42552b57a517a7abbe836eea0c52a896630.zip |
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.c | 13 |
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) | |||
118 | /* | 118 | /* |
119 | Security: chmod is too important and too subtle. | 119 | Security: chmod is too important and too subtle. |
120 | This is a test script (busybox chmod versus coreutils). | 120 | This is a test script (busybox chmod versus coreutils). |
121 | Run it in empty dir. Probably requires bash. | 121 | Run it in empty directory. |
122 | 122 | ||
123 | #!/bin/sh | 123 | #!/bin/sh |
124 | function create() { | 124 | t1="/tmp/busybox chmod" |
125 | t2="/usr/bin/chmod" | ||
126 | create() { | ||
125 | rm -rf $1; mkdir $1 | 127 | rm -rf $1; mkdir $1 |
126 | ( | 128 | ( |
127 | cd $1 || exit 1 | 129 | cd $1 || exit 1 |
@@ -134,17 +136,16 @@ function create() { | |||
134 | ln -s ../up dir/up | 136 | ln -s ../up dir/up |
135 | ) | 137 | ) |
136 | } | 138 | } |
137 | function tst() { | 139 | tst() { |
138 | (cd test1; $t1 $1) | 140 | (cd test1; $t1 $1) |
139 | (cd test2; $t2 $1) | 141 | (cd test2; $t2 $1) |
140 | (cd test1; ls -lR) >out1 | 142 | (cd test1; ls -lR) >out1 |
141 | (cd test2; ls -lR) >out2 | 143 | (cd test2; ls -lR) >out2 |
142 | echo "chmod $1" >out.diff | 144 | echo "chmod $1" >out.diff |
143 | if ! diff -u out1 out2 >>out.diff; then exit 1; fi | 145 | if ! diff -u out1 out2 >>out.diff; then exit 1; fi |
144 | mv out.diff out1.diff | 146 | rm out.diff |
145 | } | 147 | } |
146 | t1="/tmp/busybox chmod" | 148 | echo "If script produced 'out.diff' file, then at least one testcase failed" |
147 | t2="/usr/bin/chmod" | ||
148 | create test1; create test2 | 149 | create test1; create test2 |
149 | tst "a+w file" | 150 | tst "a+w file" |
150 | tst "a-w dir" | 151 | tst "a-w dir" |