guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/1] services: urandom-seed: Set umask to 077 while shutting


From: Ludovic Courtès
Subject: Re: [PATCH 1/1] services: urandom-seed: Set umask to 077 while shutting down.
Date: Mon, 30 May 2016 22:56:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Leo Famulari <address@hidden> skribis:

> * gnu/services/base.scm (urandom-seed-shepherd-service): Call 'umask'.
> ---
>  gnu/services/base.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index a45f219..8ed40a4 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -461,6 +461,7 @@ stopped before 'kill' is called."
>                       (call-with-input-file "/dev/urandom"
>                         (lambda (urandom)
>                           (get-bytevector-n! urandom buf 0 512)
> +                         (umask #o077)
>                           (call-with-output-file #$%random-seed-file

I think it’s safer to restore the umask afterwards, like:

  (let ((previous-umask (umask #o077)))
    …
    (umask previous-umask))

Otherwise LGTM, thanks!

Ludo’.



reply via email to

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