diff options
author | Damien Miller <djm@mindrot.org> | 1999-12-13 08:27:33 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-12-13 08:27:33 +1100 |
commit | c6b3bbe2b991f4f87ca1f8214f43c13a5a73f385 (patch) | |
tree | 5eadc1e35464be6ec748793060d92b12fa637052 /bsd-login.c | |
parent | 4e0dbd07cf1021897210c11a16fd05f207d95b8e (diff) |
- Fix compilation on systems with AFS. Reported by
aloomis@glue.umd.edu
- Fix installation on Solaris. Reported by
Gordon Rowell <gordonr@gormand.com.au>
- Fix gccisms (__attribute__ and inline). Report by edgy@us.ibm.com,
patch from Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
- Auto-locate xauth. Patch from David Agraz <dagraz@jahoopa.com>
- Compile fix from David Agraz <dagraz@jahoopa.com>
- Avoid compiler warning in bsd-snprintf.c
- Added pam_limits.so to default PAM config. Suggested by
Jim Knoble <jmknoble@pobox.com>
Diffstat (limited to 'bsd-login.c')
-rw-r--r-- | bsd-login.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bsd-login.c b/bsd-login.c index 9c1206547..a2ec74142 100644 --- a/bsd-login.c +++ b/bsd-login.c | |||
@@ -52,6 +52,7 @@ static char *rcsid = "$OpenBSD: login.c,v 1.5 1998/07/13 02:11:12 millert Exp $" | |||
52 | # include <utmp.h> | 52 | # include <utmp.h> |
53 | #endif | 53 | #endif |
54 | #include <stdio.h> | 54 | #include <stdio.h> |
55 | #include <string.h> | ||
55 | 56 | ||
56 | void | 57 | void |
57 | login(utp) | 58 | login(utp) |
@@ -78,7 +79,7 @@ login(utp) | |||
78 | 79 | ||
79 | tty = ttyslot(); | 80 | tty = ttyslot(); |
80 | if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) { | 81 | if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) { |
81 | #ifdef HAVE_HOST_IN_UTMP || HAVE_HOST_IN_UTMPX | 82 | #if defined(HAVE_HOST_IN_UTMP) || defined(HAVE_HOST_IN_UTMPX) |
82 | (void)lseek(fd, (off_t)(tty * sizeof(struct UTMP_STR)), SEEK_SET); | 83 | (void)lseek(fd, (off_t)(tty * sizeof(struct UTMP_STR)), SEEK_SET); |
83 | /* | 84 | /* |
84 | * Prevent luser from zero'ing out ut_host. | 85 | * Prevent luser from zero'ing out ut_host. |
@@ -91,7 +92,7 @@ login(utp) | |||
91 | strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 && | 92 | strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 && |
92 | strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0) | 93 | strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0) |
93 | (void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE); | 94 | (void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE); |
94 | #endif /* HAVE_HOST_IN_UTMP || HAVE_HOST_IN_UTMPX */ | 95 | #endif /* defined(HAVE_HOST_IN_UTMP) || defined(HAVE_HOST_IN_UTMPX) */ |
95 | (void)lseek(fd, (off_t)(tty * sizeof(struct UTMP_STR)), SEEK_SET); | 96 | (void)lseek(fd, (off_t)(tty * sizeof(struct UTMP_STR)), SEEK_SET); |
96 | (void)write(fd, utp, sizeof(struct UTMP_STR)); | 97 | (void)write(fd, utp, sizeof(struct UTMP_STR)); |
97 | (void)close(fd); | 98 | (void)close(fd); |