From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 9AFED5A026D for ; Thu, 13 Apr 2023 19:47:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681408037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rhBGD8T2cWCLlaCRSpH7Y/r7pJPzCeKTsix33NYxxdk=; b=XxqhP40VvuFPquJm9v6WjmmBoVvW7Z5PfVvk9NjBsG3gFeKq79cSmz77hADlY2NPhcp+KZ MlBFnak5fE3is0+kiOMU6ggHQqVLuUKXpNdrBYalQg6d+3CVqDzkRNK51apywRP39q/zC6 xtTzGK969OENc98APe8Y1uoqU1A5HBo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-VYA2MiL1OQiT--AqUaaICg-1; Thu, 13 Apr 2023 13:47:13 -0400 X-MC-Unique: VYA2MiL1OQiT--AqUaaICg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 811EF85A588; Thu, 13 Apr 2023 17:47:13 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 628371121320; Thu, 13 Apr 2023 17:47:13 +0000 (UTC) Date: Thu, 13 Apr 2023 19:46:57 +0200 From: Stefano Brivio To: Valtteri Vuorikoski Subject: Re: passt.c: incorrect signal() return value check Message-ID: <20230413194657.75e1978b@elisabeth> In-Reply-To: References: <20230413132505.2b0c8e52@elisabeth> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4R2VLZH2UBL7PKTKC52VJ6ANMP4OICF7 X-Message-ID-Hash: 4R2VLZH2UBL7PKTKC52VJ6ANMP4OICF7 X-MailFrom: sbrivio@redhat.com 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, 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: On Thu, 13 Apr 2023 17:47:27 +0300 Valtteri Vuorikoski wrote: > 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. Oh, I didn't know it would be so specific. I'm not sure then -- your call. > > 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. Sure, patch posted. -- Stefano