unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>
To: Maxime Devos <maximedevos@telenet.be>,
	Zacchaeus Scheffer <zaccysc@gmail.com>
Cc: 53752@debbugs.gnu.org
Subject: bug#53752: guix home symlink permissions
Date: Tue, 08 Feb 2022 08:01:33 +0100	[thread overview]
Message-ID: <663fb5a97616a8ed1bf74f10b5ba5203f15abd61.camel@ist.tugraz.at> (raw)
In-Reply-To: <49b4975e6c61a7ed0010c850b52dab811e4803b7.camel@telenet.be>

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




      reply	other threads:[~2022-02-08  8:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 18:08 bug#53752: guix home symlink permissions Zacchaeus Scheffer
2022-02-03 19:56 ` Thiago Jung Bauermann via Bug reports for GNU Guix
2022-02-03 21:22   ` Zacchaeus Scheffer
2022-02-03 23:06     ` Thiago Jung Bauermann via Bug reports for GNU Guix
2022-02-04  9:58 ` Liliana Marie Prikler
2022-02-04 18:17   ` Zacchaeus Scheffer
2022-02-07 19:47     ` Zacchaeus Scheffer
2022-02-07 21:02       ` Maxime Devos
2022-02-08  7:01         ` Liliana Marie Prikler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=663fb5a97616a8ed1bf74f10b5ba5203f15abd61.camel@ist.tugraz.at \
    --to=liliana.prikler@ist.tugraz.at \
    --cc=53752@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    --cc=zaccysc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).