From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from jkusti.notcom.org (jkusti.notcom.org [118.27.113.153]) by passt.top (Postfix) with ESMTPS id 6D74D5A026D for ; Thu, 13 Apr 2023 16:47:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=notcom.org; s=jk; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JTlD6XL6Y4M8g0uQuA2ibFNI8geWH7sSLsku6qSA8jQ=; t=1681397257; x=1682261257; b=c+O59PDuHyurKstzP8K/6+fgUcgonlaN/rbOExfy2i0EpEAvrlp8rJ6yqtUzZhvux6lTyQUnd16 uySphoALTViXW+JxB/R59AY9KqpkpbvGHJ/qV6z5ghTcNtPXMiQFnGYBlw24PbC8R59cFUISamgnn v0CzjpPIzkErPa+tpcoQsb1fvqLhERnAI6WA8fAaihYmDTrNRCEk41kqFJtya8Naic3+rq9LvJzCP SaWj3cxiNTTuJn4zPX9F8NzpT/SygVRPPrA3uf7uh7qdM4mYHggma1AJFLKHSmsiHD01fBk8Bd5Na kgDqwau4lS/5nSg/fAAn4jXR9+Qw7nePpyKg==; Received: from submission.internal (id=9cdceae8c7b5bf2d4c2c643b5341fa4197f0c084) by jkusti.notcom.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.x) (envelope-from ) id 1pmyEU-000Da4-Im; Thu, 13 Apr 2023 14:47:30 +0000 Received: from a10d750d756b015054aa81d63d047a232e64e839 by sendhost.internal with local (Exim 4.x) (envelope-from ) id 1pmyER-003jAL-TE; Thu, 13 Apr 2023 17:47:27 +0300 Date: Thu, 13 Apr 2023 17:47:27 +0300 From: Valtteri Vuorikoski To: Stefano Brivio Subject: Re: passt.c: incorrect signal() return value check Message-ID: References: <20230413132505.2b0c8e52@elisabeth> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230413132505.2b0c8e52@elisabeth> User-Agent: NeoMutt/20230322-43-b46ca7 X-MailFrom: vuori@notcom.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: Q3SJ6USZXIK4TEK4VWTA6UMQ2ILHVVMQ X-Message-ID-Hash: Q3SJ6USZXIK4TEK4VWTA6UMQ2ILHVVMQ X-Mailman-Approved-At: Thu, 13 Apr 2023 19:21:40 +0200 CC: passt-dev@passt.top, David Gibson 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: Hi, thanks for the fast reply. On Thu, Apr 13, 2023 at 01:25:05PM +0200, Stefano Brivio wrote: > > signal() returns SIG_ERR on failure or the previous setting if present. If > > a setting has been inherited from the parent (as is the case when > > starting from systemd with the default setting of IgnoreSIGPIPE=yes), > > the check will fail. > > Right, thanks for reporting this. > > By the way, feel free to share your systemd unit files, I guess we > could add them under contrib/ in case they are useful for somebody. I'll see if I can put together some kind of readable version for a patch. This is a somewhat intricate setup to get a specific constellation of painful legacy services running with 1.x series Podman under systemd, but the "1.x series Podman under systemd" part might be useful to someone I guess. > I guess we could just check SIG_ERR from signal(), it looks a bit > simpler, and perhaps split this into two cases (a failure on signal() > doesn't mean we "[c]ouldn't install signal handlers"). > > Will you post a patch? It's trivial, so if it's unnecessary effort for > you I can also go ahead and do it. If you can just push the "== SIG_ERR" fix please do, my only tree is currently on another machine. -Valtteri