test: rework coloring schema and make output a bit more compact
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
parent
51ba76940c
commit
cfbc63921d
@ -42,6 +42,11 @@ Sun Jan 15 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
|
|||||||
* tests/test02_pkgsecurity - Davide Madrisan:
|
* tests/test02_pkgsecurity - Davide Madrisan:
|
||||||
New test: check for setgid directories.
|
New test: check for setgid directories.
|
||||||
|
|
||||||
|
+ update
|
||||||
|
tests/test01_pkgquality
|
||||||
|
tests/test02_pkgsecurity - Davide Madrisan:
|
||||||
|
Rework coloring schema and make output a bit more compact.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Changes in version 1.8.2
|
Changes in version 1.8.2
|
||||||
|
@ -103,5 +103,5 @@ msgstr "ricerca di pacchetti con errato tag BuildArch"
|
|||||||
msgid "this package should be tagged \\`noarch'"
|
msgid "this package should be tagged \\`noarch'"
|
||||||
msgstr "questo pacchetto dovrebbe essere di tipo \\`noarch'"
|
msgstr "questo pacchetto dovrebbe essere di tipo \\`noarch'"
|
||||||
|
|
||||||
msgid "Quality checks: ${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s)."
|
msgid "Quality checks: ${#rpmpkg_name[@]} package(s) checked: ${WARN}$total_issues${NOTE} warning(s)."
|
||||||
msgstr "Controlli di qualità: pacchetti controllati: ${#rpmpkg_name[@]}; problemi riscontrati: $total_issues"
|
msgstr "Controlli di qualità: pacchetti rpm: ${#rpmpkg_name[@]}; problemi riscontrati: ${WARN}$total_issues${NOTE}"
|
||||||
|
@ -64,5 +64,5 @@ msgstr "Suggerimento per script bash (richiede \\`mktemp')"
|
|||||||
msgid "Hint for perl scripts"
|
msgid "Hint for perl scripts"
|
||||||
msgstr "Suggerimento per script perl"
|
msgstr "Suggerimento per script perl"
|
||||||
|
|
||||||
msgid "Security checks: ${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s)."
|
msgid "Security checks: ${#rpmpkg_name[@]} package(s) checked: ${WARN}$total_issues${NOTE} warning(s)."
|
||||||
msgstr "Ccntrolli di sicurezza: pacchetti controllati: ${#rpmpkg_name[@]}; problemi riscontrati: $total_issues"
|
msgstr "Controlli di sicurezza: pacchetti rpm: ${#rpmpkg_name[@]}; problemi riscontrati: ${WARN}$total_issues${NOTE}"
|
||||||
|
@ -373,6 +373,6 @@ BuildArch: noarch
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
notify.note "\
|
notify.note "\
|
||||||
--> ${NOTE}"$"Quality checks: \
|
--> ${NOTE}"$"Quality checks: ${#rpmpkg_name[@]} \
|
||||||
${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s).""${NORM}"
|
package(s) checked: ${WARN}$total_issues${NOTE} warning(s).""${NORM}"
|
||||||
}
|
}
|
||||||
|
@ -83,8 +83,8 @@ function alltests() {
|
|||||||
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
|
||||||
notify.warning "${NOTE}${pck##*/}${NORM}"
|
notify.warning "${NORM}${pck##*/} --> ${f/./}"
|
||||||
notify.note "${f/./}\nRPATH: $rpath"
|
notify.note "RPATH: $rpath"
|
||||||
let "total_issues += 1"
|
let "total_issues += 1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -99,12 +99,9 @@ function alltests() {
|
|||||||
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
|
||||||
# find setuid binaries
|
for f in $(find -mindepth 2 -perm +111 -type f 2>/dev/null); do
|
||||||
# NOTE: find output is different for normal and root users
|
if [[ "$(LC_ALL=C file $f | grep " setuid ")" ]]; then
|
||||||
for f in $(find -mindepth 2 -perm +111 -type f); do
|
notify.warning "${NORM}${pck##*/} --> ${f/./}"
|
||||||
if [[ "$(file $f | grep " setuid ")" ]]; then
|
|
||||||
notify.warning "${NOTE}${pck##*/}${NORM}"
|
|
||||||
notify.note "${NOTE}${f/./}${NORM}"
|
|
||||||
let "total_issues += 1"
|
let "total_issues += 1"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -118,9 +115,8 @@ function alltests() {
|
|||||||
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
|
||||||
# find setuid directories
|
|
||||||
for d in $(find -mindepth 2 -perm -2000 -type d 2>/dev/null); do
|
for d in $(find -mindepth 2 -perm -2000 -type d 2>/dev/null); do
|
||||||
notify.warning "${NORM}${pck##*/} --> ${NOTE}${d/./}${NORM}"
|
notify.warning "${NORM}${pck##*/} --> ${d/./}"
|
||||||
let "total_issues += 1"
|
let "total_issues += 1"
|
||||||
done
|
done
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
@ -169,6 +165,6 @@ ${NOTE}"$"Hint for perl scripts"":${NORM}
|
|||||||
-----------------------------"
|
-----------------------------"
|
||||||
|
|
||||||
notify.note "\
|
notify.note "\
|
||||||
--> ${NOTE}"$"Security checks: \
|
--> ${NOTE}"$"Security checks: ${#rpmpkg_name[@]} \
|
||||||
${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s).""${NORM}"
|
package(s) checked: ${WARN}$total_issues${NOTE} warning(s).""${NORM}"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user