mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
services: urandom-seed: Set umask to 077 while shutting down.
* gnu/services/base.scm (urandom-seed-shepherd-service): Call 'umask'.
This commit is contained in:
parent
df2dd07b88
commit
8fe5d95e66
1 changed files with 6 additions and 4 deletions
|
@ -460,10 +460,12 @@ (define (urandom-seed-shepherd-service _)
|
|||
(let ((buf (make-bytevector 512)))
|
||||
(call-with-input-file "/dev/urandom"
|
||||
(lambda (urandom)
|
||||
(get-bytevector-n! urandom buf 0 512)
|
||||
(call-with-output-file #$%random-seed-file
|
||||
(lambda (seed)
|
||||
(put-bytevector seed buf)))
|
||||
(let ((previous-umask (umask #o077)))
|
||||
(get-bytevector-n! urandom buf 0 512)
|
||||
(call-with-output-file #$%random-seed-file
|
||||
(lambda (seed)
|
||||
(put-bytevector seed buf)))
|
||||
(umask previous-umask))
|
||||
#t)))))
|
||||
(modules `((rnrs bytevectors)
|
||||
(rnrs io ports)
|
||||
|
|
Loading…
Reference in a new issue