- #!/bin/sh
- if [ $1 = "--help" ]
- then
- echo -e "Usage: sudoch MODE[,MODE]... FILE...\n\nFILE must be the Direct path\n\nEach MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+'."
- exit
- fi
- if [ $# -lt 2 ]
- then
- echo "usge command -authority -path"
- exit
- fi
- File="$2"
- authority="$1"
- all="$@"
- echo $File | grep -q '^/' || File=$PWD/$File
- dir="/usr/local/ /usr/local/oiweb_qpay/cgi-bin /usr/local/ /data/sales_svr/"
- for LINE in `echo $dir`
- do
- COUNT_CHAR=`echo "$LINE" | wc -c`
- Substr="${File:0:$COUNT_CHAR-1}"
- if [ "$Substr" = "$LINE" ]
- then
- flag="0"
- chmod -R $all
- break
- fi
- done
- if [ "$flag" != "0" ]
- then
- echo "error: the path is not allowed to use the command"
- fi
"/data/evegao/../"| sed 's/\/[^\/]*\/\.\.//g'
阅读(2055) | 评论(0) | 转发(0) |