mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Herzog-Uhl (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SSHD-376) NativeFileSystemFactory creates NativeFileSystemView which uses System.getProperty("user.dir") which can start with lower or uppercase Root and checks against Upperacse Root with String.startsWith()
Date Mon, 01 Dec 2014 13:53:12 GMT

     [ https://issues.apache.org/jira/browse/SSHD-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christian Herzog-Uhl updated SSHD-376:
--------------------------------------
    Description: 
On Windows the command System.getProperty("user.dir") can produce a path starting with upper
or lowercase Symbol. Depending on how you start it.

The NativeFileSystemFactory creates NativeFileSystemView which uses System.getProperty("user.dir")
which can start with lower or uppercase Root and checks against Upperacse Root with Method
current.startsWith()

public NativeFileSystemView(String userName, Map<String, String> roots, String current,
char separator, boolean caseInsensitive) {
....
        // Verify the current dir is relative to a known root
        String root = null;
        for (String r : verRoots.keySet()) {
            if (current.startsWith(r)) {
....

  was:
On Windows the command System.getProperty("user.dir") can produce a path starting with upper
or lowercase Symbol. Depending on how you start it.

The NativeFileSystemFactory 
public NativeFileSystemView(String userName, Map<String, String> roots, String current,
char separator, boolean caseInsensitive) {

        // Verify the current dir is relative to a known root
        String root = null;
        for (String r : verRoots.keySet()) {
            if (current.startsWith(r)) {



> NativeFileSystemFactory creates NativeFileSystemView which uses System.getProperty("user.dir")
which can start with lower or uppercase Root and checks against Upperacse Root with String.startsWith()
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-376
>                 URL: https://issues.apache.org/jira/browse/SSHD-376
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.13.0
>         Environment: Java 1.8, Windows 7
>            Reporter: Christian Herzog-Uhl
>              Labels: easyfix, patch
>         Attachments: NativeFileSystemFactoryTest.java
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> On Windows the command System.getProperty("user.dir") can produce a path starting with
upper or lowercase Symbol. Depending on how you start it.
> The NativeFileSystemFactory creates NativeFileSystemView which uses System.getProperty("user.dir")
which can start with lower or uppercase Root and checks against Upperacse Root with Method
current.startsWith()
> public NativeFileSystemView(String userName, Map<String, String> roots, String
current, char separator, boolean caseInsensitive) {
> ....
>         // Verify the current dir is relative to a known root
>         String root = null;
>         for (String r : verRoots.keySet()) {
>             if (current.startsWith(r)) {
> ....



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message