Skip to content

tty path checking unhelpfully hides problems #329

@gdt

Description

@gdt

I am using 1.9.14p3 on NetBSD. I changed from /dev/ttyp* to /dev/pts, but did not reboot. I found that sudo when executed as part of a package rebuild ("make replace") did not respect cached authtentication. The root causes are

  1. I had not run dev_mkdb, and devname(3) returned stale paths
  2. sudo took the device major/minor, converted it to a path, and then checked if the path was valid. If so, the dev_t was stored in the timestamp file. If not, sudo silently flipped to ppid mode.

To figure this out, I had to read code and write my own code to parse the timestamp file.

I would suggest

  1. If the tty path does not exist, log a very loud error and error out. This is a failure of something that ought to be true always, and it is both unhelpful and unsafe to do something else instead
  2. If what matters is the dev_t, do not convert to names. Just use dev_t.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions