# HG changeset patch # User masneyb # Date 1092106535 0 # Node ID c36a475ecf5aeeb50c3f08bfb7d7d392aa53cd9a # Parent d32b05e0728458ad8754292bac9f42f05035a64c 2004-8-9 Brian Masney * lib/sshv2.c - fixes so that file permissions are preserved properly on file upload. Fixes so that the Utime and Chmod commands are shown in the log window diff -r d32b05e07284 -r c36a475ecf5a ChangeLog --- a/ChangeLog Tue Aug 10 02:29:09 2004 +0000 +++ b/ChangeLog Tue Aug 10 02:55:35 2004 +0000 @@ -1,4 +1,8 @@ 2004-8-9 Brian Masney + * lib/sshv2.c - fixes so that file permissions are preserved properly + on file upload. Fixes so that the Utime and Chmod commands are shown + in the log window + * lib/sshv2.c (sshv2_setup_file_offset) - added buf argument to this function so that uploading files will work again @@ -2722,7 +2726,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.303 2004/08/10 02:29:09 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.304 2004/08/10 02:55:35 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r d32b05e07284 -r c36a475ecf5a lib/sshv2.c --- a/lib/sshv2.c Tue Aug 10 02:29:09 2004 +0000 +++ b/lib/sshv2.c Tue Aug 10 02:55:35 2004 +0000 @@ -561,13 +561,16 @@ case SSH_FXP_SETSTAT: memcpy (&num, message + 4, 4); num = ntohl (num); - pos = message + 12 + num - 1; - oldchar = *pos; - *pos = '\0'; + memcpy (&stattype, message + 8 + num, 4); stattype = ntohl (stattype); memcpy (&attr, message + 12 + num, 4); attr = ntohl (attr); + + pos = message + 8 + num; + oldchar = *pos; + *pos = '\0'; + switch (stattype) { case SSH_FILEXFER_ATTR_PERMISSIONS: @@ -580,6 +583,7 @@ _("%d: Utime %s %d\n"), id, message + 8, attr); } + *pos = oldchar; break; case SSH_FXP_STATUS: @@ -1493,7 +1497,7 @@ num = htonl (SSH_FILEXFER_ATTR_PERMISSIONS); memcpy (endpos, &num, 4); - g_snprintf (buf, sizeof (buf), "%d", mode); + g_snprintf (buf, sizeof (buf), "%o", mode); num = htonl (strtol (buf, NULL, 8)); memcpy (endpos + 4, &num, 4);