From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=R1RStMVV; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 6E90A5A0777 for ; Mon, 24 Feb 2025 03:05:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1740362746; bh=scfPUoK82pkhTeDJWRPkDezEEn2WhNLHbUMiJHKs8LU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R1RStMVVtrNh3lvL3fgnJ8B4asFePz8ggHA5WlWAASH9xjAOrJIa7aE7eD412uuOX 6OUkN+RS3mjq8Fw/wcwoQu0ce1evXbxrH7rMEZ8HLn10dtouwC965kxA6zXDmaCth7 2JpptzMlXWaVVcHB1Q0J0nbJBqq3wCbRTltUOP4izZ8Uf3sa9vgIjWrj4hjN6mHP8r ziVZpxSpkFNFilq/C5RtEpyeDqMa9ZTIejtO/tw3O1MmNPKhgwbjInH9x3rdxoBjWh pdxK0FhUfDG0AFLZSmV6wZL7TT/O8ZUxsMvlwrPIIfyrxMiSc+VVqxzonmKNIFdG02 uSOWJ0k3QvpSw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Z1PGL2M1yz4wb0; Mon, 24 Feb 2025 13:05:46 +1100 (AEDT) Date: Mon, 24 Feb 2025 13:05:40 +1100 From: David Gibson To: Michal Privoznik Subject: Re: [PATCH] seccomp.sh: Silence stty errors Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x8UKGSbk65Cy6KRw" Content-Disposition: inline In-Reply-To: Message-ID-Hash: KCFC6GUWNCMZJCEM6QLISPXYEFSUIFDL X-Message-ID-Hash: KCFC6GUWNCMZJCEM6QLISPXYEFSUIFDL X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, sbrivio@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --x8UKGSbk65Cy6KRw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 21, 2025 at 12:53:13PM +0100, Michal Privoznik wrote: > 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: >=20 > stty: 'standard input': Inappropriate ioctl for device >=20 > Redirect stty's stderr to /dev/null to silence it. >=20 > Fixes: 712ca3235329b049bf9a4e481ba38a4c64768e8b > Signed-off-by: Michal Privoznik Reviewed-by: David Gibson Although, I also wonder if we'd do just as well to use the shell provided $COLUMNS variable without poking at the terminal ourselves. > --- >=20 > I've noticed the error when running emerge on my local system, but then > also found it on a recent koji build: >=20 > https://kojipkgs.fedoraproject.org//packages/passt/0%5E20250217.ga1e48a0/= 2.fc41/data/logs/x86_64/build.log >=20 > seccomp.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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=3D"${__calls} ${EXTRA_SYSCALLS:-}" > __calls=3D"$(filter ${__calls})" > =20 > - cols=3D"$(stty -a | sed -n 's/.*columns \([0-9]*\).*/\1/p' || :)" 2>/de= v/null > + cols=3D"$(stty -a 2>/dev/null | sed -n 's/.*columns \([0-9]*\).*/\1/p' = || :)" 2>/dev/null > case $cols in [0-9]*) col_args=3D"-w ${cols}";; *) col_args=3D"";; esac > echo "seccomp profile ${__p} allows: ${__calls}" | tr '\n' ' ' | fmt -t= ${col_args} > =20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --x8UKGSbk65Cy6KRw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAme70/MACgkQzQJF27ox 2GcIKA/+PQ+KNSOaKa1ctntCyFPZvWcn5gyditK1N1FMex3xVm4P0n97KeiaEc69 5p0UY77r/x0dFlZKjD3gdRozRF4tLAQ/3riMvXRloEo4CkXrJWlqucp3DD97Di4j g1r7MjsGlFSh2BOqZwKGB5FbixtkxVm8Oej6A8phC11exKabMCuZW4Wd0jBvektl WBRtdEZ9MDNgpOgJIRmgor3SOuxDAVD9fN1pRgLNc8lW1fP++IYVeB3gP1JKn3oQ k2uv2PqIAkJAbMJDiUAN0cZghPb3h3mH9oE0lJX17jD9+Gwo7EX/A1I9KLSnGDZ4 4kL6AGY45yHzsNbXsGY8DZktJx87NX0B1Di4+I0tLptCBQhV8UaToRyRQrZAADyR QLRKg0/sKMOxzU99qoO6Miz86uiczLVNm4y6tNNbPjPkSzIBy8bDbiqg1wrYGvps W4/FfgCK6wKfpeCGh8FkUExF7MVzRFIMHafi9yPBXTpcpVAvLNWgoY9aGdFqCdff PIIdt0NVbaiDufMLrvP/pZO2YuwU+eadedbmZv7qrLUbvxTgRIWbQqbKz9qIdETK 7iqaxqzRwX2XZx9GnPgzO+OrI/Q099fL+81J2x+mHCcN1gXxxDConGBdUQAn6Noe 2huJxjIA2ihE0kAJnlodBNCb7imAuMjfaXjORbG5eQXa532ObFE= =kcv4 -----END PGP SIGNATURE----- --x8UKGSbk65Cy6KRw--