Fix issue with permissions when copying dir contents 21/29021/3
authorLukasz Kostyra <l.kostyra@samsung.com>
Tue, 14 Oct 2014 08:00:49 +0000 (10:00 +0200)
committerJan Olszak <j.olszak@samsung.com>
Mon, 27 Oct 2014 08:46:09 +0000 (01:46 -0700)
commit0533ba4677d802d3821e04eb6756d76180994843
treef8e3eb9d087f7d49d701ab192a971273c0bec90a
parent2a642703696fa9d3390c18ccd58325cae56e62fb
Fix issue with permissions when copying dir contents

[Bug]           Permission denied error when trying to copy read-only directories recursively.
[Cause]         boost::filesystem::copy applied permissions immediately, which in some cases caused
                error when trying to write something inside processed directory.
[Solution]      Instead of using boost::filesystem::copy on directories, split action into three
                sub-actions:
                  * Create new directory with boost::filesystem::create_directory
                  * Call copyDirContentsRec() to copy contents of processed directory
                  * Apply source directory permissions and ownership
[Verification]  Build, install, run tests.

Change-Id: Ifdec110a595dcecd113abf4065dd1cdc03f2d3cb
common/utils/fs.cpp
server/server.cpp
tests/unit_tests/utils/ut-fs.cpp