Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 51099 invoked from network); 23 Jul 2006 11:14:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jul 2006 11:14:27 -0000 Received: (qmail 55629 invoked by uid 500); 23 Jul 2006 11:14:26 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 55600 invoked by uid 500); 23 Jul 2006 11:14:26 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Delivered-To: moderator for dev@apr.apache.org Received: (qmail 26163 invoked by uid 99); 23 Jul 2006 10:29:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) From: "Lieven Govaerts" To: Subject: [PATCH]: apr_filepath_merge on Windows handes ..\..\.. incorrectly. (is Subversion issue 1869) Date: Sun, 23 Jul 2006 12:28:11 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0013_01C6AE53.7692AB40" X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Thread-Index: AcauQq9fX0Grl5KBRX+6+TqdAyEG1A== Message-Id: <20060723102844.15CC52200D4@assei1bl6.telenet-ops.be> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0013_01C6AE53.7692AB40 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, attached is a patch for an issue reported in the Subversion issue tracker as issue 1869: http://subversion.tigris.org/issues/show_bug.cgi?id=1869 The issue is that merging two paths "" and "..\..\.." with the apr_filepath_merge functions returns a result of "..\" where it obviously should have returned "..\..\..". Attached patch will solve that issue. I included a new unit test to test for this issue. When replying, please include my email address in CC as I'm not subscribed to this list. kind regards, Lieven. ------=_NextPart_000_0013_01C6AE53.7692AB40 Content-Type: text/plain; name="apr-issue-1869.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="apr-issue-1869.patch.txt" Index: file_io/win32/filepath.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- file_io/win32/filepath.c (revision 422522) +++ file_io/win32/filepath.c (working copy) @@ -673,7 +673,7 @@ */=0A= }=0A= else if (pathlen =3D=3D 0 ||=0A= - (pathlen >=3D 3 && (pathlen =3D=3D 3=0A= + (pathlen >=3D 3 && (pathlen % 3 =3D=3D 0=0A= || path[pathlen - 4] =3D=3D ':')=0A= && path[pathlen - 3] =3D=3D '.' =0A= && path[pathlen - 2] =3D=3D '.' =0A= Index: test/testnames.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- test/testnames.c (revision 422522) +++ test/testnames.c (working copy) @@ -91,6 +91,18 @@ ABTS_STR_EQUAL(tc, "../test", dstpath);=0A= }=0A= =0A= +static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data)=0A= +{=0A= + apr_status_t rv;=0A= + char *dstpath =3D NULL;=0A= +=0A= + rv =3D apr_filepath_merge(&dstpath, "", =0A= + "../../../", APR_FILEPATH_TRUENAME, p);=0A= + ABTS_PTR_NOTNULL(tc, dstpath);=0A= + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);=0A= + ABTS_STR_EQUAL(tc, "../../../", dstpath);=0A= +}=0A= +=0A= static void merge_secure(abts_case *tc, void *data)=0A= {=0A= apr_status_t rv;=0A= @@ -249,6 +261,7 @@ abts_run_test(suite, merge_notrelfail, NULL);=0A= abts_run_test(suite, merge_notabs, NULL);=0A= abts_run_test(suite, merge_notabsfail, NULL);=0A= + abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL);=0A= =0A= abts_run_test(suite, root_absolute, NULL);=0A= abts_run_test(suite, root_relative, NULL);=0A= ------=_NextPart_000_0013_01C6AE53.7692AB40--