Set 0777 mode to sanitizer tool report
authorSlava Barinov <v.barinov@samsung.com>
Tue, 15 Nov 2016 12:51:42 +0000 (15:51 +0300)
committerIvan Baravy <i.baravy@samsung.com>
Wed, 22 Feb 2017 09:24:38 +0000 (12:24 +0300)
There are processes which are executed with root permissions and then
change the user during run on target.

Without setting up the file mode to 0777 trying to write log causes
write error and process exits.

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

index 8365435..e94e3b0 100644 (file)
@@ -292,7 +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);
+  fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
   if (length != internal_write(fd, buffer, length)) {
     internal_write(fd, kWriteError, internal_strlen(kWriteError));
     Die();