[openssh-commits] [openssh] 01/01: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Jan 27 00:37:48 AEDT 2015


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 3076ee7d530d5b16842fac7a6229706c7e5acd26
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Mon Jan 26 13:36:53 2015 +0000

    upstream commit
    
    properly restore umask
---
 hostfile.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hostfile.c b/hostfile.c
index 9de1b38..ea6bc6f 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.62 2015/01/26 03:04:45 djm Exp $ */
+/* $OpenBSD: hostfile.c,v 1.63 2015/01/26 13:36:53 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -551,6 +551,8 @@ hostfile_replace_entries(const char *filename, const char *host,
 	mode_t omask;
 	size_t i;
 
+	omask = umask(077);
+
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.host = host;
 	ctx.quiet = quiet;
@@ -568,7 +570,6 @@ hostfile_replace_entries(const char *filename, const char *host,
 		goto fail;
 	}
 
-	omask = umask(077);
 	if ((fd = mkstemp(temp)) == -1) {
 		oerrno = errno;
 		error("%s: mkstemp: %s", __func__, strerror(oerrno));
@@ -636,6 +637,7 @@ hostfile_replace_entries(const char *filename, const char *host,
 	if (ctx.out != NULL)
 		fclose(ctx.out);
 	free(ctx.skip_keys);
+	umask(omask);
 	if (r == SSH_ERR_SYSTEM_ERROR)
 		errno = oerrno;
 	return r;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list