Bug #12683
closedw(1) and whodo(1) should silently skip dirs it cannot open
100%
Description
As part of the fix for #12523, it would write out an warning to stderr if it couldn't open the directory for a particular process (/proc/nnnn) for reasons other than ENOENT -- assuming the only reason it couldn't be opened is if the process went away between reading the directory entry from /proc and attempting to open it. It turns out, zoned process will also trigger a failure and a spurious warning.
The pre-#12523 code just silently skipped any proc dirs it couldn't open, we should just restore that behavior.
Related issues
Updated by Jason King about 2 years ago
To test this, I build both existing and new versions of w and whodo. I then ran each in a global zone with several zones booted. Without the fix, you could see permission denied errors trying to open processes in the NGZ. With the fix, the warnings are no longer present.
I also ran the old and new versions of both utilities in a NGZ as well -- all versions worked (as expected).
Updated by Andy Fiddaman about 2 years ago
- Related to Bug #12523: Buffer overflow in w and whodo added
Updated by Electric Monk about 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 45de8795bcb0e4c49743f37edfdd2c89d5a7863b
commit 45de8795bcb0e4c49743f37edfdd2c89d5a7863b Author: Jason King <jason.king@joyent.com> Date: 2020-05-01T23:13:18.000Z 12683 w(1) and whodo(1) should silently skip dirs it cannot open Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Approved by: Robert Mustacchi <rm@fingolfin.org>