From patchwork Tue Aug 23 17:33:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 41884 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 829FB27BBEA; Tue, 23 Aug 2022 18:35:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 3967727BBE9 for ; Tue, 23 Aug 2022 18:35:38 +0100 (BST) Received: from localhost ([::1]:60004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQXoP-00065b-Cl for patchwork@mira.cbaines.net; Tue, 23 Aug 2022 13:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQXmt-00064D-FT for guix-patches@gnu.org; Tue, 23 Aug 2022 13:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQXms-0004eM-H9 for guix-patches@gnu.org; Tue, 23 Aug 2022 13:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQXms-0003Mb-9N for guix-patches@gnu.org; Tue, 23 Aug 2022 13:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57363] [PATCH] shepherd: Set #o640 permissions for log file of service in container. References: <20220823173102.30242-1-arunisaac@systemreboot.net> In-Reply-To: <20220823173102.30242-1-arunisaac@systemreboot.net> Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Aug 2022 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57363 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57363@debbugs.gnu.org Cc: Arun Isaac , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 57363-submit@debbugs.gnu.org id=B57363.166127601312894 (code B ref 57363); Tue, 23 Aug 2022 17:34:02 +0000 Received: (at 57363) by debbugs.gnu.org; 23 Aug 2022 17:33:33 +0000 Received: from localhost ([127.0.0.1]:44994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQXmP-0003Lt-Ct for submit@debbugs.gnu.org; Tue, 23 Aug 2022 13:33:33 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:34302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQXmM-0003Lk-FT for 57363@debbugs.gnu.org; Tue, 23 Aug 2022 13:33:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E5yR3q4rby8/ivwzz4+t/jPv/8wFHiVUUtEIt1fvluA=; b=mqkIwbfc48YCyBGlCboTe0TNcO xY1cqKoUzXRlpOSNabRfga2GnBy2NZby5XJRNk6WRt0Wt2JihHwqzr5ay3ihUdeCaMF/aBhM/rgMp KwVWpbG+RrJmV7MWD3TaNLX4w/VWAFfD+nXf/la0zFh5/3MeBrMHVn18KhWvsIddc81pCtbZbI4Ts MSdfOtQbK3eBrcusXGumWkpfucndRVZhCoeptoHQ0M5VG1+ivfAn+aySXS/3lp/h1cnJ9lepX+eEL lUF+xnDAaaXSO38L0eCv3fLuD8ORTq6cBB3y07KLL+VeYNbZHA850XBY8cT6VSinaYz6RoZXZnCeh tiU12ldg==; Received: from [192.168.2.1] (port=53898 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1oQXmJ-0009FM-11; Tue, 23 Aug 2022 23:03:27 +0530 From: Arun Isaac Date: Tue, 23 Aug 2022 23:03:25 +0530 Message-Id: <20220823173325.30877-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.37.1 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" X-getmail-retrieved-from-mailbox: Patches * gnu/build/shepherd.scm (make-forkexec-constructor/container): Set #o640 permissions for log file. --- gnu/build/shepherd.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm index f4caefce3c..c7ba73967f 100644 --- a/gnu/build/shepherd.scm +++ b/gnu/build/shepherd.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017, 2018, 2019, 2020, 2022 Ludovic Courtès ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2022 Leo Nikkilä +;;; Copyright © 2022 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -187,6 +188,7 @@ (define mounts ;; Create LOG-FILE so we can map it in the container. (unless (file-exists? log-file) (call-with-output-file log-file (const #t)) + (chmod log-file #o640) (when user (let ((pw (getpwnam user))) (chown log-file (passwd:uid pw) (passwd:gid pw))))))