From 761acbad30f385066bcb4a9ec59166e802b2944c Mon Sep 17 00:00:00 2001 From: millert <> Date: Mon, 13 Jul 1998 02:11:13 +0000 Subject: [PATCH] ftpd: sleep for an indeterminate amount for non-existant logins to simulate a crypt, like login does. Use SEEK_* not L_* and kill some 0L's used in lseek while we're there. --- src/lib/libutil/login.c | 8 ++++---- src/lib/libutil/logout.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/libutil/login.c b/src/lib/libutil/login.c index 134d7ae8..e0555ee0 100644 --- a/src/lib/libutil/login.c +++ b/src/lib/libutil/login.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login.c,v 1.4 1998/07/10 21:40:20 millert Exp $ */ +/* $OpenBSD: login.c,v 1.5 1998/07/13 02:11:12 millert Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /* from: static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93"; */ -static char *rcsid = "$Id: login.c,v 1.4 1998/07/10 21:40:20 millert Exp $"; +static char *rcsid = "$Id: login.c,v 1.5 1998/07/13 02:11:12 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -57,7 +57,7 @@ login(utp) tty = ttyslot(); if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) { - (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), L_SET); + (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); /* * Prevent luser from zero'ing out ut_host. * If the new ut_line is empty but the old one is not @@ -69,7 +69,7 @@ login(utp) strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 && strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0) (void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE); - (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), L_SET); + (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); (void)write(fd, utp, sizeof(struct utmp)); (void)close(fd); } diff --git a/src/lib/libutil/logout.c b/src/lib/libutil/logout.c index 2276167e..ca7c6873 100644 --- a/src/lib/libutil/logout.c +++ b/src/lib/libutil/logout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logout.c,v 1.3 1996/06/17 07:46:03 downsj Exp $ */ +/* $OpenBSD: logout.c,v 1.4 1998/07/13 02:11:13 millert Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /* from: static char sccsid[] = "@(#)logout.c 8.1 (Berkeley) 6/4/93"; */ -static char *rcsid = "$Id: logout.c,v 1.3 1996/06/17 07:46:03 downsj Exp $"; +static char *rcsid = "$Id: logout.c,v 1.4 1998/07/13 02:11:13 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -66,7 +66,7 @@ logout(line) bzero(ut.ut_name, UT_NAMESIZE); bzero(ut.ut_host, UT_HOSTSIZE); (void)time(&ut.ut_time); - (void)lseek(fd, -(off_t)sizeof(UTMP), L_INCR); + (void)lseek(fd, -(off_t)sizeof(UTMP), SEEK_CUR); (void)write(fd, &ut, sizeof(UTMP)); rval = 1; }