summaryrefslogtreecommitdiff
path: root/debian/patches/22exchange_file_mode.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/22exchange_file_mode.patch')
-rw-r--r--debian/patches/22exchange_file_mode.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/patches/22exchange_file_mode.patch b/debian/patches/22exchange_file_mode.patch
new file mode 100644
index 0000000..1d88949
--- /dev/null
+++ b/debian/patches/22exchange_file_mode.patch
@@ -0,0 +1,34 @@
+Author: <hesso@pool.math.tu-berlin.de>
+Description: Make it a bit harder to shoot oneself in the foot by
+keeping the umask tight by default when creating the
+screen exchange file. Fearless users may still chmod it.
+--- a/fileio.c
++++ b/fileio.c
+@@ -411,11 +411,6 @@
+ char *mode = "w";
+ #ifdef COPY_PASTE
+ int public = 0;
+-# ifdef _MODE_T
+- mode_t old_umask;
+-# else
+- int old_umask;
+-# endif
+ # ifdef HAVE_LSTAT
+ struct stat stb, stb2;
+ int fd, exists = 0;
+@@ -478,7 +473,6 @@
+ #ifdef COPY_PASTE
+ if (dump == DUMP_EXCHANGE && public)
+ {
+- old_umask = umask(0);
+ # ifdef HAVE_LSTAT
+ if (exists)
+ {
+@@ -499,7 +493,6 @@
+ # else
+ f = fopen(fn, mode);
+ # endif
+- umask(old_umask);
+ }
+ else
+ #endif /* COPY_PASTE */