Set 0644 mode to sanitizer tool report 53/94853/3
authorSlava Barinov <v.barinov@samsung.com>
Wed, 31 Aug 2016 14:41:46 +0000 (17:41 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 16 Nov 2016 04:29:17 +0000 (20:29 -0800)
Without setting up the file mode explicitly its impossible to read the
logs by users in OBS.

Change-Id: Icaa540b434fc6266cbd0b1ad3391e21b8cbb692f
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
libsanitizer/sanitizer_common/sanitizer_posix.cc

index ed44633..8365435 100644 (file)
@@ -23,6 +23,7 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
 
 #if SANITIZER_LINUX
 #include <sys/utsname.h>
@@ -291,6 +292,7 @@ void ReportFile::Write(const char *buffer, uptr length) {
   static const char *kWriteError =
       "ReportFile::Write() can't output requested buffer!\n";
   ReopenIfNecessary();
+  fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
   if (length != internal_write(fd, buffer, length)) {
     internal_write(fd, kWriteError, internal_strlen(kWriteError));
     Die();