summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-10-02 00:29:00 +0000
committerKevin Steves <stevesk@pobox.com>2001-10-02 00:29:00 +0000
commit5217265349e999c2c2131f41261e47025bc80308 (patch)
treec5fc15680c279dea826b7fa92c06bd8d86debb32 /loginrec.c
parent819f1bef5c1baf684afcc5aef4d743f16e0c376b (diff)
- (stevesk) loginrec.c: fix type conversion problems exposed when using
64-bit off_t.
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/loginrec.c b/loginrec.c
index 5789aad76..140cd3f64 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -163,7 +163,7 @@
163#include "log.h" 163#include "log.h"
164#include "atomicio.h" 164#include "atomicio.h"
165 165
166RCSID("$Id: loginrec.c,v 1.34 2001/08/06 23:29:17 mouring Exp $"); 166RCSID("$Id: loginrec.c,v 1.35 2001/10/02 00:29:00 stevesk Exp $");
167 167
168#ifdef HAVE_UTIL_H 168#ifdef HAVE_UTIL_H
169# include <util.h> 169# include <util.h>
@@ -1095,7 +1095,7 @@ wtmp_get_entry(struct logininfo *li)
1095 } 1095 }
1096 1096
1097 /* Seek to the start of the last struct utmp */ 1097 /* Seek to the start of the last struct utmp */
1098 if (lseek(fd, (off_t)(0 - sizeof(struct utmp)), SEEK_END) == -1) { 1098 if (lseek(fd, -(off_t)sizeof(struct utmp), SEEK_END) == -1) {
1099 /* Looks like we've got a fresh wtmp file */ 1099 /* Looks like we've got a fresh wtmp file */
1100 close(fd); 1100 close(fd);
1101 return 0; 1101 return 0;
@@ -1128,7 +1128,7 @@ wtmp_get_entry(struct logininfo *li)
1128 continue; 1128 continue;
1129 } 1129 }
1130 /* Seek back 2 x struct utmp */ 1130 /* Seek back 2 x struct utmp */
1131 if (lseek(fd, (off_t)(0-2*sizeof(struct utmp)), SEEK_CUR) == -1) { 1131 if (lseek(fd, -(off_t)(2 * sizeof(struct utmp)), SEEK_CUR) == -1) {
1132 /* We've found the start of the file, so quit */ 1132 /* We've found the start of the file, so quit */
1133 close (fd); 1133 close (fd);
1134 return 0; 1134 return 0;
@@ -1251,7 +1251,7 @@ wtmpx_get_entry(struct logininfo *li)
1251 } 1251 }
1252 1252
1253 /* Seek to the start of the last struct utmpx */ 1253 /* Seek to the start of the last struct utmpx */
1254 if (lseek(fd, (off_t)(0-sizeof(struct utmpx)), SEEK_END) == -1 ) { 1254 if (lseek(fd, -(off_t)sizeof(struct utmpx), SEEK_END) == -1 ) {
1255 /* probably a newly rotated wtmpx file */ 1255 /* probably a newly rotated wtmpx file */
1256 close(fd); 1256 close(fd);
1257 return 0; 1257 return 0;
@@ -1281,7 +1281,7 @@ wtmpx_get_entry(struct logininfo *li)
1281# endif 1281# endif
1282 continue; 1282 continue;
1283 } 1283 }
1284 if (lseek(fd, (off_t)(0-2*sizeof(struct utmpx)), SEEK_CUR) == -1) { 1284 if (lseek(fd, -(off_t)(2 * sizeof(struct utmpx)), SEEK_CUR) == -1) {
1285 close (fd); 1285 close (fd);
1286 return 0; 1286 return 0;
1287 } 1287 }
@@ -1424,7 +1424,7 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
1424 1424
1425 if (type == LL_FILE) { 1425 if (type == LL_FILE) {
1426 /* find this uid's offset in the lastlog file */ 1426 /* find this uid's offset in the lastlog file */
1427 offset = (off_t) ( (long)li->uid * sizeof(struct lastlog)); 1427 offset = (off_t) ((long)li->uid * sizeof(struct lastlog));
1428 1428
1429 if ( lseek(*fd, offset, SEEK_SET) != offset ) { 1429 if ( lseek(*fd, offset, SEEK_SET) != offset ) {
1430 log("lastlog_openseek: %s->lseek(): %s", 1430 log("lastlog_openseek: %s->lseek(): %s",