Project

General

Profile

Bug #12683

w(1) and whodo(1) should silently skip dirs it cannot open

Added by Jason King 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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

Related to illumos gate - Bug #12523: Buffer overflow in w and whodoClosedJason King

Actions
#1

Updated by Jason King 9 months 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).

#2

Updated by Andy Fiddaman 9 months ago

  • Related to Bug #12523: Buffer overflow in w and whodo added
#3

Updated by Electric Monk 9 months 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>

Also available in: Atom PDF