You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Regis Xu (JIRA)" <ji...@apache.org> on 2008/12/11 07:31:46 UTC

[jira] Created: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

[classlib][portlib] incorrect parse path contains special unicode charactor
---------------------------------------------------------------------------

                 Key: HARMONY-6041
                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Regis Xu
             Fix For: 5.0M9


test case:

        String s = "\u5C73";
        File file = new File(s);
        System.out.println(file.mkdir());
        System.out.println(file.exists());
        System.out.println(file.getCanonicalPath());

output of RI:
true
true
C:\work\workspace\temp\屳

output of Harmony:
false
true
C:\work\workspace\temp\?

I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
at hyfile.c::437 invoke 
GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 

GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.

I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by Kevin Zhou <zh...@gmail.com>.
Would you please help to try this?

On Thu, Dec 11, 2008 at 3:07 PM, Regis Xu (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Regis Xu updated HARMONY-6041:
> ------------------------------
>
>    Attachment: HARMONY-6041.diff
>
> in this patch,  phase of calculate absolute path is after convert to
> unicode, and use unicode version GetFullPathNameW
>
> > [classlib][portlib] incorrect parse path contains special unicode
> charactor
> >
> ---------------------------------------------------------------------------
> >
> >                 Key: HARMONY-6041
> >                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Classlib
> >    Affects Versions: 5.0M8
> >            Reporter: Regis Xu
> >             Fix For: 5.0M9
> >
> >         Attachments: HARMONY-6041.diff
> >
> >
> > test case:
> >         String s = "\u5C73";
> >         File file = new File(s);
> >         System.out.println(file.mkdir());
> >         System.out.println(file.exists());
> >         System.out.println(file.getCanonicalPath());
> > output of RI:
> > true
> > true
> > C:\work\workspace\temp\��
> > output of Harmony:
> > false
> > true
> > C:\work\workspace\temp\?
> > I found the root cause is in hyfile.c:convert_path_to_unicode, which
> convert UTF-8 byte array to unicode byte array
> > at hyfile.c::437 invoke
> > GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0)
> > GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may
> corrupt the path.
> > I have got a fix for this, will attach patch soon.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Assigned: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Jimmy, Jing Lv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jimmy, Jing Lv reassigned HARMONY-6041:
---------------------------------------

    Assignee: Jimmy, Jing Lv

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu closed HARMONY-6041.
-----------------------------


> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Regis Xu
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041-v3.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu reassigned HARMONY-6041:
---------------------------------

    Assignee: Regis Xu  (was: Jimmy, Jing Lv)

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Regis Xu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041-v3.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709319#action_12709319 ] 

Li Jing Qin commented on HARMONY-6041:
--------------------------------------

Verified. Thanks Regis.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Regis Xu
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041-v3.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu closed HARMONY-6041.
-----------------------------


Verified. Thanks Jimmy.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Jimmy, Jing Lv (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jimmy, Jing Lv resolved HARMONY-6041.
-------------------------------------

    Resolution: Fixed

Seems a good catch.
Committed at r727328, please verify.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu updated HARMONY-6041:
------------------------------

    Attachment: HARMONY-6041.diff

in this patch,  phase of calculate absolute path is after convert to unicode, and use unicode version GetFullPathNameW

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Li Jing Qin updated HARMONY-6041:
---------------------------------

    Attachment: HARMONY-6041-v2.diff

Here is the new patch for the hyfile.c.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689105#action_12689105 ] 

Tim Ellison commented on HARMONY-6041:
--------------------------------------

Commit r727327 was reverted at  r758244.


> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu resolved HARMONY-6041.
-------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 5.0M9)
                   5.0M10

Thanks Li Jing Qin.

Patch HARMONY-6041-v3.diff applied to luni module at r772580, please verify.

And I also ran "dacapo eclipse" test, it works fine. So I believe this issue could be closed safely.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Regis Xu
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041-v3.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chunrong Lai reopened HARMONY-6041:
-----------------------------------



  Unfortunately I see that the commit r727327 breaks Dacapo.eclipse in my win32 machine.
  One can verify this with command line "java -jar dacapo-2006-10-MR2.jar eclipse".
  So I reopen the issue. Thanks.


> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Li Jing Qin updated HARMONY-6041:
---------------------------------

    Attachment: HARMONY-6041-v3.diff

With the old patch, we will fail at WinFileTest.
The testcase test a special path ".abcd..". We expected that the ".abcd.." would transformed to the ".abcd" and then create this folder. This seems very strange for me. 
RI also fail to create this folder. So in this new patch, I remove this path and all WinFileTest will pass.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041-v3.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor

Posted by "Li Jing Qin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706757#action_12706757 ] 

Li Jing Qin commented on HARMONY-6041:
--------------------------------------

In this patch, I remove the code for removing the '.' because GetFullPathName does this for us. Using GetFullPathNameW can help us with long name path and filename. By inserting '\\?\' prefix after we get the full path, we can deal the situation whether the input path is a relative path or a absolute path.

> [classlib][portlib] incorrect parse path contains special unicode charactor
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6041
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6041
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>            Assignee: Jimmy, Jing Lv
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6041-v2.diff, HARMONY-6041.diff
>
>
> test case:
>         String s = "\u5C73";
>         File file = new File(s);
>         System.out.println(file.mkdir());
>         System.out.println(file.exists());
>         System.out.println(file.getCanonicalPath());
> output of RI:
> true
> true
> C:\work\workspace\temp\屳
> output of Harmony:
> false
> true
> C:\work\workspace\temp\?
> I found the root cause is in hyfile.c:convert_path_to_unicode, which convert UTF-8 byte array to unicode byte array
> at hyfile.c::437 invoke 
> GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0) 
> GetFullPathNameA is ANSI version, but path is encoded as UTF-8,  this may corrupt the path.
> I have got a fix for this, will attach patch soon.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.