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 EAA1A200CAC for ; Mon, 19 Jun 2017 16:51:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E9A34160BE1; Mon, 19 Jun 2017 14:51:16 +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 3B036160BD5 for ; Mon, 19 Jun 2017 16:51:16 +0200 (CEST) Received: (qmail 17212 invoked by uid 500); 19 Jun 2017 14:51:10 -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 17196 invoked by uid 99); 19 Jun 2017 14:51:10 -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; Mon, 19 Jun 2017 14:51:10 +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 D0D39D2A97 for ; Mon, 19 Jun 2017 14:51:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[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 jB3ozQ7tUGrm for ; Mon, 19 Jun 2017 14:51:08 +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 469DB5F3FF for ; Mon, 19 Jun 2017 14:51:07 +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 D45DBE034F for ; Mon, 19 Jun 2017 14:51:05 +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 C7F1B24003 for ; Mon, 19 Jun 2017 14:51:01 +0000 (UTC) Date: Mon, 19 Jun 2017 14:51:01 +0000 (UTC) From: "Len (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (VFS-617) isReadable fails if unable to determine group identity MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 19 Jun 2017 14:51:17 -0000 [ https://issues.apache.org/jira/browse/VFS-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16054136#comment-16054136 ] Len commented on VFS-617: ------------------------- I had the same issue as L. If the user is only allowed sftp (no exec) this fails. I also ended up patching SftpFileObject.java as following: {code:java} protected PosixPermissions getPermissions(final boolean checkIds) throws Exception { statSelf(); /*boolean isInGroup = false; if (checkIds) { for (final int groupId : getAbstractFileSystem().getGroupsIds()) { if (groupId == attrs.getGId()) { isInGroup = true; break; } } } final boolean isOwner = checkIds ? attrs.getUId() == getAbstractFileSystem().getUId() : false;*/ return new PosixPermissions(attrs.getPermissions(), true, true); } {code} > isReadable fails if unable to determine group identity > ------------------------------------------------------ > > Key: VFS-617 > URL: https://issues.apache.org/jira/browse/VFS-617 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.1 > Environment: Windows 7 Java 7. Failure occured connecting via SFTP to a Synology box running DSM 6. > Reporter: Tim Nickels > > The doIsReadable method of SftpFileObject throws an exception if the system cannot identify group/owner permissions....... > Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Could not determine if file "sftp://myURI" is readable. > at org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1761) > at com.avenca.vfs.VFSUtils.main(VFSUtils.java:41) > Caused by: com.jcraft.jsch.JSchException: Could not get the groups id of the current user (error code: 1) > at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getGroupsIds(SftpFileSystem.java:263) > at org.apache.commons.vfs2.provider.sftp.SftpFileObject.getPermissions(SftpFileObject.java:317) > at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doIsReadable(SftpFileObject.java:335) > at org.apache.commons.vfs2.provider.AbstractFileObject.isReadable(AbstractFileObject.java:1757) > The problem is the method is using > return getPermissions(true).isReadable() > The folder *is* readable without these permissions, and so should be set to > return getPermissions(false).isReadable() > Which correctly allows the system to identify a readable folder without adding unnecessary restrictions. -- This message was sent by Atlassian JIRA (v6.4.14#64029)