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
|
@ -119,10 +119,11 @@ or the empty list."
|
||||||
(proc-maps-roots proc)
|
(proc-maps-roots proc)
|
||||||
(proc-environ-roots proc)))
|
(proc-environ-roots proc)))
|
||||||
(lambda args
|
(lambda args
|
||||||
;; There's a TOCTTOU race that we need to handle.
|
(let ((err (system-error-errno args)))
|
||||||
(if (= ENOENT (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
|
(scandir %proc-directory string->number
|
||||||
(lambda (a b)
|
(lambda (a b)
|
||||||
(< (string->number a) (string->number b))))))
|
(< (string->number a) (string->number b))))))
|
||||||
|
|
Loading…
Reference in New Issue