From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kA0SN1QmAmK4+wAAgWs5BA (envelope-from ) for ; Tue, 08 Feb 2022 09:14:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KO3iL1QmAmLunQAAG6o9tA (envelope-from ) for ; Tue, 08 Feb 2022 09:14:12 +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 603CD429FB for ; Tue, 8 Feb 2022 09:14:11 +0100 (CET) Received: from localhost ([::1]:52222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHLda-0008NX-AX for larch@yhetil.org; Tue, 08 Feb 2022 03:14:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHKVn-0003nF-8O for bug-guix@gnu.org; Tue, 08 Feb 2022 02:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHKVl-0007MZ-Pr for bug-guix@gnu.org; Tue, 08 Feb 2022 02:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHKVl-0007u2-Lb for bug-guix@gnu.org; Tue, 08 Feb 2022 02:02:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53752: guix home symlink permissions Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 08 Feb 2022 07:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53752 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxime Devos , Zacchaeus Scheffer Received: via spool by 53752-submit@debbugs.gnu.org id=B53752.164430369929316 (code B ref 53752); Tue, 08 Feb 2022 07:02:01 +0000 Received: (at 53752) by debbugs.gnu.org; 8 Feb 2022 07:01:39 +0000 Received: from localhost ([127.0.0.1]:45002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHKVP-0007cW-BG for submit@debbugs.gnu.org; Tue, 08 Feb 2022 02:01:39 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:50121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHKVL-0007YL-VB for 53752@debbugs.gnu.org; Tue, 08 Feb 2022 02:01:38 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4JtDSr5Ddjz1LZWB; Tue, 8 Feb 2022 08:01:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4JtDSr5Ddjz1LZWB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1644303692; bh=dy7MebW+XGfd8gtC2BWYDRoR7s9y+tf4MRbCsPhmk+k=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=m92A2gkZ+EyXM28V8Jext9mWpBeP8Fp1Og1HD8Nb1Lj4XjfNphatysw00obRaxCmv ChjSBpZdVvzaW4pBCiHhWEfUUu74ivtMxlsjOtLlQVS2uCCQUhqUYOx9cNsB6lKUvc NPaTucaOTR74cR4LUiPt3bLme3+EtzUX/zMCSQdA= Message-ID: <663fb5a97616a8ed1bf74f10b5ba5203f15abd61.camel@ist.tugraz.at> From: Liliana Marie Prikler Date: Tue, 08 Feb 2022 08:01:33 +0100 In-Reply-To: <49b4975e6c61a7ed0010c850b52dab811e4803b7.camel@telenet.be> References: <49b4975e6c61a7ed0010c850b52dab811e4803b7.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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: 53752@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-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=1644308052; 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: content-transfer-encoding:content-transfer-encoding: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=dy7MebW+XGfd8gtC2BWYDRoR7s9y+tf4MRbCsPhmk+k=; b=u5RhZ0dH4KPP3wN55P7yWOcN60rmzyl0Ek1wIWEfMcVuSrmjMcO28y2H0RypBpDdADC78P /eTk3bTlgv1lgOx7YVjYngSML3bZ5EfZK6dUuiOJxp5HVzw0nNwioI/EkeKHkZwjdT3wNN kntGH0FQ6syRHJMpz7Ns8GA1Rf7O2Lc7zqXGHjj0VqSuWmQUyLkTWKgTBMYUZec4p2kd72 9onYBq6ufXIl637rBxF463jHDqIbHkNY3jh7k6LqRXLb061u/Zg6AGpM72Fl4Kd7XS5Bwq mR7RZKVNRQsjfsdd07lAK3WypTjhrGAhs1rtcCIKUMnTbDXeVQz4LmLARYz2CA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644308052; a=rsa-sha256; cv=none; b=ExSwkx27p/K/CEFDbKfAOIZQBNHft9lLqajALq0X+cZD0zAIFmy6dztlTe9eD7evh4Otus upM2QcITlK8JaB7yCS2R2HUxhvNyhk9H8Z4pBWp+CjRXRTNV8gN0Z6ijx+v6JApdqtCSeH VUSnUEFdNV3P0UpUeXO+/fBEmUV35M8UspValK7bt3Le+3gQHFnBiCArwh2AHwIB3/O2Wl std8wStAouJa3XNjrU9gmRlQ4VryaKCCEPdz6b7gAdUBTopJK1FSB6JlFUHSGGf5g/8jqW jytTF46Y/Q17ZnAztHpEkbCoqV5pVvTYKT1a75zSs1yIZQQ+JktR3r8jOd09qQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=m92A2gkZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=m92A2gkZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 603CD429FB X-Spam-Score: -2.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: oSx4SovGfNH7 Am Montag, dem 07.02.2022 um 22:02 +0100 schrieb Maxime Devos: > Zacchaeus Scheffer schreef op ma 07-02-2022 om 14:47 [-0500]: > > I was able create the desired effect with the following service > > definition: > > (simple-service > >  'my-activation-service > >  home-activation-service-type > >  (gexp > >   (begin > >     (chdir (ungexp user-home)) > >     (if (not (file-exists? ".ssh")) > >         (mkdir ".ssh")) > >     (chmod ".ssh" #o700) > >     (chdir ".ssh") > >     (let ((port (open-output-file "authorized_keys"))) > >       (display (ungexp authorized-keys) port) > >       (close-port port)) > >     (chmod "authorized_keys" #o600) > >     (chdir "..")))) > > where 'user-home and 'authorized-keys are appropriate strings > > defined earlier in the file. > > > > I believe that resolves the issue, > > Users shouldn't have to do this (relatively) huge block of relatively > inscrutable code though, I believe something along these lines (or a > different solution) needs to be implemented in Guix itself somewhere > before the issue is resolved. I'll again be pointing at the "don't put secrets into your store" shield. We'd have to find a reasonable way of encrypting sensitive data before we can do a home-ssh-service-type. @Zacchaeus, your code can likely be simplified to #~(with-directory-excursion #$user-home (mkdir-p ".ssh") (chmod ".ssh" #o700) (with-directory-excursion ".ssh" (copy-file #$authorized-keys "authorized_keys") (chmod "authorized_keys" #o600))) though perhaps there's some magic incantation to import (guix build utils) for mkdir-p and with-directory-excursion that I'm missing here. Cheers