Re: Wondering if this is a security issue?

"Christopher K Riesbeck (as c-riesbeck at northwestern dot edu)" <[email protected]> Tue, 5 May 2026 12:27:30 +0000
Newsgroups gmane.lisp.lispworks.general
Message-ID <PH0PR05MB7621BD3047E24B9C94D95FD9EF3E2@PH0PR05MB7621.namprd05.prod.outlook.com>
Ah, “controlling terminal” and “PDP-11”.  I’m reminded of a bug that Bob Wilensky and I introduced when we optimized the home-grown text editor running on the Yale Computer Science department’s PDP-11 in the 1970s.  The code for setting raw mode no longer managed the terminal the user was running on. Instead it managed terminal #0 in the computer lab downstairs.

--
Christopher Riesbeck
Associate Professor, Computer Science
Director, CS Master’s Program


From: [email protected] <[email protected]> on behalf of David McClain (as dbm at refined-audiometrics dot com) <[email protected]>
Date: Tuesday, May 5, 2026 at 7:00 AM
To: Tim Bradshaw <[email protected]>
Cc: Bradford Miller <[email protected]>
Subject: Re: Wondering if this is a security issue?

Holy smokes !! Layer upon layer of cruft which has become mainstream in our lives…

I am not a networking expert, and I have been wrestling with how to allocate (claim) a socket port number, and get that information made available to remote clients.

Turns out, after more than 50 years, there are no standard mechanisms for doing this. It is every man for himself.

Now we have vibe coded enshitification on top of all that too...

On May 5, 2026, at 03:10, Tim Bradshaw (as tfb at cley dot com) <[email protected]> wrote:

On 4 May 2026, at 23:11, David McClain <[email protected]> wrote:

I don’t understand, from your explanations, why it would report “root”.

The problem is that logname is one of those utilities which digs into the layers of emulation which allow the OS running, for instance, on a Mac to think it's actually running on a PDP-11.

I am pretty sure logname just calls getlogin(3) which

returns a pointer to a string containing the name of the user logged in on the controlling terminal of the process, or a null pointer if this information cannot be determined.

That depends on at least two things which can be confusing


  *   What is the controlling terminal of a process which may well be runnng in a GUI?
  *   Is the user logged in on that terminal, whatever it is, in any way related to the user who owns the current process?

I have no idea how that Mac GUI gets started but I would not be at all surprised if the 'controlling terminal' is not whatever the OS thinks is its console, in other words whatever is on the end of the topmost RS232 port on the CPU VME card ... no, wait, the whole concept of 'the console' hasn't made sense for forty years now.

But if we go back forty years to a machine where there really is a physical terminal on which a user is logged in, then the second question still applies: what, for instance does 'logname; sudo su - otheruser logname' print? The answer should be 'the same string twice', even though the users running the command were different.

--tim