summaryrefslogtreecommitdiff
path: root/bsd-login.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-13 08:27:33 +1100
committerDamien Miller <djm@mindrot.org>1999-12-13 08:27:33 +1100
commitc6b3bbe2b991f4f87ca1f8214f43c13a5a73f385 (patch)
tree5eadc1e35464be6ec748793060d92b12fa637052 /bsd-login.c
parent4e0dbd07cf1021897210c11a16fd05f207d95b8e (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.c5
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
56void 57void
57login(utp) 58login(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);