checksec: fix formatting issue

This commit is contained in:
Enno Boland 2019-07-24 12:00:13 +02:00
parent e54ba6b0e3
commit 464c53b243
No known key found for this signature in database
GPG key ID: D09964719BDE9971
2 changed files with 51 additions and 1 deletions

View file

@ -0,0 +1,50 @@
--- checksec.orig 2019-07-24 11:58:00.684761937 +0200
+++ checksec 2019-07-24 11:57:40.744760376 +0200
@@ -1568,11 +1568,11 @@ chk_proc_all () {
(( currpid++ ))
name=$(head -1 "${N}"/status | cut -b 7-)
if [[ $format == "cli" ]]; then
- printf "%16s" "${N}ame"
+ printf "%16s" "${name}"
printf "%7d " "${N}"
else
echo_message "" "${N}," " <proc pid='${N}'" " \"${N}\": { "
- echo_message "" "${N}ame," " name='${N}ame'" "\"name\":\"${N}ame\","
+ echo_message "" "${name}," " name='${name}'" "\"name\":\"${name}\","
fi
proccheck "${N}"
if [[ "${lastpid}" == "${currpid}" ]]; then
@@ -1616,11 +1616,11 @@ chk_proc () {
if [[ -d "${N}" ]] ; then
name=$(head -1 "${N}"/status | cut -b 7-)
if [[ $format == "cli" ]]; then
- printf "%16s" "${N}ame"
+ printf "%16s" "${name}"
printf "%7d " "${N}"
else
echo_message "" "${N}," "<proc pid='${N}'" " \"${N}\": {"
- echo_message "" "${N}ame," " name='${N}ame'" "\"name\":\"${N}ame\","
+ echo_message "" "${name}," " name='${name}'" "\"name\":\"${name}\","
fi
if [[ ! -r "${N}/exe" ]] ; then
if ! (root_privs) ; then
@@ -1664,10 +1664,10 @@ chk_proc_libs () {
if [[ -d "${N}" ]] ; then
name=$(head -1 "${N}/status" | cut -b 7-)
if [[ "${format}" == "cli" ]]; then
- printf "%16s" "${N}ame"
+ printf "%16s" "${name}"
printf "%7d " "${N}"
else
- echo_message "" "${N}ame," "<proc name='${N}ame'" "{ \"proc\": { \"name\":\"${N}ame\", "
+ echo_message "" "${name}," "<proc name='${name}'" "{ \"proc\": { \"name\":\"${name}\", "
echo_message "" "${N}," " pid='${N}'" "\"pid\":\"${N}\","
fi
# read permissions?
@@ -1906,4 +1906,4 @@ for variable in CHK_DIR CHK_FILE CHK_FOR
done
# call the function
-${CHK_FUNCTION}
\ No newline at end of file
+${CHK_FUNCTION}

View file

@ -1,7 +1,7 @@
# Template file for 'checksec'
pkgname=checksec
version=2.0.0
revision=1
revision=2
archs=noarch
wrksrc="checksec.sh-${version}"
depends="binutils"