summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-05-17 22:24:56 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-05-17 22:24:56 +1000
commitf58b29d51508057e729cd142396e28505bae50ab (patch)
treed2baf72007642780af8e53c5463d306d13332cbc
parent73373877db052f11bf73349e8ce3d698105b109b (diff)
- (dtucker) [ssh-rand-helper.c] Check return code of mkdir and fix file
pointer leak. From kjhall at us.ibm.com, found by coverity.
-rw-r--r--ChangeLog6
-rw-r--r--ssh-rand-helper.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ea73cf2ac..8dc22c86b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120050517
2 - (dtucker) [ssh-rand-helper.c] Check return code of mkdir and fix file
3 pointer leak. From kjhall at us.ibm.com, found by coverity.
4
120050515 520050515
2 - (dtucker) [openbsd-compat/getrrsetbyname.c] Use _compat_res instead of 6 - (dtucker) [openbsd-compat/getrrsetbyname.c] Use _compat_res instead of
3 _res, prevents problems on some platforms that have _res as a global but 7 _res, prevents problems on some platforms that have _res as a global but
@@ -4621,4 +4625,4 @@
4621 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4625 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4622 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4626 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4623 4627
4624$Id: ChangeLog,v 1.4328 2006/05/15 07:24:25 dtucker Exp $ 4628$Id: ChangeLog,v 1.4329 2006/05/17 12:24:56 dtucker Exp $
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index 3a4a165fa..d88a246eb 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -573,7 +573,8 @@ prng_write_seedfile(void)
573 /* Try to ensure that the parent directory is there */ 573 /* Try to ensure that the parent directory is there */
574 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 574 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
575 _PATH_SSH_USER_DIR); 575 _PATH_SSH_USER_DIR);
576 mkdir(filename, 0700); 576 if (mkdir(filename, 0700) < 0)
577 fatal("mkdir: %s", strerror(errno));
577 578
578 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 579 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
579 SSH_PRNG_SEED_FILE); 580 SSH_PRNG_SEED_FILE);
@@ -782,6 +783,7 @@ prng_read_commands(char *cmdfilename)
782 debug("Loaded %d entropy commands from %.100s", cur_cmd, 783 debug("Loaded %d entropy commands from %.100s", cur_cmd,
783 cmdfilename); 784 cmdfilename);
784 785
786 fclose(f);
785 return cur_cmd < MIN_ENTROPY_SOURCES ? -1 : 0; 787 return cur_cmd < MIN_ENTROPY_SOURCES ? -1 : 0;
786} 788}
787 789