- (dtucker) [ssh-rand-helper.c loginrec.c]

Apply atomicio typing change to these too.
This commit is contained in:
Darren Tucker 2003-07-06 15:20:46 +10:00
parent 0a4f04b5b2
commit 8661b56903
3 changed files with 14 additions and 10 deletions

View File

@ -1,3 +1,7 @@
20030706
- (dtucker) [ssh-rand-helper.c loginrec.c]
Apply atomicio typing change to these too.
20030703 20030703
- (dtucker) OpenBSD CVS Sync - (dtucker) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2003/06/28 07:48:10 - djm@cvs.openbsd.org 2003/06/28 07:48:10
@ -654,4 +658,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au Report from murple@murple.net, diagnosis from dtucker@zip.com.au
$Id: ChangeLog,v 1.2844 2003/07/03 10:37:47 dtucker Exp $ $Id: ChangeLog,v 1.2845 2003/07/06 05:20:46 dtucker Exp $

View File

@ -158,7 +158,7 @@
#include "log.h" #include "log.h"
#include "atomicio.h" #include "atomicio.h"
RCSID("$Id: loginrec.c,v 1.51 2003/05/10 13:42:12 djm Exp $"); RCSID("$Id: loginrec.c,v 1.52 2003/07/06 05:20:46 dtucker Exp $");
#ifdef HAVE_UTIL_H #ifdef HAVE_UTIL_H
# include <util.h> # include <util.h>
@ -837,7 +837,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
} }
(void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut))
logit("utmp_write_direct: error writing %s: %s", logit("utmp_write_direct: error writing %s: %s",
UTMP_FILE, strerror(errno)); UTMP_FILE, strerror(errno));
@ -1026,7 +1026,7 @@ wtmp_write(struct logininfo *li, struct utmp *ut)
return 0; return 0;
} }
if (fstat(fd, &buf) == 0) if (fstat(fd, &buf) == 0)
if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) { if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
ftruncate(fd, buf.st_size); ftruncate(fd, buf.st_size);
logit("wtmp_write: problem writing %s: %s", logit("wtmp_write: problem writing %s: %s",
WTMP_FILE, strerror(errno)); WTMP_FILE, strerror(errno));
@ -1193,7 +1193,7 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
} }
if (fstat(fd, &buf) == 0) if (fstat(fd, &buf) == 0)
if (atomicio(write, fd, utx, sizeof(*utx)) != sizeof(*utx)) { if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
ftruncate(fd, buf.st_size); ftruncate(fd, buf.st_size);
logit("wtmpx_write: problem writing %s: %s", logit("wtmpx_write: problem writing %s: %s",
WTMPX_FILE, strerror(errno)); WTMPX_FILE, strerror(errno));
@ -1482,7 +1482,7 @@ lastlog_perform_login(struct logininfo *li)
return(0); return(0);
/* write the entry */ /* write the entry */
if (atomicio(write, fd, &last, sizeof(last)) != sizeof(last)) { if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
close(fd); close(fd);
logit("lastlog_write_filemode: Error writing to %s: %s", logit("lastlog_write_filemode: Error writing to %s: %s",
LASTLOG_FILE, strerror(errno)); LASTLOG_FILE, strerror(errno));

View File

@ -39,7 +39,7 @@
#include "pathnames.h" #include "pathnames.h"
#include "log.h" #include "log.h"
RCSID("$Id: ssh-rand-helper.c,v 1.11 2003/05/16 05:51:45 djm Exp $"); RCSID("$Id: ssh-rand-helper.c,v 1.12 2003/07/06 05:20:46 dtucker Exp $");
/* Number of bytes we write out */ /* Number of bytes we write out */
#define OUTPUT_SEED_SIZE 48 #define OUTPUT_SEED_SIZE 48
@ -187,7 +187,7 @@ reopen:
msg[0] = 0x02; msg[0] = 0x02;
msg[1] = len; msg[1] = len;
if (atomicio(write, fd, msg, sizeof(msg)) != sizeof(msg)) { if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) {
if (errno == EPIPE && errors < 10) { if (errno == EPIPE && errors < 10) {
close(fd); close(fd);
errors++; errors++;
@ -572,7 +572,7 @@ prng_write_seedfile(void)
debug("WARNING: couldn't access PRNG seedfile %.100s " debug("WARNING: couldn't access PRNG seedfile %.100s "
"(%.100s)", filename, strerror(errno)); "(%.100s)", filename, strerror(errno));
} else { } else {
if (atomicio(write, fd, &seed, sizeof(seed)) < sizeof(seed)) if (atomicio(vwrite, fd, &seed, sizeof(seed)) < sizeof(seed))
fatal("problem writing PRNG seedfile %.100s " fatal("problem writing PRNG seedfile %.100s "
"(%.100s)", filename, strerror(errno)); "(%.100s)", filename, strerror(errno));
close(fd); close(fd);
@ -858,7 +858,7 @@ main(int argc, char **argv)
printf("%02x", (unsigned char)(buf[ret])); printf("%02x", (unsigned char)(buf[ret]));
printf("\n"); printf("\n");
} else } else
ret = atomicio(write, STDOUT_FILENO, buf, bytes); ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
memset(buf, '\0', bytes); memset(buf, '\0', bytes);
xfree(buf); xfree(buf);