From ab82932ad68b63cd34b731a3ff7e067769b47d1d Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Mon, 28 Sep 2015 15:52:53 +0200
Subject: [PATCH] Fixed JSF-149 errors detected by C++Test.
Octal values replaced by constants.
[Verification] Code compiles, TCT pass rate did not change.
Change-Id: If3ec7230b28500e2220cffee279aed50c11c041d
Signed-off-by: Pawel Andruszkiewicz
---
src/archive/un_zip_extract_request.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/archive/un_zip_extract_request.cc b/src/archive/un_zip_extract_request.cc
index b3018da4..2498d6e1 100755
--- a/src/archive/un_zip_extract_request.cc
+++ b/src/archive/un_zip_extract_request.cc
@@ -96,7 +96,7 @@ void createMissingDirectories(const std::string& path, bool check_first = true)
if(FPS_DIRECTORY != status) {
//TODO investigate 0775 (mode) - filesystem assumed that file should have parent mode
- if(mkdir(left_part.c_str(), 0775) == -1) {
+ if(mkdir(left_part.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
LoggerE("Couldn't create new directory: %s errno: %s",
left_part.c_str(), GetErrorString(errno).c_str());
//TODO check why mkdir return -1 but directory is successfully created
@@ -306,7 +306,7 @@ PlatformResult UnZipExtractRequest::handleDirectoryEntry()
}
//Try to create new directory in output directory
- if(mkdir(m_new_dir_path.c_str(), 0775) == -1) {
+ if(mkdir(m_new_dir_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
LoggerE("Couldn't create new directory: %s errno: %s",
m_new_dir_path.c_str(), GetErrorString(errno).c_str());
return PlatformResult(ErrorCode::UNKNOWN_ERR, "Could not create new directory in extract output directory");
@@ -343,7 +343,7 @@ PlatformResult UnZipExtractRequest::prepareOutputSubdirectory()
//Try to create new directory in output directory
//TODO investigate 0775 (mode) - filesystem assumed that file should have parent mode
- if(mkdir(m_new_dir_path.c_str(), 0775) == -1) {
+ if(mkdir(m_new_dir_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
LoggerW("couldn't create new directory: %s errno: %s",
m_new_dir_path.c_str(), GetErrorString(errno).c_str());
//TODO check why mkdir return -1 but directory is successfully created
--
2.34.1