www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: libssh2 master 04e79e0 sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN

Re: libssh2 master 04e79e0 sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Wed, 30 May 2012 15:12:35 +0100

On 30 May 2012 14:33, <libssh2_at_git.stuge.se> wrote:
> - Log -----------------------------------------------------------------
> commit 04e79e0c798674a0796be8a55f63dd92e6877790
> Author: Peter Stuge <peter_at_stuge.se>
> Commit: Peter Stuge <peter_at_stuge.se>
>
>    sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN
>
>    This works around a protocol violation in the ProFTPD 1.3.4 mod_sftp
>    server, as reported by Will Cosgrove in:
>
>    http://libssh2.org/mail/libssh2-devel-archive-2012-05/0079.shtml
>
>    Based on a suggested fix by TJ Saunders in:
>
>    http://libssh2.org/mail/libssh2-devel-archive-2012-05/0104.shtml
>
> diff --git a/src/sftp.c b/src/sftp.c
> index ec9d033..bd35141 100644
> --- a/src/sftp.c
> +++ b/src/sftp.c
> @@ -1024,9 +1024,7 @@ sftp_open(LIBSSH2_SFTP *sftp, const char *filename,
>     LIBSSH2_CHANNEL *channel = sftp->channel;
>     LIBSSH2_SESSION *session = channel->session;
>     LIBSSH2_SFTP_HANDLE *fp;
> -    LIBSSH2_SFTP_ATTRIBUTES attrs = {
> -        LIBSSH2_SFTP_ATTR_PERMISSIONS, 0, 0, 0, 0, 0, 0
> -    };
> +    LIBSSH2_SFTP_ATTRIBUTES attrs;
[snip]

Why was the initialisation of the attributes struct removed? Now the
struct has several uninitialised fields when it is passed to
sftp_attr2bin.

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-05-30

the libssh2 team