Bug 91442
Summary: | 'who am i' and 'who -m' do not return results as expected | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | J. Erik Hemdal <erik.hemdal> | ||||
Component: | gnome-terminal | Assignee: | Havoc Pennington <hp> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 8.0 | CC: | tbaecker.spam | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2003-10-04 06:05:27 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
J. Erik Hemdal
2003-05-22 17:15:51 UTC
Created attachment 91900 [details]
Test script for 91442
Test script attached.
This is due to gnome-terminal not adding utmp entries. For example, try running who from inside an 'xterm -ls' window. I confirmed that who works as expected in an xterm. Also works in gnome- terminal-2.2.1-3 (delivered in Red Hat 9). Possible replacement from `who am i | awk '{print $1}'` (what most are looking for): ls -l `tty` | awk '{print $3}' Explanation below… On many systems "`who am i`" is equivalent to "`who -m`". The Problem here is that with some terminals, "who -m" returns nothing. Example #1 run from a xfce4-terminal Pegasus ~ # whoami root Pegasus ~ # who am i thomas pts/1 2017-08-19 11:15 (:0.0) Pegasus ~ # who -m thomas pts/1 2017-08-19 11:15 (:0.0) Pegasus ~ # who thomas tty8 2017-08-19 10:18 (:0) thomas pts/1 2017-08-19 11:15 (:0.0) thomas pts/5 2017-08-19 16:16 (:0.0) Pegasus ~ # who am i | awk '{print $1}' thomasPossible replacement from `who am i | awk '{print $1}'` (what most are looking for): ls -l `tty` | awk '{print $3}' Explanation below… On many systems "`who am i`" is equivalent to "`who -m`". The Problem here is that with some terminals, "who -m" returns nothing. Example #1 run from a xfce4-terminal Pegasus ~ # whoami root Pegasus ~ # who am i thomas pts/1 2017-08-19 11:15 (:0.0) Pegasus ~ # who -m thomas pts/1 2017-08-19 11:15 (:0.0) Pegasus ~ # who thomas tty8 2017-08-19 10:18 (:0) thomas pts/1 2017-08-19 11:15 (:0.0) thomas pts/5 2017-08-19 16:16 (:0.0) Pegasus ~ # who am i | awk '{print $1}' thomas Pegasus ~ # but Example #2 from a gnome-terminal (same computer, same commands) Pegasus ~ # whoami root Pegasus ~ # who am i Pegasus ~ # who -m Pegasus ~ # who thomas tty8 2017-08-19 10:18 (:0) thomas pts/1 2017-08-19 11:15 (:0.0) thomas pts/5 2017-08-19 16:16 (:0.0) Pegasus ~ # This seems to be a consequence of gnome-terminal not adding utmp entries… Pegasus ~ # but Example #2 from a gnome-terminal (same computer, same commands) Pegasus ~ # whoami root Pegasus ~ # who am i Pegasus ~ # who -m Pegasus ~ # who thomas tty8 2017-08-19 10:18 (:0) thomas pts/1 2017-08-19 11:15 (:0.0) thomas pts/5 2017-08-19 16:16 (:0.0) Pegasus ~ # This seems to be a consequence of gnome-terminal not adding utmp entries… |