summaryrefslogtreecommitdiff
path: root/ssh-rand-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-rand-helper.c')
-rw-r--r--ssh-rand-helper.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index 68b77b208..7e65e4569 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -39,7 +39,7 @@
39#include "pathnames.h" 39#include "pathnames.h"
40#include "log.h" 40#include "log.h"
41 41
42RCSID("$Id: ssh-rand-helper.c,v 1.10 2003/03/17 05:13:53 djm Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.13 2003/08/21 23:34:41 djm Exp $");
43 43
44/* Number of bytes we write out */ 44/* Number of bytes we write out */
45#define OUTPUT_SEED_SIZE 48 45#define OUTPUT_SEED_SIZE 48
@@ -187,7 +187,7 @@ reopen:
187 msg[0] = 0x02; 187 msg[0] = 0x02;
188 msg[1] = len; 188 msg[1] = len;
189 189
190 if (atomicio(write, fd, msg, sizeof(msg)) != sizeof(msg)) { 190 if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) {
191 if (errno == EPIPE && errors < 10) { 191 if (errno == EPIPE && errors < 10) {
192 close(fd); 192 close(fd);
193 errors++; 193 errors++;
@@ -532,7 +532,7 @@ prng_check_seedfile(char *filename)
532 /* mode 0600, owned by root or the current user? */ 532 /* mode 0600, owned by root or the current user? */
533 if (((st.st_mode & 0177) != 0) || !(st.st_uid == getuid())) { 533 if (((st.st_mode & 0177) != 0) || !(st.st_uid == getuid())) {
534 debug("WARNING: PRNG seedfile %.100s must be mode 0600, " 534 debug("WARNING: PRNG seedfile %.100s must be mode 0600, "
535 "owned by uid %d", filename, getuid()); 535 "owned by uid %li", filename, (long int)getuid());
536 return 0; 536 return 0;
537 } 537 }
538 538
@@ -550,7 +550,7 @@ prng_write_seedfile(void)
550 pw = getpwuid(getuid()); 550 pw = getpwuid(getuid());
551 if (pw == NULL) 551 if (pw == NULL)
552 fatal("Couldn't get password entry for current user " 552 fatal("Couldn't get password entry for current user "
553 "(%i): %s", getuid(), strerror(errno)); 553 "(%li): %s", (long int)getuid(), strerror(errno));
554 554
555 /* Try to ensure that the parent directory is there */ 555 /* Try to ensure that the parent directory is there */
556 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 556 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
@@ -572,7 +572,7 @@ prng_write_seedfile(void)
572 debug("WARNING: couldn't access PRNG seedfile %.100s " 572 debug("WARNING: couldn't access PRNG seedfile %.100s "
573 "(%.100s)", filename, strerror(errno)); 573 "(%.100s)", filename, strerror(errno));
574 } else { 574 } else {
575 if (atomicio(write, fd, &seed, sizeof(seed)) < sizeof(seed)) 575 if (atomicio(vwrite, fd, &seed, sizeof(seed)) < sizeof(seed))
576 fatal("problem writing PRNG seedfile %.100s " 576 fatal("problem writing PRNG seedfile %.100s "
577 "(%.100s)", filename, strerror(errno)); 577 "(%.100s)", filename, strerror(errno));
578 close(fd); 578 close(fd);
@@ -589,7 +589,7 @@ prng_read_seedfile(void)
589 pw = getpwuid(getuid()); 589 pw = getpwuid(getuid());
590 if (pw == NULL) 590 if (pw == NULL)
591 fatal("Couldn't get password entry for current user " 591 fatal("Couldn't get password entry for current user "
592 "(%i): %s", getuid(), strerror(errno)); 592 "(%li): %s", (long int)getuid(), strerror(errno));
593 593
594 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 594 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
595 SSH_PRNG_SEED_FILE); 595 SSH_PRNG_SEED_FILE);
@@ -769,7 +769,7 @@ main(int argc, char **argv)
769 extern char *optarg; 769 extern char *optarg;
770 LogLevel ll; 770 LogLevel ll;
771 771
772 __progname = get_progname(argv[0]); 772 __progname = ssh_get_progname(argv[0]);
773 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); 773 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
774 774
775 ll = SYSLOG_LEVEL_INFO; 775 ll = SYSLOG_LEVEL_INFO;
@@ -858,7 +858,7 @@ main(int argc, char **argv)
858 printf("%02x", (unsigned char)(buf[ret])); 858 printf("%02x", (unsigned char)(buf[ret]));
859 printf("\n"); 859 printf("\n");
860 } else 860 } else
861 ret = atomicio(write, STDOUT_FILENO, buf, bytes); 861 ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
862 862
863 memset(buf, '\0', bytes); 863 memset(buf, '\0', bytes);
864 xfree(buf); 864 xfree(buf);