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:
|
||||
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
|
||||
|
@ -103,5 +103,5 @@ msgstr "ricerca di pacchetti con errato tag BuildArch"
|
||||
msgid "this package should be tagged \\`noarch'"
|
||||
msgstr "questo pacchetto dovrebbe essere di tipo \\`noarch'"
|
||||
|
||||
msgid "Quality checks: ${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s)."
|
||||
msgstr "Controlli di qualità: pacchetti controllati: ${#rpmpkg_name[@]}; problemi riscontrati: $total_issues"
|
||||
msgid "Quality checks: ${#rpmpkg_name[@]} package(s) checked: ${WARN}$total_issues${NOTE} warning(s)."
|
||||
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"
|
||||
msgstr "Suggerimento per script perl"
|
||||
|
||||
msgid "Security checks: ${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s)."
|
||||
msgstr "Ccntrolli di sicurezza: pacchetti controllati: ${#rpmpkg_name[@]}; problemi riscontrati: $total_issues"
|
||||
msgid "Security checks: ${#rpmpkg_name[@]} package(s) checked: ${WARN}$total_issues${NOTE} warning(s)."
|
||||
msgstr "Controlli di sicurezza: pacchetti rpm: ${#rpmpkg_name[@]}; problemi riscontrati: ${WARN}$total_issues${NOTE}"
|
||||
|
@ -373,6 +373,6 @@ BuildArch: noarch
|
||||
fi
|
||||
|
||||
notify.note "\
|
||||
--> ${NOTE}"$"Quality checks: \
|
||||
${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s).""${NORM}"
|
||||
--> ${NOTE}"$"Quality checks: ${#rpmpkg_name[@]} \
|
||||
package(s) checked: ${WARN}$total_issues${NOTE} warning(s).""${NORM}"
|
||||
}
|
||||
|
@ -83,8 +83,8 @@ function alltests() {
|
||||
if [[ "$(file $f | grep " ELF ")" ]]; then
|
||||
rpath="$(security.filecheckrpath $f)"
|
||||
if [ "$rpath" ]; then
|
||||
notify.warning "${NOTE}${pck##*/}${NORM}"
|
||||
notify.note "${f/./}\nRPATH: $rpath"
|
||||
notify.warning "${NORM}${pck##*/} --> ${f/./}"
|
||||
notify.note "RPATH: $rpath"
|
||||
let "total_issues += 1"
|
||||
fi
|
||||
fi
|
||||
@ -99,12 +99,9 @@ function alltests() {
|
||||
let "i = 0"
|
||||
for pck in ${rpmpkg_name[@]}; do
|
||||
pushd $tmpextractdir/$i >/dev/null
|
||||
# find setuid binaries
|
||||
# NOTE: find output is different for normal and root users
|
||||
for f in $(find -mindepth 2 -perm +111 -type f); do
|
||||
if [[ "$(file $f | grep " setuid ")" ]]; then
|
||||
notify.warning "${NOTE}${pck##*/}${NORM}"
|
||||
notify.note "${NOTE}${f/./}${NORM}"
|
||||
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"
|
||||
fi
|
||||
done
|
||||
@ -118,9 +115,8 @@ function alltests() {
|
||||
let "i = 0"
|
||||
for pck in ${rpmpkg_name[@]}; do
|
||||
pushd $tmpextractdir/$i >/dev/null
|
||||
# find setuid directories
|
||||
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"
|
||||
done
|
||||
popd >/dev/null
|
||||
@ -169,6 +165,6 @@ ${NOTE}"$"Hint for perl scripts"":${NORM}
|
||||
-----------------------------"
|
||||
|
||||
notify.note "\
|
||||
--> ${NOTE}"$"Security checks: \
|
||||
${#rpmpkg_name[@]} package(s) checked: $total_issues warning(s).""${NORM}"
|
||||
--> ${NOTE}"$"Security checks: ${#rpmpkg_name[@]} \
|
||||
package(s) checked: ${WARN}$total_issues${NOTE} warning(s).""${NORM}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user