home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Bug_Fixes / Net.v7bugs / 0061 < prev    next >
Encoding:
Text File  |  1982-01-13  |  901 b   |  34 lines

  1. Autzoo.1273
  2. net.bugs.v7
  3. utzoo!henry
  4. Wed Jan 13 17:25:11 1982
  5. su ps display
  6. The standard su(1) just shows "su" as the command name of the shell it
  7. fires up.  This can upset managerial types who think "su" is "superuser"
  8. and want to know why Joe Blow has superuser powers (actually, of course,
  9. Joe has done something like "su fred").  Not entirely clear this should
  10. be called a bug, it's more like an obscurity.  Anyway, the fix is simple
  11. and goes roughly like this (line numbers are approximate because our su
  12. has other modifications):
  13.  
  14.     30,34c30,38
  15.     < 
  16.     <     if(argc > 1)
  17.     <         nptr = argv[1];
  18.     <     else
  19.     <         nptr = "root";
  20.     ---
  21.     >     char show[15];    /* What to show for shell on ps listing. */
  22.     > 
  23.     >     if(argc > 1) {
  24.     >         nptr = argv[1];
  25.     >         sprintf(show, "su %.8s", nptr);
  26.     >     } else {
  27.     >         nptr = "root";
  28.     >         strcpy(show, "su");
  29.     >     }
  30.     66c70
  31.     <         execl(shell, "su", 0);
  32.     ---
  33.     >         execl(shell, show, 0);
  34.