From 3ac802de1e19d6e55dea51d896453f6497a4b95e Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Thu, 26 May 2016 16:23:28 +0900 Subject: [PATCH] fix grant permission step. some contents were skipped. Change-Id: I7f241190c8295c1a3ee0590c4188d7e99d200c7f Signed-off-by: jongmyeongko --- src/tpk/step/filesystem/step_grant_permission.cc | 30 +++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/tpk/step/filesystem/step_grant_permission.cc b/src/tpk/step/filesystem/step_grant_permission.cc index f12487c..56ae407 100644 --- a/src/tpk/step/filesystem/step_grant_permission.cc +++ b/src/tpk/step/filesystem/step_grant_permission.cc @@ -37,14 +37,20 @@ ci::Step::Status StepTpkGrantPermission::process() { auto path = entry.path(); if (bf::is_directory(path) && path.filename() == "bin") { + auto permission = bf::perms::owner_all | + bf::perms::group_read | bf::perms::group_exe | + bf::perms::others_read | bf::perms::others_exe; + if (!ci::SetDirPermissions(path, permission)) { + LOG(ERROR) << "Grant permission error" << " path: " << path + << " permission: " << permission; + return Status::ERROR; + } for (auto& entry : boost::make_iterator_range(bf::directory_iterator(path), {})) { + auto path = entry.path(); if (bf::is_regular_file(path)) { - auto permission = bf::perms::owner_all | - bf::perms::group_read | bf::perms::group_exe | - bf::perms::others_read | bf::perms::others_exe; if (!ci::SetDirPermissions(path, permission)) { - LOG(ERROR) << "Grand permission error" << " path: " << path + LOG(ERROR) << "Grant permission error" << " path: " << path << " permission: " << permission; return Status::ERROR; /* temp error, TODO */ } @@ -54,13 +60,19 @@ ci::Step::Status StepTpkGrantPermission::process() { } if (bf::is_directory(path) && path.filename() == "lib") { + auto permission = bf::perms::owner_read | bf::perms::owner_write | + bf::perms::group_read | bf::perms::others_read; + if (!ci::SetDirPermissions(path, permission)) { + LOG(ERROR) << "Grant permission error" << " path: " << path + << " permission: " << permission; + return Status::ERROR; + } for (auto& entry : boost::make_iterator_range(bf::directory_iterator(path), {})) { + auto path = entry.path(); if (bf::is_regular_file(path)) { - auto permission = bf::perms::owner_read | bf::perms::owner_write | - bf::perms::group_read | bf::perms::others_read; if (!ci::SetDirPermissions(path, permission)) { - LOG(ERROR) << "Grand permission error" << " path: " << path + LOG(ERROR) << "Grant permission error" << " path: " << path << " permission: " << permission; return Status::ERROR; } @@ -74,7 +86,7 @@ ci::Step::Status StepTpkGrantPermission::process() { bf::perms::group_read | bf::perms::group_exe | bf::perms::others_read | bf::perms::others_exe; if (!ci::SetDirPermissions(path, permission)) { - LOG(ERROR) << "Grand permission error" << " path: " << path + LOG(ERROR) << "Grant permission error" << " path: " << path << " permission: " << permission; return Status::ERROR; } @@ -85,7 +97,7 @@ ci::Step::Status StepTpkGrantPermission::process() { auto permission = bf::perms::owner_read | bf::perms::owner_write | bf::perms::group_read | bf::perms::others_read; if (!ci::SetDirPermissions(path, permission)) { - LOG(ERROR) << "Grand permission error" << " path: " << path + LOG(ERROR) << "Grant permission error" << " path: " << path << " permission: " << permission; return Status::ERROR; } -- 2.7.4