Sfoglia il codice sorgente

corosync_ring_id_store: Use safer permissions

corosync_ring_id_store should use same (safer) permissions as
corosync_ring_id_create_or_load for (eventually) newly created ringid
file.

Credit to Sjerek for finding this problem.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
(cherry picked from commit 252b38ab8a62ff083e83b1d6f514109f7b7cbb42)
Jan Friesse 11 anni fa
parent
commit
660e2b0854
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      exec/main.c

+ 2 - 2
exec/main.c

@@ -1043,9 +1043,9 @@ static void corosync_ring_id_store (
 	snprintf (filename, sizeof(filename), "%s/ringid_%s",
 		get_run_dir(), totemip_print (addr));
 
-	fd = open (filename, O_WRONLY, 0777);
+	fd = open (filename, O_WRONLY, 0700);
 	if (fd == -1) {
-		fd = open (filename, O_CREAT|O_RDWR, 0777);
+		fd = open (filename, O_CREAT|O_RDWR, 0700);
 	}
 	if (fd == -1) {
 		LOGSYS_PERROR(errno, LOGSYS_LEVEL_ERROR,