From patchwork Thu Mar 20 20:54:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40524 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EA9B527BBEA; Thu, 20 Mar 2025 20:58:04 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 75CCE27BBE9 for ; Thu, 20 Mar 2025 20:58:04 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tvMx4-0002c1-NO; Thu, 20 Mar 2025 16:57:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tvMwx-0002Ya-4N for guix-patches@gnu.org; Thu, 20 Mar 2025 16:57:13 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tvMwv-0001Yb-QQ for guix-patches@gnu.org; Thu, 20 Mar 2025 16:57:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=fUCaHHG/eO75rZDRlbk9XFL7p37y9SICE8zVkSS6pAE=; b=j1OjRn0VTUvAR/bTXQEFZtc3oYjfKAzIcaasBjTHuvi4X0u/o2Y+hazuBArhQvYn2ygPRaxXCSXzNnJRT4Sc0QvfUd+qXVFyeV9x9fBgqY5LPux8l5eb5sdtEqTfgivV367wz07haaKxymXd8eZ/UnHy/KwDZaWmhj8bfDw3rt1hycrR4Dhr3vRMsW35x6wLrEJs5fehlNY89vwQVzJYCpfFGBNuEEq2y4XEEpsQXluqJJQFOl8Rur0my8cIjqj6M7ul5S3AmXz0OdTlWxFssWohPSMcbyfLAUnaJ16yKh2sRaEWQY9hbdmXZ3aY1TjeS3KZ5HIVNYnYe2KbMbeXEw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tvMwv-0006Z3-J1 for guix-patches@gnu.org; Thu, 20 Mar 2025 16:57:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#75810] [PATCH v7 02/16] daemon: Close the read end of the logging pipe. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Mar 2025 20:57:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75810 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75810@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Reepca Russelstein Received: via spool by 75810-submit@debbugs.gnu.org id=B75810.174250420625043 (code B ref 75810); Thu, 20 Mar 2025 20:57:09 +0000 Received: (at 75810) by debbugs.gnu.org; 20 Mar 2025 20:56:46 +0000 Received: from localhost ([127.0.0.1]:59180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tvMwU-0006Vb-PZ for submit@debbugs.gnu.org; Thu, 20 Mar 2025 16:56:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41198) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tvMw8-0006R1-6D for 75810@debbugs.gnu.org; Thu, 20 Mar 2025 16:56:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tvMvw-0001Fi-Ow; Thu, 20 Mar 2025 16:56:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=fUCaHHG/eO75rZDRlbk9XFL7p37y9SICE8zVkSS6pAE=; b=XrWbV6giYPefhWhQYU4Y P6QWwFyqa5wg550QX5PzyQ48dVcVFy81VtGPI6PHBCNpdJWrAQVTP6wY0P1dh4qBkn0X0chwsxE0S TDCPtVMQ89PeFRb3QoUZQRIL3JbhJQwZtOw2q5OM1XIc9qkY85JCQQA6yZnQrzvtJlj77mmgqrYV6 NAW8slx9BqjdP1UQSFvEV09PqCZe2q0ez1MOu2h29e60BAYR6JZocR8CsWZWDcuusjDwZOgniIRoA Ubez7VghHqVA7x0POktfr1Vn9Ye+psrZ0V/CvPnwnIZcPm1UTOEb/IVYyp/jbpoEoRSGKMhzKhIqk 5QkYcTRCPhQUyw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 20 Mar 2025 21:54:35 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * nix/libutil/util.cc (commonChildInit): Close ‘logPipe.readSide’. Reported-by: Reepca Russelstein Change-Id: Ia9e48d1afb85d7af52770e016f2b6832792044dd --- nix/libutil/util.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc index eb2d16e1cc..56f116046c 100644 --- a/nix/libutil/util.cc +++ b/nix/libutil/util.cc @@ -1279,6 +1279,9 @@ void commonChildInit(Pipe & logPipe) if (setsid() == -1) throw SysError(format("creating a new session")); + /* Close the read end so only the parent holds a reference to it. */ + logPipe.readSide.close(); + /* Dup the write side of the logger pipe into stderr. */ if (dup2(logPipe.writeSide, STDERR_FILENO) == -1) throw SysError("cannot pipe standard error into log file");