tests: fix an obsolete and now unsupported syntax for 'find -perm'

tests/test01_pkgquality
tests/test02_pkgsecurity

Fix an obsolete and now unsupported syntax of the external tool 'find'
(-perm +<mode>) that made some quality and security tests fail.
The supported one is now: -perm /<mode>

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2014-09-16 22:03:24 +02:00
parent f172d7e6db
commit 5a4e8f799a
5 changed files with 13 additions and 5 deletions

View File

@ -61,6 +61,10 @@ Sat Sep 20 2014 Madrisan <davide.madrisan(a)gmail.com>
as required by smart. as required by smart.
Also add comments and a FIXME about a problem with previous patch of this Also add comments and a FIXME about a problem with previous patch of this
+ bugfix
* tests/{test01_pkgquality,test02_pkgsecurity} - Davide Madrisan
Fix an obsolete and now unsupported syntax for 'find -perm'.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Changes in version 1.16.4 - "Korbielow" release Changes in version 1.16.4 - "Korbielow" release

4
NEWS
View File

@ -45,6 +45,10 @@ List of user visible changes in the release 1.16.5
* conf/04-rpmbuild-format-unpackaged-filelist.conf - Davide Madrisan * conf/04-rpmbuild-format-unpackaged-filelist.conf - Davide Madrisan
The translation rules for Python 2.7 and Python 3 have been updated. The translation rules for Python 2.7 and Python 3 have been updated.
* tests/{test01_pkgquality,test02_pkgsecurity} - Davide Madrisan
Fix an obsolete and now unsupported syntax for 'find -perm' that made some
quality and security tests fail.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
List of user visible changes in the release 1.16.4 - "Korbielow" release List of user visible changes in the release 1.16.4 - "Korbielow" release

View File

@ -288,7 +288,7 @@ $"checking for binary files installed in /etc (see FHS)""${NORM}..."
let "i = 0" let "i = 0"
for pck in ${rpmpkg_name[@]}; do for pck in ${rpmpkg_name[@]}; do
pushd $tmpextractdir/$i >/dev/null pushd $tmpextractdir/$i >/dev/null
for f in $( find ./etc -type f -perm +111 2>/dev/null ); do for f in $( find ./etc -type f -perm /111 2>/dev/null ); do
case $f in case $f in
./etc/rc.d/init.d/*) ;; ./etc/rc.d/init.d/*) ;;
*) let "warning = 1" && *) let "warning = 1" &&

View File

@ -89,7 +89,7 @@ $"checking for RPATH vulnerabilities""${NORM}..."
# find ELF binaries (ELF 32-bit LSB executable) # find ELF binaries (ELF 32-bit LSB executable)
# and libs (ELF 32-bit LSB shared object) # and libs (ELF 32-bit LSB shared object)
for f in $(find -mindepth 2 -perm +111 -type f); do for f in $(find -mindepth 2 -perm /111 -type f); do
if [[ "$(file $f | grep " ELF ")" ]]; then if [[ "$(file $f | grep " ELF ")" ]]; then
rpath="$(security.filecheckrpath $f)" rpath="$(security.filecheckrpath $f)"
if [ "$rpath" ]; then if [ "$rpath" ]; then
@ -111,7 +111,7 @@ $"checking for setuid binaries""${NORM}..."
let "i = 0" let "i = 0"
for pck in ${rpmpkg_name[@]}; do for pck in ${rpmpkg_name[@]}; do
pushd $tmpextractdir/$i >/dev/null pushd $tmpextractdir/$i >/dev/null
for f in $(find -mindepth 2 -perm +111 -type f 2>/dev/null); do for f in $(find -mindepth 2 -perm /111 -type f 2>/dev/null); do
if [[ "$(LC_ALL=C file $f | grep " setuid ")" ]]; then if [[ "$(LC_ALL=C file $f | grep " setuid ")" ]]; then
notify.warning "${NORM}${pck##*/} --> ${f/./}" notify.warning "${NORM}${pck##*/} --> ${f/./}"
let "total_issues += 1" let "total_issues += 1"
@ -147,7 +147,7 @@ $"checking for unsecure use of \`\$\$' in shell and perl scripts""${NORM}..."
let "i = 0" let "i = 0"
for pck in ${rpmpkg_name[@]}; do for pck in ${rpmpkg_name[@]}; do
pushd $tmpextractdir/$i >/dev/null pushd $tmpextractdir/$i >/dev/null
for f in $(find -mindepth 1 -perm +111 -type f); do for f in $(find -mindepth 1 -perm /111 -type f); do
# we are interesting only in shell scripts # we are interesting only in shell scripts
[[ "$(file $f | grep "shell script\|perl script")" ]] || [[ "$(file $f | grep "shell script\|perl script")" ]] ||
continue continue

View File

@ -860,7 +860,7 @@ This package contains static libraries and header files need for development."
local pck_configure=`(\ local pck_configure=`(\
cd $tmpdir/$pck_rootdir && cd $tmpdir/$pck_rootdir &&
{ [[ -x ./configure ]] && echo -n "./configure" { [[ -x ./configure ]] && echo -n "./configure"
LANG=C find . -mindepth 2 -type f -perm +111 \ LANG=C find . -mindepth 2 -type f -perm /111 \
-name configure -printf "%p "; } )` -name configure -printf "%p "; } )`
notify.debug "pck_configure = \"$pck_configure\"" notify.debug "pck_configure = \"$pck_configure\""