Re: [PATCHv5 02/19] util: storagefile: Introduce universal function to canonicalize paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/23/2014 02:28 AM, Peter Krempa wrote:
> On 06/20/14 16:35, Eric Blake wrote:
>> On 06/19/2014 07:59 AM, Peter Krempa wrote:
>>> Introduce a common function that will take a callback to resolve links
>>> that will be used to canonicalize paths on various storage systems and
>>> add extensive tests.
>>> ---
>>>  src/libvirt_private.syms  |   1 +
>>>  src/util/virstoragefile.c | 195 ++++++++++++++++++++++++++++++++++++++++++++++
>>>  src/util/virstoragefile.h |   7 ++
>>>  tests/virstoragetest.c    | 108 +++++++++++++++++++++++++
>>>  4 files changed, 311 insertions(+)
>>>
> 
>>
>> ACK if you can make those changes (you may want to post the interdiff)
>>
> The required changes to pass your suggested changes are:
> 

> +++ b/tests/virstoragetest.c
> @@ -1154,14 +1154,14 @@ mymain(void)
>      TEST_PATH_CANONICALIZE(5, "///////", "/");
>      TEST_PATH_CANONICALIZE(6, "//", "//");
>      TEST_PATH_CANONICALIZE(7, "", "");
> -    TEST_PATH_CANONICALIZE(8, ".", "");
> +    TEST_PATH_CANONICALIZE(8, ".", ".");
>      TEST_PATH_CANONICALIZE(9, "../", "..");
>      TEST_PATH_CANONICALIZE(10, "../../", "../..");
>      TEST_PATH_CANONICALIZE(11, "../../blah", "../../blah");
>      TEST_PATH_CANONICALIZE(12, "/./././blah", "/blah");
>      TEST_PATH_CANONICALIZE(13, ".././../././../blah", "../../../blah");
>      TEST_PATH_CANONICALIZE(14, "/././", "/");
> -    TEST_PATH_CANONICALIZE(15, "./././", "");
> +    TEST_PATH_CANONICALIZE(15, "./././", ".");
>      TEST_PATH_CANONICALIZE(16, "blah/../foo", "foo");
>      TEST_PATH_CANONICALIZE(17, "foo/bar/../blah", "foo/blah");
>      TEST_PATH_CANONICALIZE(18, "foo/bar/.././blah", "foo/blah");
> @@ -1179,6 +1179,7 @@ mymain(void)
>      TEST_PATH_CANONICALIZE(28, "/path/blah/yippee", "/other/path/huzah/yippee");
>      TEST_PATH_CANONICALIZE(29, "/cycle", NULL);
>      TEST_PATH_CANONICALIZE(30, "/cycle2/link", NULL);
> +    TEST_PATH_CANONICALIZE(31, "///", "/");

Looks good.  ACK to the squash-in.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]