From 5a4e8f799ab02fbea21599e9b6038db581ea71b4 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Tue, 16 Sep 2014 22:03:24 +0200 Subject: [PATCH] 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 +) that made some quality and security tests fail. The supported one is now: -perm / Signed-off-by: Davide Madrisan --- ChangeLog | 4 ++++ NEWS | 4 ++++ tests/test01_pkgquality.in | 2 +- tests/test02_pkgsecurity.in | 6 +++--- unmaintained/spec-create-old.in | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18ac795..4453f73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,10 @@ Sat Sep 20 2014 Madrisan as required by smart. 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 diff --git a/NEWS b/NEWS index 7a95855..9c3e13b 100644 --- a/NEWS +++ b/NEWS @@ -45,6 +45,10 @@ List of user visible changes in the release 1.16.5 * conf/04-rpmbuild-format-unpackaged-filelist.conf - Davide Madrisan 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 diff --git a/tests/test01_pkgquality.in b/tests/test01_pkgquality.in index d196ea2..38e8b5b 100644 --- a/tests/test01_pkgquality.in +++ b/tests/test01_pkgquality.in @@ -288,7 +288,7 @@ $"checking for binary files installed in /etc (see FHS)""${NORM}..." let "i = 0" for pck in ${rpmpkg_name[@]}; do 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 ./etc/rc.d/init.d/*) ;; *) let "warning = 1" && diff --git a/tests/test02_pkgsecurity.in b/tests/test02_pkgsecurity.in index 1841bbe..e866196 100644 --- a/tests/test02_pkgsecurity.in +++ b/tests/test02_pkgsecurity.in @@ -89,7 +89,7 @@ $"checking for RPATH vulnerabilities""${NORM}..." # find ELF binaries (ELF 32-bit LSB executable) # 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 rpath="$(security.filecheckrpath $f)" if [ "$rpath" ]; then @@ -111,7 +111,7 @@ $"checking for setuid binaries""${NORM}..." let "i = 0" for pck in ${rpmpkg_name[@]}; do 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 notify.warning "${NORM}${pck##*/} --> ${f/./}" let "total_issues += 1" @@ -147,7 +147,7 @@ $"checking for unsecure use of \`\$\$' in shell and perl scripts""${NORM}..." let "i = 0" for pck in ${rpmpkg_name[@]}; do 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 [[ "$(file $f | grep "shell script\|perl script")" ]] || continue diff --git a/unmaintained/spec-create-old.in b/unmaintained/spec-create-old.in index 33ab289..b24f3c7 100644 --- a/unmaintained/spec-create-old.in +++ b/unmaintained/spec-create-old.in @@ -860,7 +860,7 @@ This package contains static libraries and header files need for development." local pck_configure=`(\ cd $tmpdir/$pck_rootdir && { [[ -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 "; } )` notify.debug "pck_configure = \"$pck_configure\""