mirror of https://github.com/CIRCL/Circlean
prepare archive support, and fixing archive-bomb-problem
parent
c25ba6cf23
commit
a2d1ec8e63
|
@ -3,6 +3,8 @@
|
||||||
source ./constraint.sh
|
source ./constraint.sh
|
||||||
source ./constraint_conv.sh
|
source ./constraint_conv.sh
|
||||||
|
|
||||||
|
RECURSIVE_ARCHIVE_MAX=3
|
||||||
|
RECURSIVE_ARCHIVE_CURRENT=0
|
||||||
|
|
||||||
copy(){
|
copy(){
|
||||||
src_file=${1}
|
src_file=${1}
|
||||||
|
@ -37,6 +39,10 @@ video(){
|
||||||
|
|
||||||
# Random - Used
|
# Random - Used
|
||||||
|
|
||||||
|
archive(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
application(){
|
application(){
|
||||||
echo App file ${1}
|
echo App file ${1}
|
||||||
src_file=${1}
|
src_file=${1}
|
||||||
|
@ -108,6 +114,19 @@ main(){
|
||||||
# first param is the destination dir
|
# first param is the destination dir
|
||||||
dest=${1}
|
dest=${1}
|
||||||
|
|
||||||
|
|
||||||
|
if [ ${2} ]; then
|
||||||
|
RECURSIVE_ARCHIVE_CURRENT=${RECURSIVE_ARCHIVE_CURRENT}+1
|
||||||
|
SRC=${3}
|
||||||
|
if [ ${RECURSIVE_ARCHIVE_CURRENT} -gt ${RECURSIVE_ARCHIVE_MAX} ]; then
|
||||||
|
echo Archive bomb.
|
||||||
|
rm -rf ${SRC}
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
RECURSIVE_ARCHIVE_CURRENT=0
|
||||||
|
fi
|
||||||
|
|
||||||
FILE_COMMAND='file -b --mime-type'
|
FILE_COMMAND='file -b --mime-type'
|
||||||
FILE_LIST=`find ${SRC} -type f`
|
FILE_LIST=`find ${SRC} -type f`
|
||||||
for file in ${FILE_LIST}; do
|
for file in ${FILE_LIST}; do
|
||||||
|
|
Loading…
Reference in New Issue