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
|
@ -460,10 +460,12 @@ stopped before 'kill' is called."
|
||||||
(let ((buf (make-bytevector 512)))
|
(let ((buf (make-bytevector 512)))
|
||||||
(call-with-input-file "/dev/urandom"
|
(call-with-input-file "/dev/urandom"
|
||||||
(lambda (urandom)
|
(lambda (urandom)
|
||||||
|
(let ((previous-umask (umask #o077)))
|
||||||
(get-bytevector-n! urandom buf 0 512)
|
(get-bytevector-n! urandom buf 0 512)
|
||||||
(call-with-output-file #$%random-seed-file
|
(call-with-output-file #$%random-seed-file
|
||||||
(lambda (seed)
|
(lambda (seed)
|
||||||
(put-bytevector seed buf)))
|
(put-bytevector seed buf)))
|
||||||
|
(umask previous-umask))
|
||||||
#t)))))
|
#t)))))
|
||||||
(modules `((rnrs bytevectors)
|
(modules `((rnrs bytevectors)
|
||||||
(rnrs io ports)
|
(rnrs io ports)
|
||||||
|
|
Loading…
Reference in New Issue