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=202606 header.b=lB5U++1F; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 58B7E5A026E for ; Tue, 14 Jul 2026 11:29:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1784021369; bh=P6KLk+ep9aBClgp5qigVqKjxlv4U267TKTi9eUxrbuw=; h=From:To:Cc:Subject:Date:From; b=lB5U++1Fy0OUJTXMdmAVjYnAnDs5X+RVZlqP5NwFLOijURAN/stuD/Tzy2fsbpmu8 eb/NRlL5MI1xGYqM2Wt3QLpeT8slV2G4VrdDjB6oCH82OfwP5Teo85oVue6n+2FPjx xUvwBXgezJ8rCjDN96Q/D4oSl4aQsmWGTyh/IHzwIiNrN5wBtn1eKmNw3/4oKHW7MI /CdZ+go2/dU20f0pamhbRvQcj4d6GFYFxYWdtvILIQm/uNgaPWIApE5g32ciGsMFA0 36c5UBEf8rOqwil5CO03jBTCFVal+7ElzQD5KC2SxUDi9iCQvozzHFzxm8MofguisF GC+5Vq+rEuFjQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gzvCF67P3z4w91; Tue, 14 Jul 2026 19:29:29 +1000 (AEST) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/6] Fix bug 215 and some related issues with fd handling Date: Tue, 14 Jul 2026 19:29:20 +1000 Message-ID: <20260714092926.2881848-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.55.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 7NAFFHDIS7ILANKM4WX4Q73NV6WYO4JU X-Message-ID-Hash: 7NAFFHDIS7ILANKM4WX4Q73NV6WYO4JU 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: 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: Stefano, you called it correctly. While working on bug 215, as usual, I found a bunch of adjacent things to clean up. I did start by attempting the appoach you suggested for bug 215 - remembering which of the low fds were standard streams and avoiding closing them in __daemon(). It is indeed shorter, but only by 1-2 lines. Looking at possible interactions with other things, I became more and more convinced that leaving anything other than the standard streams in fds 0-2 was an accident waiting to happen. Much of the rest of the series is, for example, dealing with the possibility of --fd [012]. David Gibson (6): isolation, util: Fold close_open_files() into isolate_initial() isolation, conf: Set c->fd_tap from eary parse of --fd conf: Make conf_tap_fd() operate more like conf_mode() isolation: Move --fd descriptor to a number of our choosing main: Ensure fds 0-2 are populated passt: *Always* close pidfile_fd, not just when daemonizing conf.c | 31 +++++++++++++++++++++++-------- conf.h | 2 +- isolation.c | 32 ++++++++++++++++++++++++++++++-- isolation.h | 2 +- passt.c | 27 +++++++++++++++++---------- util.c | 52 +--------------------------------------------------- util.h | 1 - 7 files changed, 73 insertions(+), 74 deletions(-) -- 2.55.0