outfile << infile.rdbuf();
outfile.close();
infile.close();
+
+ chown(destFile.c_str(), statInfo.st_uid, statInfo.st_gid);
}
} while (dEntryResult != NULL && return_code == 0);
closedir(dir);
LogDebug("Create private storage directory : " <<
m_context.locations->getPrivateStorageDir());
+ changeOwnerForDirectory(storagePath, PRIVATE_STORAGE_MODE);
+
if (m_context.isUpdateMode) { //update
std::string backData = m_context.locations->getBackupPrivateDir();
LogDebug("copy private storage " << backData << " to " << storagePath);
- WrtUtilMakeDir(storagePath);
if (!DirectoryApi::DirectoryCopy(backData, storagePath)) {
LogError("Failed to rename " << backData << " to " << storagePath);
ThrowMsg(Exceptions::BackupFailed,
"Error occurs copy private strage files");
}
}
- changeOwnerForDirectory(storagePath, PRIVATE_STORAGE_MODE);
std::string tempStoragePath = m_context.locations->getPrivateTempStorageDir();
LogDebug("Create temp private storage directory : " << tempStoragePath);