From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wMMcNyxLfGEOfAAAgWs5BA (envelope-from ) for ; Fri, 29 Oct 2021 21:27:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GGi2MixLfGGNXgAA1q6Kng (envelope-from ) for ; Fri, 29 Oct 2021 19:27:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6D625B7BB for ; Fri, 29 Oct 2021 21:27:40 +0200 (CEST) Received: from localhost ([::1]:37456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgXXP-0001fq-Hd for larch@yhetil.org; Fri, 29 Oct 2021 15:27:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgXII-0008Or-SX for bug-guix@gnu.org; Fri, 29 Oct 2021 15:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgXIH-0008Ft-SD for bug-guix@gnu.org; Fri, 29 Oct 2021 15:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgXIH-0008Bt-OI for bug-guix@gnu.org; Fri, 29 Oct 2021 15:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#51442: Non-default umask when using guix system leads to wrong file permissions Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 29 Oct 2021 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51442 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Josselin Poiret Received: via spool by 51442-submit@debbugs.gnu.org id=B51442.163553466231384 (code B ref 51442); Fri, 29 Oct 2021 19:12:01 +0000 Received: (at 51442) by debbugs.gnu.org; 29 Oct 2021 19:11:02 +0000 Received: from localhost ([127.0.0.1]:55946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgXHJ-0008A3-Md for submit@debbugs.gnu.org; Fri, 29 Oct 2021 15:11:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgXHI-00089S-Qb for 51442@debbugs.gnu.org; Fri, 29 Oct 2021 15:11:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgXHC-0006zW-UY; Fri, 29 Oct 2021 15:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=HmermBwLpuIqTt06coZh5q3gGA90iL0GYwOpIyDFgow=; b=AjCCgw8o8eB+6AzmCxTn T6HtRatkA5hk9gBJKCIWze2dxj9VzEK24HBoDn4EzFD0DMReAfA1YiHSqMcdLkC2ick+M2BoXER2e 9pLhXg3HQMifyuaqQqHkALw7TWbVVKGwcIF7AQgAmBKyOHfKFqu4XQ21YlLivppQqfNo+yoJYOWcq 5y2vUBaMvlyWCF+A6gXfgyYF7cVElogDogItsC2CanfwD4xIx2mcWT2W8FRU8pQbQZVq/qGbs6ONp l5loia08zLlg0Xo/n7MbiyFXnW7jV9dYiNM5feeDs6hK0p4+ex5Kve73MCTuroHQrJ4NJJVheWfBL Scg6k18fTkttBw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54876 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgXHC-0008HR-I0; Fri, 29 Oct 2021 15:10:54 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87wnlya3tn.fsf@jpoiret.xyz> Date: Fri, 29 Oct 2021 21:10:52 +0200 In-Reply-To: <87wnlya3tn.fsf@jpoiret.xyz> (Josselin Poiret's message of "Wed, 27 Oct 2021 15:24:20 +0000") Message-ID: <87k0hvy7cz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 51442@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635535660; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=HmermBwLpuIqTt06coZh5q3gGA90iL0GYwOpIyDFgow=; b=Z45BgjncfzSrT+dLOtqW36KNySv2Nj/4RnjlKMkr/VCaPZj2HVW/95FCGbRmKCWfgAQX0y Y0ZcPTO3eh81DR166OSMWruVuLdRMNcG4a/VbtZyHl2nv0aEZSYbDQwzjs2o71PMk4vvFu U9VXOve24nL2PcsGTPXih0/SJgc8sggtnQRyHp81KsTYiXEvQqGCmSqscBiOu7WXVo/gIV Tog4+KKLgkCmu6/5RZBNC8HQHKBzZ2wbVSxvNkdU1nYiCmm1PEb3XSO/YkxJHxjzR5Tf37 Ab7w/b6/qEgbpsDS5Kw2haj1qj7hIZKE9RbJJ11736vKQkA8A8XoknBzFe0Tdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635535660; a=rsa-sha256; cv=none; b=etHF/rEsw5OV7KnwANqZBUixNgp9nMYVxaulMb/5xneTy35Ulb3+7bpCHmIUGhXunFagrl zxnA5KeUaTLKtg6b9ZnJSDjHzkO8HbIfUql27rcFmsKYcpTLiIAgYLh4lKzm5LuuFr5XEp eoG3Y7DYZknjQ5eRlTlPxpMSXkOmtVXRiEPHv91byFc3gu3wpCQYCEzBkFrAD2YkPMaRpr 8P9/3eaz3EqvFJlr5HvJU9UqUFWmxoDaHt9Fh4L88Qnn6n49etS4GwXZiad2qFhqplmKSI VKba/wcW1LSKMMP27VDFfOzlpiqesFT3p3DljoPky7r2vJzJbsVTCVSccjNW+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AjCCgw8o; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AjCCgw8o; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 6D625B7BB X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZThFizdO46T3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Josselin Poiret skribis: > As reported on IRC by wonko > (https://logs.guix.gnu.org/guix/2021-10-27.log#115445), wonko mentions files in /etc (those are created by the activation snippets). > when running =E2=80=98guix system=E2=80=99 under a different umask, some = files are > created with the wrong permissions. This can happen because =E2=80=98sud= o=E2=80=99 > does by default keeps the umask it is running on (by ORing it with the > default one, often 022). > > I'm not sure what would be the best way to go about this, I suggest > checking if umask =3D=3D #o022, and if not, print a warning and set it to > #o022, and only in =E2=80=98guix system=E2=80=99. Perhaps the best fix would be to set the umask explicitly before activation snippets run, like so (untested): --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services.scm b/gnu/services.scm index 1655218f2d..b79436d3f3 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -617,6 +617,10 @@ (define actions (use-modules (gnu build activation) (guix build utils)) + ;; Set the correct umask so files are created with the + ;; expected permissions. + (umask #o022) + ;; Make sure the user accounting database exists. If it ;; does not exist, 'setutxent' does not create it and ;; thus there is no accounting at all. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable WDYT? Thanks, Ludo=E2=80=99. --=-=-=--