From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 28 12:25:08 2021 Received: (at 52835) by debbugs.gnu.org; 28 Dec 2021 17:25:08 +0000 Received: from localhost ([127.0.0.1]:47324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2GDk-0003c0-HW for submit@debbugs.gnu.org; Tue, 28 Dec 2021 12:25:08 -0500 Received: from jpoiret.xyz ([206.189.101.64]:41796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2GDi-0003bp-Uu for 52835@debbugs.gnu.org; Tue, 28 Dec 2021 12:25:07 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id B7A51184CCF; Tue, 28 Dec 2021 17:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1640712305; 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=g38hw+70E2/b7MCh5o9fyLFdhX8ue4AGYsqBWCz6rmE=; b=hccswQshMGiCzSlQmHZP8bXyt97J2alkR9ST2Rdm6EB8LwnKtjWt9jHheUOMVADmVLgkT4 nBgi81DwuVgHGDE60svg/oO36D6l/u8Zbp2d/8zlnccjc2PxffBKYx0cAO/PzEVOvrhfVp 3TOSfGZ5bshbvBKxzNsKn4xbpIKwxKWcH45N+QpzFKxuberIztWnr9EByFdSfP7+NRpd65 YCF8UMkL3joAuTRYTrafzC+oZ6PLRo8XDUeN9l9oSlCTZRsqyku43Jo+9JtLvfWebGtU7B aV4CbozRjQg0mxrV8QGcJrlryfJ1I+xFYuJ7Vpe6woaKBZsef4uHbSahCMfqiA== From: Josselin Poiret To: Timothy Sample Subject: Re: bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly In-Reply-To: <8735mcu4a5.fsf@ngyro.com> References: <8735mcu4a5.fsf@ngyro.com> Date: Tue, 28 Dec 2021 18:25:03 +0100 Message-ID: <87lf04fxqo.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Timothy, Timothy Sample writes: > One thing that ‘renumber_file_descriptor’ does that we seem to be losing > here is error checking. To my eye, the old code will try and warn the > user if they run out of file descriptors, but t [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 52835 Cc: 52835@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Timothy, Timothy Sample writes: > One thing that ‘renumber_file_descriptor’ does that we seem to be losing > here is error checking. To my eye, the old code will try and warn the > user if they run out of file descriptors, but t [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hello Timothy, Timothy Sample writes: > One thing that =E2=80=98renumber_file_descriptor=E2=80=99 does that we se= em to be losing > here is error checking. To my eye, the old code will try and warn the > user if they run out of file descriptors, but the new code will not. I may have been too hasty on that front, you're right that we should check for errors when dup'ing. Note though that we should not run out of fds, as we close all of them except for in/out/err right before using it, but still, here are the interesting error codes: * EINTR, although OpenBSD and Linux will never set that error from my light research; * EBUSY, not POSIX though, only Linux, so should we? * EMFILE, if we run out of fds; * EBADF if either of the fds are invalid. As for error reporting, should we keep the parent's stderr fd open while we do all of this, just to be able to report an error in case it happens? The old code used to try reporting the errors to the new `err` fd instead, but it might be clearer to use stderr. WDYT? --=20 Josselin Poiret