Alarming Terminal app behavior (10.1.5)

bbloke

Registered
I recently sent this post to the Apple Discussions pages because I am somewhat concerned by the Terminal's behavior under 10.1.5. I'm sure it did not used to do this and I want to see if people on this forum can duplicate my findings and find a solution!


"I have noticed something a little worrying when using the Terminal under 10.1.5, where users are not being logged off properly. To duplicate what I have observed, try the following:

1) Open the Terminal app

2) Type "w" (and Return) to show a list of those logged on. You will see at least two users, one using the console ("co") and one using the Terminal window you have open (eg ttyp1 is "p1").

3) Now open a new Terminal window, so that you have two open. You will see the terminal session labeled in the title bar (eg "(ttyp2)").

4) Type "w" again in the first Terminal window and see at least three sessions now (one console, two terminals).

5) Log out of the second Terminal window (type "logout" or "exit" or "control-d")

6) Go back to the first terminal window and type "w" again. You will see the second Terminal window was not logged out properly...

My workaround for this was to run XDarwin and open as many xterm windows as I had Terminal Windows open, and logging out from each xterm properly logs me out for each one...

So, is the Terminal app not properly logging users out any more?!"
 
I'm using the bash shell, and it seems to behave differently.

When I open up many terminals (via terminal.app), using `w`, `who`, or `finger` produces the same result - one user logged in via the console, ttyp0.

My guess is that your defauly shell is running as a login shell instead of just a shell.
 
I noticed this problem months ago. I started a thread in this forum, but nobody seem to care about it. It is rather odd to type w and see users that are not longer logged in. I first noticed it when root appeared to be in the third terminal (tty3 or p3?).

This was so annoying that I did a clean install of OS X, and not, it didn't solve anything. My only question is if this is a problem related to X 10.1 or is even older?

I did some reading, and the problem seems to be that some file keeps the reccord of who is logged in and where...Terminal correctly adds an entry to this file (I think is called utmp), but does not remove the entry when users logout.

My real worry is any security problem that might arise due to this behaviour.

any comments will be appreciated


drizzt
 
Yup, kilowatt, it looks like it was a login shell. I did switch to using tcsh at one point, but I must have reverted to the login shell either on purpose at some point or else an upgrade must have changed my default settings. Either way, I've now switched back to using tcsh, which is what I am used to in the office too. Now the behavior is similar to what you report using bash.

When opening new Terminal windows, typing "w" always shows the same number of sessions: one. There always seems to be a session on the console. I should perhaps try logging in as a non-administrator and see if that affects things. By comparison, running XDarwin, opening xterms, and then using "w" does show separate sessions (on ttypx, where x is a number) rather than using the console! So the Terminal app is behaving differently from a terminal window using the X Window server.

In case people are not aware (I've only been using Unix for about a year and a half), the "last" command can be used to show previous logins and accesses the /var/log/wtmp file.

fperez, I'm sorry if I missed your earlier post. If it's any consolation, I too was beginning to wonder if no one was interested in this thread (until today!) and my original post on Apple's Discussion pages still has not had a reply. My concern, like yours, is whether or not this is a security issue. I have set feedback to Apple, but if others are concerned I suggest they do likewise.

Thanks for the feedback and I'd like to keep this thread going, as we might be looking at something which is potentially important...
 
Back
Top