From ba760a4075341dadc8067f0f79ff7950a4d86688 Mon Sep 17 00:00:00 2001 From: djm Date: Thu, 6 Oct 2022 22:42:37 +0000 Subject: [PATCH] honour user's umask if it is more restrictive then the ssh default (022); based on patch from Alex Henrie, ok dtucker@ deraadt@ --- usr.bin/ssh/ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 9fe9fb94100..1c40b5075b9 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.576 2022/09/17 10:33:18 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.577 2022/10/06 22:42:37 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -653,7 +653,7 @@ main(int ac, char **av) * writable only by the owner, which is ok for all files for which we * don't set the modes explicitly. */ - umask(022); + umask(022 | umask(077)); setlocale(LC_CTYPE, ""); -- 2.20.1