Hidden feature of login command

While reverse engineering various commands on the Tektronix 4404 I came across code in the login command that does a check equivalent to:

if (!strcmp(argv[0], “su”))
behave like substitute user

ie if the login command is named “su” it behave differently. So I created a link called su to login and sure enough it does do what it says on the can. Neat!

Is that a common feechur on other systems?

It’s a fairly common trick… a somewhat extreme example is BusyBox: a single executable for a large number of Unix utilities.

2 Likes