Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 46CD6200D61 for ; Tue, 19 Dec 2017 14:20:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 45536160C1B; Tue, 19 Dec 2017 13:20:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 95D51160C18 for ; Tue, 19 Dec 2017 14:20:07 +0100 (CET) Received: (qmail 36850 invoked by uid 500); 19 Dec 2017 13:20:06 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 36839 invoked by uid 99); 19 Dec 2017 13:20:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2017 13:20:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1C841C0886 for ; Tue, 19 Dec 2017 13:20:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id QxqrZmMS_WeH for ; Tue, 19 Dec 2017 13:20:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4D2405F65C for ; Tue, 19 Dec 2017 13:20:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8A750E0140 for ; Tue, 19 Dec 2017 13:20:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 499A0212F8 for ; Tue, 19 Dec 2017 13:20:00 +0000 (UTC) Date: Tue, 19 Dec 2017 13:20:00 +0000 (UTC) From: "Zoltan Levardy (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (VFS-590) SFTP moveTo operation might fail on permission checks even if the operation itself might succeed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 19 Dec 2017 13:20:08 -0000 [ https://issues.apache.org/jira/browse/VFS-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16296774#comment-16296774 ] Zoltan Levardy commented on VFS-590: ------------------------------------ is this something solvable with jsch and vfs? > SFTP moveTo operation might fail on permission checks even if the operation itself might succeed > ------------------------------------------------------------------------------------------------ > > Key: VFS-590 > URL: https://issues.apache.org/jira/browse/VFS-590 > Project: Commons VFS > Issue Type: Bug > Affects Versions: Nightly Builds > Reporter: L > > Continuing with SFTP moveTo, see VFS-588 and VFS-589 for more details. > The permission checks that VFS performs during moveTo() can result in failure. > org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(final FileObject destFile) starts with some checks: > {code:java} > @Override > public void moveTo(final FileObject destFile) throws FileSystemException > { > if (canRenameTo(destFile)) > { > if (!getParent().isWriteable()) > { > throw new FileSystemException("vfs.provider/rename-parent-read-only.error", > getName(), > getParent().getName()); > } > } > else > { > if (!isWriteable()) > { > throw new FileSystemException("vfs.provider/rename-read-only.error", getName()); > } > } > {code} > The problem is: isWriteable() might fail or even hang. Performing moveTo without this check might successfully rename the file. > isWriteable() in case of SFTP can fail if the server disables SSH channelExec. Or if it does not support "id" command. -- This message was sent by Atlassian JIRA (v6.4.14#64029)