From 2d2a0c368bc0d0ff59a254062211e31b28641865 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Fri, 8 Feb 2013 10:46:42 +0100 Subject: [PATCH] bee-check: fix reading the CONTENT file and the filename handling there were problems if a filename contains spaces replacing the for loop and always quoting the arguments fixes this issue --- src/bee-check.sh.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bee-check.sh.in b/src/bee-check.sh.in index 2896c75..e004561 100644 --- a/src/bee-check.sh.in +++ b/src/bee-check.sh.in @@ -230,8 +230,8 @@ do_check() { echo "checking ${pkg} .." - for line in $(cat ${filesfile}) ; do - eval $(${BEESEP} ${line}) + while read line ; do + eval $(${BEESEP} "${line}") # save and strip possible symbolic link destination.. symlink=${file#*//} @@ -246,7 +246,7 @@ do_check() { if [ ! -h "${file}" ] ; then echo " [changed] ${file}" else - sdest=$(readlink ${file}) + sdest=$(readlink "${file}") if [ "${sdest}" != "${symlink}" ] ; then echo " [changed] ${file}" fi @@ -262,7 +262,7 @@ do_check() { fi else # regular file - check md5sum.. - md5now=$(md5sum ${file} | sed -e 's,^\([a-z0-9]*\).*$,\1,') + md5now=$(md5sum "${file}" | sed -e 's,^\([a-z0-9]*\).*$,\1,') if [ "${md5}" != "${md5now}" ] ; then echo " [changed] ${file}" @@ -271,7 +271,7 @@ do_check() { # check mode, uid and gid of directory/file - stat=( $(stat ${file} --printf "%f %u %g %U %G") ) + stat=( $(stat "${file}" --printf "%f %u %g %U %G") ) full=$(printf "0%o" 0x${stat[0]}) @@ -286,7 +286,7 @@ do_check() { if [ "${gid}" != "${stat[2]}" ] ; then echo " [changed] ${file}" fi - done + done < "${filesfile}" }