| Summary: | [jail] w(1) incorrectly handles stale utmp slots with jail | ||
|---|---|---|---|
| Product: | Base System | Reporter: | rlucia <rlucia> |
| Component: | bin | Assignee: | freebsd-jail (Nobody) <jail> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
I was wrong about assumptions and I didn't doublecheck before
posting the PR. shame on me :)
anwyay here's the corrected thing:
How-to-Repeat
1. log into the host machine and have your shell killed or disconnected
(create a stale utmp record)
2. log into the jail and manage to get allocated to you the tty just
freed but who appears in the stale utmp record
3. now issue the w command on the host system and you'll see the
'current process' for the stale utmp record being a process running
in the jail.
--
Rocco Lucia - rlucia@iscanet.com Iscanet Internet Services
http://elisa.utopianet.net/~rlucia System and Network Admin
C6E6 AC9A 1361 FB38 B47A 2792 9FC4 C52F 7A68 4468
Free unices for a free world. Support *BSD.
Responsible Changed From-To: freebsd-bugs->phk This is more a problem with w(1) than with jails, but perhaps you could take a look anyway? :-) Responsible Changed From-To: phk->bugs This is indeed a problem with the way utmp and w(1) works, but admittedly, jails probably add to the confusion. I have no simple fix to offer. Responsible Changed From-To: bugs->freebsd-bugs fix responsible Responsible Changed From-To: freebsd-bugs->freebsd-jail Reassign to appropriate mailing list. State Changed From-To: open->closed Closing, as this is no longer an issue on FreeBSD -CURRENT. |
While using jail, w command on host machine erroneously handles 'current process' for a stale utmp slot. It will show as 'current process' that one who is actually run in the jail and whose controlling terminal line is the same as it was used in the host machine. How-To-Repeat: 1. log into the jail and allocate different ttys (screen could help) 2. log into the host machine and have the process killed or disconnected (create a stale utmp record) Manage steps 1 and 2 so that you have at least a session on host machine and a session in the prison that share same tty name (/dev/ttyp1 on host, and ${JAIL}/dev/ttyp1 in the prison). 3. now issue the w command on the host system and you'll see the 'current process' for the stale utmp record being a process running in the jail but that has same tty (though on two different environments).