You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/02/05 15:28:46 UTC

[GitHub] [commons-vfs] ddg-igh opened a new pull request #80: sftp add possibility to configure whether exec is enabled

ddg-igh opened a new pull request #80: sftp add possibility to configure whether exec is enabled
URL: https://github.com/apache/commons-vfs/pull/80
 
 
   One of our customer has an interesting sftp server.
   The server does not allow any further channels to be established after the execution of the exec command (getUid()).
   So it is not possible to do any filesystem operations, because at first the exec command is executed to test if exec is disabled.
   Maybe the server things we try to break the security or something else.
   
   So my idea to solve this problem is to make execDisabled configurable. This is done here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] ottobackwards commented on issue #80: [SFTP] Configure whether exec detection is enabled

Posted by GitBox <gi...@apache.org>.
ottobackwards commented on issue #80: [SFTP] Configure whether exec detection is enabled
URL: https://github.com/apache/commons-vfs/pull/80#issuecomment-584095976
 
 
   +1 to a configuration only fix, although I would want to understand if there is better way to execute the original intent without more configuration nobs

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled
URL: https://github.com/apache/commons-vfs/pull/80#discussion_r375335332
 
 

 ##########
 File path: commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
 ##########
 @@ -91,7 +91,13 @@ protected SftpFileSystem(final GenericFileName rootName, final Session session,
         this.session = Objects.requireNonNull(session, "session");
         this.connectTimeoutMillis = SftpFileSystemConfigBuilder.getInstance()
                 .getConnectTimeoutMillis(fileSystemOptions);
-        this.execDisabled = detectExecDisabled();
+        
+        if (SftpFileSystemConfigBuilder.getInstance().isExecEnabled(fileSystemOptions)){
+            this.execDisabled = detectExecDisabled();
+        }
 
 Review comment:
   formatting should be "} else {"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled
URL: https://github.com/apache/commons-vfs/pull/80#discussion_r375337947
 
 

 ##########
 File path: commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
 ##########
 @@ -91,7 +91,13 @@ protected SftpFileSystem(final GenericFileName rootName, final Session session,
         this.session = Objects.requireNonNull(session, "session");
         this.connectTimeoutMillis = SftpFileSystemConfigBuilder.getInstance()
                 .getConnectTimeoutMillis(fileSystemOptions);
-        this.execDisabled = detectExecDisabled();
+        
+        if (SftpFileSystemConfigBuilder.getInstance().isExecEnabled(fileSystemOptions)){
+            this.execDisabled = detectExecDisabled();
 
 Review comment:
   This feature disables _detection_ of the exec channel, so it should be called as such IMO: `EXEC_ENABLED` -> `DISABLE_DETECT_EXEC_CHANEL`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] garydgregory commented on issue #80: sftp add possibility to configure whether exec is enabled

Posted by GitBox <gi...@apache.org>.
garydgregory commented on issue #80: sftp add possibility to configure whether exec is enabled
URL: https://github.com/apache/commons-vfs/pull/80#issuecomment-582472307
 
 
   @ddg-igh ,
   
   Thank you for your PR changes. Please see my comments. Also, please rebase on master, I just fixed an issue in this provider.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled

Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #80: sftp add possibility to configure whether exec is enabled
URL: https://github.com/apache/commons-vfs/pull/80#discussion_r375335941
 
 

 ##########
 File path: commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
 ##########
 @@ -268,6 +269,21 @@ public ConfigRepository getConfigRepository(final FileSystemOptions opts) {
     public boolean isLoadOpenSSHConfig(final FileSystemOptions opts) {
         return this.getBoolean(opts, LOAD_OPENSSH_CONFIG, Boolean.FALSE);
     }
+    
+    /**
+     * Returns {@link Boolean#TRUE} if exec should be tested and enabled.
 
 Review comment:
   The API returns a `boolean`, not a `Boolean`, so the Javadoc should refer to `true`, not `Boolean#TRUE}.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-vfs] garydgregory merged pull request #80: [SFTP] Configure whether exec detection is enabled

Posted by GitBox <gi...@apache.org>.
garydgregory merged pull request #80: [SFTP] Configure whether exec detection is enabled
URL: https://github.com/apache/commons-vfs/pull/80
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services