guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: permission denied: /gnu/store/...guile...


From: Mark H Weaver
Subject: Re: permission denied: /gnu/store/...guile...
Date: Sat, 23 May 2015 12:26:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Mark H Weaver <address@hidden> skribis:
>
>> The problem turned out to be that on rekado's system, / was owned by
>> user "rekado" with mode 700.
>
> Oh, I see.  I would never have thought of this!
>
>> Perhaps 'guix system init' should explicitly set the ownership and
>> permissions on the target root directory?
>
> Here’s a tentative patch.
[...]
> diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
> index 8d5fbe5..2cf6a43 100644
> --- a/guix/scripts/system.scm
> +++ b/guix/scripts/system.scm
> @@ -145,6 +145,14 @@ When GRUB? is true, install GRUB on DEVICE, using 
> GRUB.CFG."
>              ;; Copy items to the new store.
>              (copy-closure to-copy target #:log-port log-port)))))
>  
> +  ;; Make sure TARGET is root-owned when running as root, but still allow
> +  ;; non-root uses (useful for testing.)
> +  (if (zero? (getuid))
> +      (chown target 0 0)

I would suggest using (geteuid) instead.  Also, we should set the mode.
In this particular case, if we had changed the owner without also
changing the mode, rekado's system still would have been quite broken.

> I wonder if the activation code shouldn’t systematically do
> (chown "/" 0 0) as well.
>
> Thoughts?

I'm not sure.  Trying to fix individual things during activation that
might have been broken is a slippery slope.  We cannot hope to fix
everything that might have been broken using this approach, and on the
other hand we might undo some change that the user made intentionally.

For now, I would probably do this only from 'guix system init', but I
don't feel strongly either way.

    Thanks!
      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]