Checkout
Branko ─îibej
committed
on 21 Feb
Fix issue #4806: Remove on-disk trees with read-only directories in them.

* subversion/libsvn_subr/io.c
(io_set_perms): New; helper funct… Show more
Fix issue #4806: Remove on-disk trees with read-only directories in them.

* subversion/libsvn_subr/io.c

 (io_set_perms): New; helper function for io_set_*_perms.

 (io_set_file_perms): Use io_set_perms.

 (io_set_dir_perms): New; like io_set_file_perms, but for directories.

 (io_set_readonly_flag): New; helper function for setting the read-only flag.

 (svn_io_set_file_read_only,

  svn_io_set_file_read_write): Use io_set_readonly_flag.

 (svn_io_remove_dir2): On Unix, make the parent directory writable before

  trying to remove its children.

 (svn_io_dir_remove_nonrecursive): On Windows, remove a directory's

  read-only flag before trying to remove the directory.

* subversion/tests/libsvn_subr/io-test.c

 (create_dir_tree): New helper function.

 (test_rmtree_all_writable,

  test_rmtree_file_readonly,

  test_rmtree_dir_readonly,

  test_rmtree_all_readonly): New test cases.

 (test_funcs): Activate the new test cases.

Show less