Github user mike-jumper commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-server/pull/11#discussion_r71967234
  
    --- Diff: src/protocols/vnc/vnc.c ---
    @@ -283,43 +283,32 @@ void* guac_vnc_client_thread(void* data) {
             /* Attempt SSH connection */
             vnc_client->sftp_session =
                 guac_common_ssh_create_session(client, settings->sftp_hostname,
    -                    settings->sftp_port, vnc_client->sftp_user);
    -
    -        /* Fail if SSH connection does not succeed */
    -        if (vnc_client->sftp_session == NULL) {
    -            /* Already aborted within guac_common_ssh_create_session() */
    -            guac_common_ssh_destroy_user(vnc_client->sftp_user);
    -            return NULL;
    -        }
    -
    -        /* Load filesystem */
    -        vnc_client->sftp_filesystem =
    -            guac_common_ssh_create_sftp_filesystem(
    -                    vnc_client->sftp_session, "/");
    -
    -        /* Expose filesystem to connection owner */
    -        guac_client_for_owner(client,
    -                guac_common_ssh_expose_sftp_filesystem,
    -                vnc_client->sftp_filesystem);
    -
    -        /* Abort if SFTP connection fails */
    -        if (vnc_client->sftp_filesystem == NULL) {
    -            guac_common_ssh_destroy_session(vnc_client->sftp_session);
    -            guac_common_ssh_destroy_user(vnc_client->sftp_user);
    -            guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
    -                    "SFTP connection failed.");
    -            return NULL;
    +                    settings->sftp_port, vnc_client->sftp_user, 0);
    +
    +        /* Try to initialize SFTP if connection succeeded */
    +        if (vnc_client->sftp_session != NULL) {
    +            /* Load filesystem */
    +            vnc_client->sftp_filesystem =
    +                guac_common_ssh_create_sftp_filesystem(
    +                        vnc_client->sftp_session, "/");
    +
    +            /* Expose filesystem to connection owner */
    +            guac_client_for_owner(client,
    +                    guac_common_ssh_expose_sftp_filesystem,
    +                    vnc_client->sftp_filesystem);
    +
    +            /* Verify SFTP connection succeeded */
    +            if (vnc_client->sftp_filesystem != NULL) {
    +                /* If specified, configure destination for basic uploads */
    +                if (settings->sftp_directory != NULL)
    +                    guac_common_ssh_sftp_set_upload_path(
    +                        vnc_client->sftp_filesystem,
    +                        settings->sftp_directory);
    +
    +                guac_client_log(client, GUAC_LOG_DEBUG,
    +                    "SFTP connection succeeded.");
    +            }
    --- End diff --
    
    Same deal here. It looks like the user and filesystem object cleanup was 
deleted without being re-added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to