[openssh-commits] [openssh] 05/08: upstream: Apply umask to all incoming files and directories not

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jun 4 14:54:57 AEST 2018


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

djm pushed a commit to branch master
in repository openssh.

commit e5019da3c5a31e6e729a565f2b886a80c4be96cc
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Fri Jun 1 04:31:48 2018 +0000

    upstream: Apply umask to all incoming files and directories not
    
    just files. This makes sure it gets applied to directories too, and prevents
    a race where files get chmodded after creation.  bz#2839, ok djm@
    
    OpenBSD-Commit-ID: 3168ee6c7c39093adac4fd71039600cfa296203b
---
 scp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scp.c b/scp.c
index 80aed84b..60682c68 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.196 2018/04/10 00:10:49 djm Exp $ */
+/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
@@ -1092,6 +1092,8 @@ sink(int argc, char **argv)
 				SCREWUP("bad mode");
 			mode = (mode << 3) | (*cp - '0');
 		}
+		if (!pflag)
+			mode &= ~mask;
 		if (*cp++ != ' ')
 			SCREWUP("mode not delimited");
 

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


More information about the openssh-commits mailing list