From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MB6eMWJlhmN/SwAAbAwnHQ (envelope-from ) for ; Tue, 29 Nov 2022 21:02:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6H2WMGJlhmPjWQEAG6o9tA (envelope-from ) for ; Tue, 29 Nov 2022 21:02:42 +0100 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 5CDC1A19C for ; Tue, 29 Nov 2022 21:02:42 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p06NK-0004tG-RX; Tue, 29 Nov 2022 14:34:38 -0500 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 1p06NJ-0004rp-2s for help-guix@gnu.org; Tue, 29 Nov 2022 14:34:37 -0500 Received: from lepiller.eu ([2a00:5884:8208::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p06NG-0004Zj-25 for help-guix@gnu.org; Tue, 29 Nov 2022 14:34:36 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id db61b81f; Tue, 29 Nov 2022 19:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=10QRW3bvMigV GaQ+EjQ+8DmmQOnZRhDaB+NjEGQT0y8=; b=AZaxQbSbeJJkSum8R02cv9VlH4Ha cKOy3SvnCbmAtwhrFuZ+bUi4x4SAo9mQ0kXkZdBCKWaPHoXxD69RWBKvE+yFdQf7 9VsYP1eHKRHzCuebFgXfCP42dQ/QwI7HMH/hwD5p+OFvgUOUekyPGFVBMtOIOu58 77XnwaZMcaTxpYuMu9vQ9I0DWjlSgm8zrpc7IVed3dYFMeatxqFVSITmvr3/S3AB D6+/KiAPkp1xTnw/MlTg+q5VpSQlAoEySzYVX0Cm3zaoJcthdKOuD+/LatUJwLrp cKH33Ev0SEiq6iNRhBO7I22kz2hEz90q3kyLXWsNaYzUvtLJicrRcx9Tgw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ca0e639e (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 29 Nov 2022 19:34:23 +0000 (UTC) Date: Tue, 29 Nov 2022 20:34:21 +0100 From: Julien Lepiller To: help-guix@gnu.org, Timo Wilken Subject: Re: How do I install a file with custom permissions? User-Agent: K-9 Mail for Android In-Reply-To: <20221129192413.q75rkyevtrtslyix@timo-pc> References: <20221129192413.q75rkyevtrtslyix@timo-pc> Message-ID: <66FA4764-AAD9-4A40-AA34-73C918B5F3D6@lepiller.eu> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org 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=1669752162; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/YA2Rf6YdkoYqc3ctVuBujSrpyZlhyl/K4GXuJ9fmUM=; b=AGQiBI2CVRCx92i85zffKbhLACJSXGDmqo0sUJ6EcIw3HSdqNW2ZGdd1Fqh26/ka+r2U06 EW7bTqicePNDjj/GiT9r1qKQce/8Qy6/EU/hTCie5D4PQQXt5yJJUCmXm0iC04BovUz/Tr ULu11FniVTXKGnhMM9Ao7A2965MTEZc1YUIeyHhWkBlovzqAG1kWPxrZhZn7gq/PyRnIDq 3nyfrGeC6RDjQJuGx+SNEsJUeb6QuyswGt9mh7vRmf6ol9GDhPY3/B228akRL5Uluji9K0 SfPYRqeXdiu7zQT6Ycrt/yF+nf481xXaqar+TXl6DlVtN8oSXxRia/m02KBr0A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669752162; a=rsa-sha256; cv=none; b=dPZdSUuMVwKAr/wQ8bfKK5S2xQHXfkTOs9+oi3Ou4tR24959/iC3ipIIli/8qvhs5fn35R hsm2YIhH3i69v/oUNwHgSv4YQOY/FdHNtp6CXfHWl3iob9W3pn+3ylXaSfs+X1J1mrvqyF afauHtNmB/M/w10l9CWhdQLP8RoDm868/e7llV6n92RFJkXWF2UYvZ84Xcr52x3cV49iDh qiWN75wq+VuP15ILNsKHUz/opz3eMR4zyTagFh2TiyyfStHiO759GusPWolKUl7A9zegK5 yP4gXBtvsu27VjfGAPhy69PEHRnhi7FF6/HqdkFoIzP9hG23uZz7Zv0YeOmHuA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=AZaxQbSb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=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: 6.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lepiller.eu header.s=dkim header.b=AZaxQbSb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=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: 5CDC1A19C X-Spam-Score: 6.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6WQD1hof0CPR Hi Timo, Files in the store are always world-readable and there's nothing you can d= o to change that=2E There has been discussions in the past about how to han= dle secrets in the store, but no solution so far=2E One thing you can do, if wireguard allows it, is to have the pre-shared ke= y in a separate file out of the store and simply point the config to that f= ile (instead of using a file-like object)=2E This is how we handle other se= crets so far=2E Le 29 novembre 2022 20:24:13 GMT+01:00, Timo Wilken a= =C3=A9crit=C2=A0: >Hi Guixers, > >I'm trying to patch the `wireguard-service-type' to accept pre-shared >keys and add them to the generated config=2E This all seems to work >fine, except that I can't get guix to generate a non-world-readable >configuration file=2E > >I've tried adding a `(chmod port #o400)' call to the end of the lambda >that generates the config file (gnu/services/vpn=2Escm lines 784-838), >but that seems to have no effect -- the resulting file at >/gnu/store/=2E=2E=2E-wireguard-config/wg0=2Econf is still >world-readable=2E Adding `(chmod #$config-file #o400)' after the >`call-with-output-file' call doesn't work either=2E > >What do I need to do to make guix install the generated config file >with 0400 permissions? > >Cheers, >Timo >