login.c (1591) | login.c (2224) |
---|---|
1/*- 2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 66 unchanged lines hidden (view full) --- 75void dolastlog __P((int)); 76void getloginname __P((void)); 77void motd __P((void)); 78int rootterm __P((char *)); 79void sigint __P((int)); 80void sleepexit __P((int)); 81char *stypeof __P((char *)); 82void timedout __P((int)); | 1/*- 2 * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 66 unchanged lines hidden (view full) --- 75void dolastlog __P((int)); 76void getloginname __P((void)); 77void motd __P((void)); 78int rootterm __P((char *)); 79void sigint __P((int)); 80void sleepexit __P((int)); 81char *stypeof __P((char *)); 82void timedout __P((int)); |
83void login_fbtab __P((char *, uid_t, gid_t)); |
|
83#ifdef KERBEROS 84int klogin __P((struct passwd *, char *, char *, char *)); 85#endif 86 87extern void login __P((struct utmp *)); 88 89#define TTYGRPNAME "tty" /* name of group to own ttys */ 90 --- 248 unchanged lines hidden (view full) --- 339 (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name)); 340 if (hostname) 341 (void)strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); 342 (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); 343 login(&utmp); 344 345 dolastlog(quietlog); 346 | 84#ifdef KERBEROS 85int klogin __P((struct passwd *, char *, char *, char *)); 86#endif 87 88extern void login __P((struct utmp *)); 89 90#define TTYGRPNAME "tty" /* name of group to own ttys */ 91 --- 248 unchanged lines hidden (view full) --- 340 (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name)); 341 if (hostname) 342 (void)strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); 343 (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); 344 login(&utmp); 345 346 dolastlog(quietlog); 347 |
348 /* 349 * Set device protections, depending on what terminal the 350 * user is logged in. This feature is used on Suns to give 351 * console users better privacy. 352 */ 353 login_fbtab(tty, pwd->pw_uid, pwd->pw_gid); 354 |
|
347 (void)chown(ttyn, pwd->pw_uid, 348 (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid); 349 (void)setgid(pwd->pw_gid); 350 351 initgroups(username, pwd->pw_gid); 352 353 if (*pwd->pw_shell == '\0') 354 pwd->pw_shell = _PATH_BSHELL; --- 240 unchanged lines hidden --- | 355 (void)chown(ttyn, pwd->pw_uid, 356 (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid); 357 (void)setgid(pwd->pw_gid); 358 359 initgroups(username, pwd->pw_gid); 360 361 if (*pwd->pw_shell == '\0') 362 pwd->pw_shell = _PATH_BSHELL; --- 240 unchanged lines hidden --- |