rpms/apr/FC-4 apr-0.9.6-dirmakerec.patch, NONE, 1.1 apr.spec, 1.27, 1.28

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 23 08:58:14 UTC 2005


Author: jorton

Update of /cvs/dist/rpms/apr/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv1326

Modified Files:
	apr.spec 
Added Files:
	apr-0.9.6-dirmakerec.patch 
Log Message:
* Wed Nov 23 2005 Joe Orton <jorton at redhat.com> 0.9.6-3.4
- add fix for apr_dir_make_recursive infinite loop
- rebuild for new gcc (#173917)


apr-0.9.6-dirmakerec.patch:
 file_io/unix/dir.c |    5 +++++
 test/testdir.c     |   24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

--- NEW FILE apr-0.9.6-dirmakerec.patch ---
Author: jorton
Date: Sat Sep 24 15:27:18 2005
New Revision: 291341

URL: http://svn.apache.org/viewcvs?rev=291341&view=rev
Log:
Merge r291339 from trunk:

* file_io/unix/dir.c (apr_dir_make_recursive): Fix infinite recursion
if mkdir fails for all path components.

* test/testdir.c (test_rmkdir_nocwd): Add test case.

--- apr-0.9.6/file_io/unix/dir.c.dirmakerec
+++ apr-0.9.6/file_io/unix/dir.c
@@ -308,6 +308,11 @@
         char *dir;
         
         dir = path_remove_last_component(path, pool);
+        /* If there is no path left, give up. */
+        if (dir[0] == '\0') {
+            return apr_err;
+        }
+
         apr_err = apr_dir_make_recursive(dir, perm, pool);
         
         if (!apr_err) 
--- apr-0.9.6/test/testdir.c.dirmakerec
+++ apr-0.9.6/test/testdir.c
@@ -219,6 +219,29 @@
 
 }
 
+static void test_rmkdir_nocwd(CuTest *tc)
+{
+    char *cwd, *path;
+
+    apr_assert_success(tc, "make temp dir",
+                       apr_dir_make("dir3", APR_OS_DEFAULT, p));
+
+    apr_assert_success(tc, "obtain cwd", apr_filepath_get(&cwd, 0, p));
+
+    apr_assert_success(tc, "determine path to temp dir",
+                       apr_filepath_merge(&path, cwd, "dir3", 0, p));
+
+    apr_assert_success(tc, "change to temp dir", apr_filepath_set(path, p));
+
+    apr_assert_success(tc, "remove temp dir", apr_dir_remove(path, p));
+
+    CuAssert(tc, "fail to create dir",
+             apr_dir_make_recursive("foobar", APR_OS_DEFAULT, 
+                                    p) != APR_SUCCESS);
+
+    apr_assert_success(tc, "restore cwd", apr_filepath_set(cwd, p));
+}
+
 CuSuite *testdir(void)
 {
     CuSuite *suite = CuSuiteNew("Directory");
@@ -230,6 +253,7 @@
     SUITE_ADD_TEST(suite, test_removeall);
     SUITE_ADD_TEST(suite, test_remove_notthere);
     SUITE_ADD_TEST(suite, test_mkdir_twice);
+    SUITE_ADD_TEST(suite, test_rmkdir_nocwd);
 
     SUITE_ADD_TEST(suite, test_rewind);
 


Index: apr.spec
===================================================================
RCS file: /cvs/dist/rpms/apr/FC-4/apr.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- apr.spec	15 Sep 2005 13:35:19 -0000	1.27
+++ apr.spec	23 Nov 2005 08:58:11 -0000	1.28
@@ -3,7 +3,7 @@
 Summary: Apache Portable Runtime library
 Name: apr
 Version: 0.9.6
-Release: 3.3
+Release: 3.4
 License: Apache Software License
 Group: System Environment/Libraries
 URL: http://apr.apache.org/
@@ -20,6 +20,7 @@
 Patch25: apr-0.9.6-flushbufs.patch
 Patch26: apr-0.9.6-tcpopts.patch
 Patch27: apr-0.9.6-procexit.patch
+Patch28: apr-0.9.6-dirmakerec.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 BuildPrereq: autoconf, libtool, doxygen
 Conflicts: subversion < 0.20.1-2
@@ -57,6 +58,7 @@
 %patch25 -p1 -b .flushbufs
 %patch26 -p1 -b .tcpopts
 %patch27 -p1 -b .procexit
+%patch28 -p1 -b .dirmakerec
 
 %build
 # regenerate configure script etc.
@@ -129,6 +131,10 @@
 %{_includedir}/apr-%{aprver}/*.h
 
 %changelog
+* Wed Nov 23 2005 Joe Orton <jorton at redhat.com> 0.9.6-3.4
+- add fix for apr_dir_make_recursive infinite loop
+- rebuild for new gcc (#173917)
+
 * Thu Sep 15 2005 Joe Orton <jorton at redhat.com> 0.9.6-3.3
 - don't override CFLAGS during build
 - allow setting TCP_NODELAY and TCP_CORK concurrently




More information about the fedora-cvs-commits mailing list