]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- djm@cvs.openbsd.org 2003/01/06 23:51:22
authorDamien Miller <djm@mindrot.org>
Wed, 8 Jan 2003 03:04:53 +0000 (14:04 +1100)
committerDamien Miller <djm@mindrot.org>
Wed, 8 Jan 2003 03:04:53 +0000 (14:04 +1100)
     [sftp-client.c]
     Fix "get -p" download to not add user-write perm. mindrot bug #426
     reported by gfernandez@livevault.com; ok markus@

ChangeLog
sftp-client.c

index 35b35c1d2843fd235b071a454e49179ee0a4d3ef..3d489ed24bd73216943178de5dce26646ae8156f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
    - markus@cvs.openbsd.org 2003/01/01 18:08:52
      [channels.c]
      move big output buffer messages to debug2
+   - djm@cvs.openbsd.org 2003/01/06 23:51:22
+     [sftp-client.c]
+     Fix "get -p" download to not add user-write perm. mindrot bug #426
+     reported by gfernandez@livevault.com; ok markus@
 
 20030107
  - (djm) Bug #401: Work around Linux breakage with IPv6 mapped addresses. 
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-$Id: ChangeLog,v 1.2551 2003/01/08 03:04:09 djm Exp $
+$Id: ChangeLog,v 1.2552 2003/01/08 03:04:53 djm Exp $
index df9838648f99466cd1e9d98a1398a12d8cac33b8..bff37073c4f44c719b98004d54950ceecfb86c99 100644 (file)
@@ -28,7 +28,7 @@
 /* XXX: copy between two remote sites */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.37 2002/11/21 23:03:51 deraadt Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.38 2003/01/06 23:51:22 djm Exp $");
 
 #include "openbsd-compat/sys-queue.h"
 
@@ -758,7 +758,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
 
        /* XXX: should we preserve set[ug]id? */
        if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS)
-               mode = S_IWRITE | (a->perm & 0777);
+               mode = a->perm & 0777;
        else
                mode = 0666;
 
@@ -793,7 +793,8 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
                return(-1);
        }
 
-       local_fd = open(local_path, O_WRONLY | O_CREAT | O_TRUNC, mode);
+       local_fd = open(local_path, O_WRONLY | O_CREAT | O_TRUNC, 
+           mode | S_IWRITE);
        if (local_fd == -1) {
                error("Couldn't open local file \"%s\" for writing: %s",
                    local_path, strerror(errno));