apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r424911 - /apr/apr/branches/0.9.x/test/testnames.c
Date Mon, 24 Jul 2006 05:41:53 GMT
Author: wrowe
Date: Sun Jul 23 22:41:53 2006
New Revision: 424911

URL: http://svn.apache.org/viewvc?rev=424911&view=rev
Log:
  From svn issue 1869, test for ../../../ as submitted, plus i've added
  the pattern ../../.. which breaks the reporter's assumptions about the
  fix.  Reviewing the bug now.

Submitted by: Lieven Govaerts <lgo mobsol.be>
Backports: 424831

Modified:
    apr/apr/branches/0.9.x/test/testnames.c

Modified: apr/apr/branches/0.9.x/test/testnames.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/test/testnames.c?rev=424911&r1=424910&r2=424911&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/test/testnames.c (original)
+++ apr/apr/branches/0.9.x/test/testnames.c Sun Jul 23 22:41:53 2006
@@ -91,6 +91,24 @@
     CuAssertStrEquals(tc, "../test", dstpath);
 }
 
+static void merge_dotdot_dotdot_dotdot(CuTest *tc)
+{
+    apr_status_t rv;
+    char *dstpath = NULL;
+
+    rv = apr_filepath_merge(&dstpath, "", 
+                            "../../..", APR_FILEPATH_TRUENAME, p);
+    CuAssertPtrNotNull(tc, dstpath);
+    CuAssertIntEquals(tc, APR_SUCCESS, rv);
+    CuAssertStrEquals(tc, "../../..", dstpath);
+
+    rv = apr_filepath_merge(&dstpath, "", 
+                            "../../../", APR_FILEPATH_TRUENAME, p);
+    CuAssertPtrNotNull(tc, dstpath);
+    CuAssertIntEquals(tc, APR_SUCCESS, rv);
+    CuAssertStrEquals(tc, "../../../", dstpath);
+}
+
 static void merge_secure(CuTest *tc)
 {
     apr_status_t rv;
@@ -232,6 +250,7 @@
     SUITE_ADD_TEST(suite, merge_notrelfail);
     SUITE_ADD_TEST(suite, merge_notabs);
     SUITE_ADD_TEST(suite, merge_notabsfail);
+    SUITE_ADD_TEST(suite, merge_dotdot_dotdot_dotdot);
 
     SUITE_ADD_TEST(suite, root_absolute);
     SUITE_ADD_TEST(suite, root_relative);



Mime
View raw message