diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/authfile.c | 18 | ||||
-rw-r--r-- | usr.bin/ssh/login.c | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c index 14e7afb555a..ac2aa0fc9e4 100644 --- a/usr.bin/ssh/authfile.c +++ b/usr.bin/ssh/authfile.c @@ -15,7 +15,7 @@ for reading the passphrase from the user. */ #include "includes.h" -RCSID("$Id: authfile.c,v 1.4 1999/09/30 16:34:21 provos Exp $"); +RCSID("$Id: authfile.c,v 1.5 1999/09/30 16:55:06 deraadt Exp $"); #include <ssl/bn.h> #include "xmalloc.h" @@ -134,7 +134,7 @@ load_public_key(const char *filename, RSA *pub, char **comment_return) { int f, i; - unsigned long len; + off_t len; Buffer buffer; char *cp; @@ -143,13 +143,13 @@ load_public_key(const char *filename, RSA *pub, if (f < 0) return 0; - len = lseek(f, (off_t)0L, 2); - lseek(f, (off_t)0L, 0); + len = lseek(f, (off_t)0, SEEK_END); + lseek(f, (off_t)0, SEEK_SET); buffer_init(&buffer); buffer_append_space(&buffer, &cp, len); - if (read(f, cp, len) != len) + if (read(f, cp, (size_t)len) != (size_t)len) { debug("Read from key file %.200s failed: %.100s", filename, strerror(errno)); @@ -205,7 +205,7 @@ load_private_key(const char *filename, const char *passphrase, RSA *prv, char **comment_return) { int f, i, check1, check2, cipher_type; - unsigned long len; + off_t len; Buffer buffer, decrypted; char *cp; CipherContext cipher; @@ -217,13 +217,13 @@ load_private_key(const char *filename, const char *passphrase, if (f < 0) return 0; - len = lseek(f, (off_t)0L, 2); - lseek(f, (off_t)0L, 0); + len = lseek(f, (off_t)0, SEEK_END); + lseek(f, (off_t)0, SEEK_SET); buffer_init(&buffer); buffer_append_space(&buffer, &cp, len); - if (read(f, cp, len) != len) + if (read(f, cp, (size_t)len) != (size_t)len) { debug("Read from key file %.200s failed: %.100s", filename, strerror(errno)); diff --git a/usr.bin/ssh/login.c b/usr.bin/ssh/login.c index 66f111e3c7c..7eb13b12849 100644 --- a/usr.bin/ssh/login.c +++ b/usr.bin/ssh/login.c @@ -18,7 +18,7 @@ on a tty. */ #include "includes.h" -RCSID("$Id: login.c,v 1.6 1999/09/30 05:43:33 deraadt Exp $"); +RCSID("$Id: login.c,v 1.7 1999/09/30 16:55:06 deraadt Exp $"); #include <util.h> #include <utmp.h> @@ -45,7 +45,7 @@ unsigned long get_last_login_time(uid_t uid, const char *logname, fd = open(lastlog, O_RDONLY); if (fd < 0) return 0; - lseek(fd, (off_t)((long)uid * sizeof(ll)), 0); + lseek(fd, (off_t)((long)uid * sizeof(ll)), SEEK_SET); if (read(fd, &ll, sizeof(ll)) != sizeof(ll)) { close(fd); @@ -101,7 +101,7 @@ void record_login(int pid, const char *ttyname, const char *user, uid_t uid, fd = open(lastlog, O_RDWR); if (fd >= 0) { - lseek(fd, (off_t)((long)uid * sizeof(ll)), 0); + lseek(fd, (off_t)((long)uid * sizeof(ll)), SEEK_SET); if (write(fd, &ll, sizeof(ll)) != sizeof(ll)) log("Could not write %.100s: %.100s", lastlog, strerror(errno)); close(fd); |