aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2025-02-21 12:53:13 +0100
committerStefano Brivio <sbrivio@redhat.com>2025-02-24 18:46:28 +0100
commitbe86232f72dcfbd51a889206e80d587fbcaa1c5b (patch)
treefe9d33e826d3c44b118130b7375432f34548594a
parentea69ca6a20ac7408a913fd5de383a5383d679678 (diff)
downloadpasst-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar.gz
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar.bz2
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar.lz
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar.xz
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.tar.zst
passt-be86232f72dcfbd51a889206e80d587fbcaa1c5b.zip
seccomp.sh: Silence stty errors
When printing list of allowed syscalls the width of terminal is obtained for nicer output (see commit below). The width is obtained by running 'stty'. While this works when building from a console, it doesn't work during rpmbuild/emerge/.. as stdout is usually not a console but a logfile and stdin is usually /dev/null or something. This results in stty reporting errors like this: stty: 'standard input': Inappropriate ioctl for device Redirect stty's stderr to /dev/null to silence it. Fixes: 712ca3235329 ("seccomp.sh: Try to account for terminal width while formatting list of system calls") Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-xseccomp.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/seccomp.sh b/seccomp.sh
index 4c521ae..a7bc417 100755
--- a/seccomp.sh
+++ b/seccomp.sh
@@ -255,7 +255,7 @@ for __p in ${__profiles}; do
__calls="${__calls} ${EXTRA_SYSCALLS:-}"
__calls="$(filter ${__calls})"
- cols="$(stty -a | sed -n 's/.*columns \([0-9]*\).*/\1/p' || :)" 2>/dev/null
+ cols="$(stty -a 2>/dev/null | sed -n 's/.*columns \([0-9]*\).*/\1/p' || :)" 2>/dev/null
case $cols in [0-9]*) col_args="-w ${cols}";; *) col_args="";; esac
echo "seccomp profile ${__p} allows: ${__calls}" | tr '\n' ' ' | fmt -t ${col_args}