965d0f
commit e322e98dc264bc5911d6fe1d371e55ac9f95a71e
965d0f
Author: Christine Caulfield <ccaulfie@redhat.com>
965d0f
Date:   Tue Mar 12 10:15:41 2019 +0000
965d0f
965d0f
    ipc: use O_EXCL on SHM files, and randomize the names
965d0f
    
965d0f
    Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
965d0f
965d0f
diff --git a/lib/log_blackbox.c b/lib/log_blackbox.c
965d0f
index 1cba422..2947162 100644
965d0f
--- a/lib/log_blackbox.c
965d0f
+++ b/lib/log_blackbox.c
965d0f
@@ -166,6 +166,6 @@ qb_log_blackbox_write_to_file(const char *filename)
965d0f
 	ssize_t written_size = 0;
965d0f
 	struct qb_log_target *t;
965d0f
-	int fd = open(filename, O_CREAT | O_RDWR, 0700);
965d0f
+	int fd = open(filename, O_CREAT | O_RDWR | O_EXCL, 0700);
965d0f
 
965d0f
 	if (fd < 0) {
965d0f
 		return -errno;