Adjust permission and SMACK label to let
platform privileged applications could access it.
Also, create empty installer history log file to
apply proper SMACK label to it.
Change-Id: Icb85e3fbb2f0e69ae5b8e8ad6e1a94eedee576da
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
%post
chsmack -a System %{unpackdir}
-chsmack -a System %{logdir}
+chsmack -t -a User::Home %{logdir}
+chown -R app_fw:priv_platform %{logdir}
+chmod 755 %{logdir}
+touch %{logdir}/installation-history.log
+chown app_fw:priv_platform %{logdir}/installation-history.log
+chsmack -a User::Home %{logdir}/installation-history.log
%postun
#include <string>
#include <utility>
+namespace {
+
+constexpr mode_t kDefaultMode640 = S_IRUSR | S_IWUSR | S_IRGRP;
+
+} // namespace
+
namespace utils {
FileLogBackend::FileLogBackend(std::string file_name, int rotation_size,
// clean the log stream
log_stream_->str("");
log_stream_->clear();
+
+ chmod(file_name_.c_str(), kDefaultMode640);
}
bool FileLogBackend::Rotate() {