Article View: net.bugs.v7
Article #20su ps display
From: utzoohenry
Date: Wed, 13 Jan 1982 17:25
Date: Wed, 13 Jan 1982 17:25
28 lines
1015 bytes
1015 bytes
The standard su(1) just shows "su" as the command name of the shell it
fires up. This can upset managerial types who think "su" is "superuser"
and want to know why Joe Blow has superuser powers (actually, of course,
Joe has done something like "su fred"). Not entirely clear this should
be called a bug, it's more like an obscurity. Anyway, the fix is simple
and goes roughly like this (line numbers are approximate because our su
has other modifications):
30,34c30,38
<
< if(argc > 1)
< nptr = argv[1];
< else
< nptr = "root";
---
> char show[15]; /* What to show for shell on ps listing. */
>
> if(argc > 1) {
> nptr = argv[1];
> sprintf(show, "su %.8s", nptr);
> } else {
> nptr = "root";
> strcpy(show, "su");
> }
66c70
< execl(shell, "su", 0);
---
> execl(shell, show, 0);
Technical Details
Message-ID:
<anews.Autzoo.1273>Path:
arc1-ca.pugleaf.net!utzoo!henryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!henry From: utzoo!henry Newsgroups: net.bugs.v7 Subject: su ps display Date: Wed, 13 Jan 1982 17:25:11 +0000 Message-ID: <anews.Autzoo.1273>