[199] in Kerberos-V5-bugs
[Karl Morgan: sun login modifications]
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Wed Sep 11 20:07:31 1991
Date: Wed, 11 Sep 91 17:19:23 -0400
From: tytso@ATHENA.MIT.EDU (Theodore Ts'o)
To: krb5-bugs@ATHENA.MIT.EDU
Reply-To: tytso@ATHENA.MIT.EDU
------- Forwarded Message
Date: Wed, 11 Sep 91 14:44:44 CDT
From: exuksm@exu.ericsson.se (Karl Morgan)
To: tytso@ATHENA.MIT.EDU
Subject: sun login modifications
Ted,
Below are the diff's to:
- login.c
- pathnames.h
- Imakefile
I do not have access to the SunOS source code. Any similarity
(except in functionality) is totally unintentional. I believe
that the modifications have been implemented correctly. Please
let me know if there is a problem.
Karl
*** /mit/kerberos/krb5/appl/telnet/login/Imakefile.orig Wed Sep 11 14:08:12 1991
--- /mit/kerberos/krb5/appl/telnet/login/Imakefile Wed Sep 11 14:06:13 1991
***************
*** 33,38 ****
--- 33,44 ----
KRB4DEF=
#endif
+ #ifdef OS_SunOS4
+ OS=-DOS_SunOS4
+ #else
+ OS=
+ #endif
+
#
# setenv, if needed, is provided in libtelnet.a
#
***************
*** 43,49 ****
SRCS= login.c logutil.c
OBJS= login.o logutil.o
! DEFINES = -DVFS -DAUTHENTICATE -DENCRYPT -DLOGIN_F $(KRB4DEF) -DKRB5
all:: login
--- 49,55 ----
SRCS= login.c logutil.c
OBJS= login.o logutil.o
! DEFINES = $(OS) -DVFS -DAUTHENTICATE -DENCRYPT -DLOGIN_F $(KRB4DEF) -DKRB5
all:: login
*** /mit/kerberos/krb5/appl/telnet/login/pathnames.h.orig Wed Sep 11 10:55:55 1991
--- /mit/kerberos/krb5/appl/telnet/login/pathnames.h Wed Sep 11 14:04:34 1991
***************
*** 47,52 ****
--- 47,56 ----
#define _PATH_MOTDFILE "/etc/motd"
#define _PATH_NOLOGIN "/etc/nologin"
+ #ifdef OS_SunOS4
+ #define _PATH_FBTAB "/etc/fbtab"
+ #endif
+
# define _PATH_LOGIN "/krb5/sbin/login"
#endif
*** /mit/kerberos/krb5/appl/telnet/login/login.c.orig Thu Aug 29 16:03:48 1991
--- /mit/kerberos/krb5/appl/telnet/login/login.c Wed Sep 11 14:04:18 1991
***************
*** 535,540 ****
--- 535,544 ----
dolastlog(quietlog);
+ #ifdef OS_SunOS4
+ dofbtab(_PATH_FBTAB, ttyn);
+ #endif
+
if (!pflag) { /* XXX */
static struct winsize win = { 0, 0, 0, 0 };
***************
*** 780,782 ****
--- 784,829 ----
sleep((u_int)5);
exit(eval);
}
+
+
+ #ifdef OS_SunOS4
+
+ dofbtab(fbfile, tty)
+ char *fbfile, *tty;
+ {
+ FILE *fp;
+ char bufa[256], bufb[256], *b, dev[24];
+ int mode, x;
+
+ mode = x = 0;
+
+ if ((fp = fopen(fbfile, "r")) == NULL)
+ return; /* might not be an error so just forget it */
+
+ while (fgets(bufa, 255 - 1, fp)) {
+
+ if (bufa[0] == '#' || sscanf(bufa, "%s %o %s", dev, &mode, bufb) != 3)
+ continue;
+
+ if (strcmp(dev, tty))
+ continue;
+
+ b = bufb;
+ for (;;) {
+ if (*b == ':' || *b == '\n' || *b == NULL) {
+ bufa[x] = NULL;
+ (void) chmod(bufa, mode);
+ (void) chown(bufa, pwd->pw_uid, pwd->pw_gid);
+ x = 0;
+ if (*b == NULL)
+ break;
+ }
+ else {
+ bufa[x++] = *b;
+ }
+ b++;
+ }
+ }
+ fclose(fp);
+ }
+ #endif /* OS_SunOS4 */
------- End Forwarded Message