mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
list-runtime-roots: Ignore PIDs we cannot access.
This allows running as non-root.
Fixes a regression introduced in b8f59cdc20
.
* nix/scripts/list-runtime-roots.in (referenced-files): Handle EACCES in
addition to ENOENT.
This commit is contained in:
parent
d0b87779f0
commit
856b68bda9
1 changed files with 5 additions and 4 deletions
|
@ -119,10 +119,11 @@ or the empty list."
|
|||
(proc-maps-roots proc)
|
||||
(proc-environ-roots proc)))
|
||||
(lambda args
|
||||
;; There's a TOCTTOU race that we need to handle.
|
||||
(if (= ENOENT (system-error-errno args))
|
||||
(let ((err (system-error-errno args)))
|
||||
(if (or (= ENOENT err) ;TOCTTOU race
|
||||
(= EACCES err)) ;not running as root
|
||||
'()
|
||||
(apply throw args))))))
|
||||
(apply throw args)))))))
|
||||
(scandir %proc-directory string->number
|
||||
(lambda (a b)
|
||||
(< (string->number a) (string->number b))))))
|
||||
|
|
Loading…
Reference in a new issue