X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsecurity%2Fdos_perm.sh;fp=scripts%2Fsecurity%2Fdos_perm.sh;h=89124375688785825fae4371e7c0770f313eac09;hb=aa3c39c42b175ba42febe295be6da7fae47713a8;hp=0000000000000000000000000000000000000000;hpb=5b2b4473bd46dc412b11d1372704a2d4ef7d0465;p=feisty_meow.git diff --git a/scripts/security/dos_perm.sh b/scripts/security/dos_perm.sh new file mode 100644 index 00000000..89124375 --- /dev/null +++ b/scripts/security/dos_perm.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# dos_perm: whacks a directory with the most open set of permissions +# available to the dos/windoze attrib command. + +folder="$1"; shift + +if [ -z "$folder" ]; then + echo "This program requires a folder to set the permissions on. That folder and all" + echo "files in it will be opened up to as full a permission level as DOS's attrib" + echo "command is capable of." + exit 3 +fi + +folder="${folder}/" # add a slash to ensure there's at least one after drive letters. + +dos_folder=$(echo $folder | sed -e 's/\/\([a-zA-Z]\)\/\(.*\)/\1:\/\2/' | sed -e 's/\//\\\\/g') +#echo dos folder is $dos_folder + +attrib -r -s -h //s //d "$dos_folder\\*" +