You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment we're going through ttyname_from_dev in multuple places through current_tty_name, while this should be computed just once and used everywhere, avoiding issues such as the one fixed by #1682.
So I'd suggest to compute just once and keep it in the context to be used in the various places we need.
In fact right now we may end up computing the same value up to 5 times for a single execution:
init_pam: for PAM_TTY
log_command_execution: for the TTY= log entry
RecordScope::for_tty: for the session record scope
ttyname_from_dev: calls Process::tty_device_id() again on its own, so every current_tty_name() call reads /proc/self/stat again and may scan /dev/pts and /dev
Activity
system/term: Resolve the current tty once and share it
system/term: Resolve the current tty once and share it
system/term: Resolve the current tty once and share it
system/term: Resolve the current tty once and share it
system/term: Resolve the current tty once and share it
system/term: Resolve the current tty once and share it