- (dtucker) [ssh-rand-helper.c loginrec.c]
Apply atomicio typing change to these too.
This commit is contained in:
parent
0a4f04b5b2
commit
8661b56903
|
@ -1,3 +1,7 @@
|
|||
20030706
|
||||
- (dtucker) [ssh-rand-helper.c loginrec.c]
|
||||
Apply atomicio typing change to these too.
|
||||
|
||||
20030703
|
||||
- (dtucker) OpenBSD CVS Sync
|
||||
- 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.
|
||||
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 $
|
||||
|
|
10
loginrec.c
10
loginrec.c
|
@ -158,7 +158,7 @@
|
|||
#include "log.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
|
||||
# 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);
|
||||
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",
|
||||
UTMP_FILE, strerror(errno));
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ wtmp_write(struct logininfo *li, struct utmp *ut)
|
|||
return 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);
|
||||
logit("wtmp_write: problem writing %s: %s",
|
||||
WTMP_FILE, strerror(errno));
|
||||
|
@ -1193,7 +1193,7 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
|
|||
}
|
||||
|
||||
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);
|
||||
logit("wtmpx_write: problem writing %s: %s",
|
||||
WTMPX_FILE, strerror(errno));
|
||||
|
@ -1482,7 +1482,7 @@ lastlog_perform_login(struct logininfo *li)
|
|||
return(0);
|
||||
|
||||
/* write the entry */
|
||||
if (atomicio(write, fd, &last, sizeof(last)) != sizeof(last)) {
|
||||
if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
|
||||
close(fd);
|
||||
logit("lastlog_write_filemode: Error writing to %s: %s",
|
||||
LASTLOG_FILE, strerror(errno));
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "pathnames.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 */
|
||||
#define OUTPUT_SEED_SIZE 48
|
||||
|
@ -187,7 +187,7 @@ reopen:
|
|||
msg[0] = 0x02;
|
||||
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) {
|
||||
close(fd);
|
||||
errors++;
|
||||
|
@ -572,7 +572,7 @@ prng_write_seedfile(void)
|
|||
debug("WARNING: couldn't access PRNG seedfile %.100s "
|
||||
"(%.100s)", filename, strerror(errno));
|
||||
} 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 "
|
||||
"(%.100s)", filename, strerror(errno));
|
||||
close(fd);
|
||||
|
@ -858,7 +858,7 @@ main(int argc, char **argv)
|
|||
printf("%02x", (unsigned char)(buf[ret]));
|
||||
printf("\n");
|
||||
} else
|
||||
ret = atomicio(write, STDOUT_FILENO, buf, bytes);
|
||||
ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
|
||||
|
||||
memset(buf, '\0', bytes);
|
||||
xfree(buf);
|
||||
|
|
Loading…
Reference in New Issue