diff options
author | Richard Basch <probe@mit.edu> | 1994-12-30 23:40:17 +0000 |
---|---|---|
committer | Richard Basch <probe@mit.edu> | 1994-12-30 23:40:17 +0000 |
commit | c2d036a23126bbae6d0c5628fd58c1b7f4549450 (patch) | |
tree | 0608858db0e619e5b54c6448cb0912fda340598d /src/appl/bsd/login.c | |
parent | 74f499ff3066a2ec17129fba53c7a1ddce7d2484 (diff) | |
download | krb5-c2d036a23126bbae6d0c5628fd58c1b7f4549450.tar.gz krb5-c2d036a23126bbae6d0c5628fd58c1b7f4549450.tar.xz krb5-c2d036a23126bbae6d0c5628fd58c1b7f4549450.zip |
* logutil.c
* login.c
Tidied up the code a bit.
Do not rely on NO_UT_TYPE (it has problems with AIX headers)
* krlogind.c
Tidied up the code a bit.
Set the controlling tty for Ultrix
Do not rely on NO_UT_TYPE (it has problems with AIX headers)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4782 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/bsd/login.c')
-rw-r--r-- | src/appl/bsd/login.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index a142cb129c..71f89dbeed 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -391,12 +391,13 @@ main(argc, argv) #if !defined(_AIX) ioctlval = 0; #ifdef TIOCLSET -/* linux, sco don't have this line discipline interface */ + /* linux, sco don't have this line discipline interface */ (void)ioctl(0, TIOCLSET, (char *)&ioctlval); #endif (void)ioctl(0, TIOCNXCL, (char *)0); (void)fcntl(0, F_SETFL, ioctlval); #endif + #ifdef POSIX_TERMIOS (void)tcgetattr(0, &tc); #else @@ -431,11 +432,9 @@ main(argc, argv) tc.c_cc[VEOL2] = CNUL; #endif #ifdef VSUSP -#ifdef hpux -#ifndef CSUSP +#if !defined(CSUSP) && defined(CSWTCH) #define CSUSP CSWTCH #endif -#endif tc.c_cc[VSUSP] = CSUSP; #endif #ifdef VDSUSP @@ -465,8 +464,8 @@ main(argc, argv) #ifdef VSTATUS #ifdef CSTATUS tc.c_cc[VSTATUS] = CSTATUS; -#endif -#endif +#endif /* CSTATUS */ +#endif /* VSTATUS */ #endif /* NO_INIT_CC */ tcsetattr(0, TCSANOW, &tc); #else @@ -773,14 +772,11 @@ bad_login: { struct utmp utmp; - memset((char *)&utmp, 0, sizeof(utmp)); - login_time = time(&utmp.ut_time); -#ifdef USER_PROCESS - utmp.ut_type = USER_PROCESS; -#endif #ifndef NO_UT_PID + utmp.ut_type = USER_PROCESS; utmp.ut_pid = getppid(); #endif + login_time = time(&utmp.ut_time); update_utmp(&utmp, username, ttyn, hostname); } @@ -833,16 +829,13 @@ bad_login: if (*pwd->pw_shell == '\0') pwd->pw_shell = BSHELL; +#if defined(NTTYDISC) && !defined(_IBMR2) /* turn on new line discipline for the csh */ else if (!strcmp(pwd->pw_shell, "/bin/csh")) { -#ifdef NTTYDISC -/* sco, svr4 don't have it */ -#if !defined(_IBMR2) ioctlval = NTTYDISC; (void)ioctl(0, TIOCSETD, (char *)&ioctlval); -#endif -#endif } +#endif /* destroy environment unless user has requested preservation */ envinit = (char **)malloc(MAXENVIRON * sizeof(char *)); @@ -855,7 +848,7 @@ bad_login: i = 0; -#if defined(_AIX) && defined(_IBMR2) +#ifdef _IBMR2 { FILE *fp; if ((fp = fopen("/etc/environment", "r")) != NULL) { |