From cd27c42552b57a517a7abbe836eea0c52a896630 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 8 Mar 2007 13:37:43 +0000 Subject: chown: support -H -L -P if ENABLE_DESKTOP chmod: cosmetic fixes expr: smallish help for dumb compilers --- coreutils/chmod.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'coreutils/chmod.c') diff --git a/coreutils/chmod.c b/coreutils/chmod.c index 74788bb..11c6731 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" -- cgit v1.1