[3146] in Athena Bugs
patches to rshd
daemon@ATHENA.MIT.EDU (John Carr)
Fri Sep 8 23:36:12 1989
To: bugs@ATHENA.MIT.EDU
Date: Fri, 08 Sep 89 23:35:43 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
rshd does not log root shells; this is probably a bad idea. Here is a
patch to make it do so (patches apply to the version in
/afs/athena/astaff/project/kerberos). I have tested this on my
workstation. Please forward to any appropriate lists, if bugs is not the
right place for this.
*** /afs/athena/astaff/project/kerberos/src/appl/bsd/rshd.c Wed May 17 10:57:36 1989
--- rshd.c Fri Sep 8 23:32:13 1989
***************
*** 356,361 ****
--- 356,365 ----
if (*pwd->pw_shell == '\0')
pwd->pw_shell = "/bin/sh";
(void) close(f);
+ if (!pwd->pw_uid)
+ syslog(LOG_NOTICE | LOG_AUTH, "Root shell (krb) from %s, %s.%s@%s.",
+ hp->h_name, kdata->pname, kdata->pinst,
+ kdata->prealm);
(void) setgid((gid_t)pwd->pw_gid);
initgroups(pwd->pw_name, pwd->pw_gid);
(void) setuid((uid_t)pwd->pw_uid);