From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id tJ+JG3tKrGGb2AAAgWs5BA (envelope-from ) for ; Sun, 05 Dec 2021 06:13:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4ICSFntKrGHDEgAAB5/wlQ (envelope-from ) for ; Sun, 05 Dec 2021 05:13:31 +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 019F911954 for ; Sun, 5 Dec 2021 06:13:31 +0100 (CET) Received: from localhost ([::1]:39008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtjq6-0001md-5O for larch@yhetil.org; Sun, 05 Dec 2021 00:13:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtjpl-0001mU-Ig for help-guix@gnu.org; Sun, 05 Dec 2021 00:13:09 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:56767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtjpg-0005dD-5G for help-guix@gnu.org; Sun, 05 Dec 2021 00:13:05 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 773C53200786; Sun, 5 Dec 2021 00:13:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 05 Dec 2021 00:13:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=mesmtp; bh=VxVzOLCc/nzBPexLyuAriR1I 7T+lgTIWXCmMtLYrTBA=; b=Rzu6aqmyKnVpJQMOas2uvVZZgmQBdjKeOiAUTiU9 MNhrwBb0DiKRo0yIS5n+ewIQjTsp/ZG+txNBtePk5KOJw/4iIBefvsxfcqIbF/+i DoGGJL+Gsmjd/H8q7ciNUszjUAo0w3qh3FpxoH5vSoRntuxO3GcFHU6tGoGrXyoZ NAA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=VxVzOL Cc/nzBPexLyuAriR1I7T+lgTIWXCmMtLYrTBA=; b=gbthyrPvtmOSAJeZzVxv3H oAGyZeRvKuEBGlnrkuIK1DhQuT9CXQJXbCJi/MysN7bKwburcksH7MRX8l3MaG5N dI3hl1aTyDA3dHspx6XptLf+JfGgauFD8OjpZ9eqkcT6aceH5u8t3Qt0u9aUsyXH ycORCFX54MBV1NXnBfcpl1DkohWDTSwzgb5hOtiL8veMFkdFpr69/kXMf+UW6fB8 EYhIkCMMntCJRLEGXgPa+IM8FxNekriZjsoH4QnQDCmPnBl4wIj2o1tBVEJBcyh+ glU5yse8UGo6rGmu+SNr7ysIUrXBFNZoR9QeYRBRJyKi5mMeBVij8U4ZbUjER8UA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjedtgdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepnfgvohcuhfgr mhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecuggftrfgrthhtvg hrnhepvddvudegffefiedttdfhfedvuefhgfekieekgeekveetgefhfeetgfegueduffei necuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Dec 2021 00:13:00 -0500 (EST) Date: Sun, 5 Dec 2021 00:12:58 -0500 From: Leo Famulari To: Nathan Dehnel Subject: Re: How to put a file in /gnu/store and set its permissions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.21; envelope-from=leo@famulari.name; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638681211; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VxVzOLCc/nzBPexLyuAriR1I7T+lgTIWXCmMtLYrTBA=; b=aY69z2pdFfolZ8hdWLvCC8n4zcQc+kgfHdGVoOSVUKaEJnPq7AVaWC4QIUMFQQlVVZZl2H xhAvgico0R7w9PbCkOQjMELAejY2uipOOx2qtuwfGXCw1Jq3OPeaVGcdYUpq3MYLY8uBjC bVaCeqrMyzKP3Ad9USyCmdp6VdRh/9dHEKVvIN2rnzRCkna0SXbm1eDITHFnT0yyJeUpzg 4iiFbLO7YzRiywzkJaeSLWxsBy0fJL8o0DOQFERlEQJ8ya+huxJs+b/usHz+PSYYWrFIyJ 0C0oTleQCxXzvmn8SC3E2pNUkvgRDF5Ix/GyyMRdwH6lSvb+NacI21l1XO97GQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638681211; a=rsa-sha256; cv=none; b=fg5+URCvt9feZVrFGKmD3+/glTI1auv4XR/Dp7bWb/gYL03diJ4LdxC5rXXLbhl9eukqWW 6C2lSJ8qHCK0wxsdqX5uHp0aD/9kqGOSXP5WnHh6XQRfO/1mFRKMAIMRZewjsALnpQbWIX /4Ch7QOKxlix0B0U0skhB+7C3daSaTpxb9Ll/YFwjxq9nnM2kTQmUbZ91lzlQ044U1uOx6 ECiQ8mRs97fWnUunwNWiDL5vJqyxoFDJc9Vr+p5AluJiiykYrmHqjV0gpysjKlJBREgji7 Qzh6+nndBCewllmyweIUDNJM1b9QCpXAXm9Gz1sYGWXBGx1iq4s7bA62j2/laQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=famulari.name header.s=mesmtp header.b=Rzu6aqmy; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=gbthyrPv; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=famulari.name header.s=mesmtp header.b=Rzu6aqmy; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=gbthyrPv; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 019F911954 X-Spam-Score: -4.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZkFxcKJsiDRf On Sat, Dec 04, 2021 at 04:47:12PM -0600, Nathan Dehnel wrote: > https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html > This says to set #:recursive? #t and guix will preserve its > permissions in the store. I have done this: > > (define guixrig_host_rsa_key > (local-file "ssh/guixrig_host_rsa_key" #:recursive? #t)) > > The file this expression puts in the store has permissions of 444, > despite the original being 400. How do I prevent guix from changing > permissions, or manually override them? In general, the store cannot be used to store secrets. By design, everything in the store is made world-readable despite what permissions are set, for example in a package definition. I'm not sure if that's documented in the manual; I don't see it in the manual section The Store [1]. I'm not sure exactly what code ensures that everything in the store is readable, but it's probably somewhere in the daemon [0], which is what writes to the store [1]. The question of how to handle secrets in Guix has been discussed many times over the years and there are some solutions in various services; maybe there is a canonical solution now. But basically the idea is to store the secret outside of the store, like in /etc, as defined in a service configuration in config.scm. Hopefully some other people can join the conversation with more specific advice. [0] https://git.savannah.gnu.org/cgit/guix.git/tree/nix?h=v1.3.0 [1] I'd guess that canonicaliseTimestampAndPermissions is always called: https://guix.gnu.org/manual/en/html_node/The-Store.html