From d59a57e133e95aac3536199f3c95380436b026ce Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 31 Dec 2024 07:16:07 -0800 Subject: [PATCH] `write_*_file` actions default to mode 0600 This commit changes the default filemode for the write actions so that it is only readable and writable by the user running Ghostty. --- src/Surface.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index 8c7c2619e..ab761e52a 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -4242,7 +4242,7 @@ fn writeScreenFile( const filename = try std.fmt.bufPrint(&filename_buf, "{s}.txt", .{@tagName(loc)}); // Open our scrollback file - var file = try tmp_dir.dir.createFile(filename, .{}); + var file = try tmp_dir.dir.createFile(filename, .{ .mode = 0o600 }); defer file.close(); // Screen.dumpString writes byte-by-byte, so buffer it