summaryrefslogtreecommitdiff
path: root/debian/patches/22exchange_file_mode.patch
blob: ccdf3dd9e8c042c4e344f4fb3a6231970819274b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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.
Index: screen/fileio.c
===================================================================
--- screen.orig/fileio.c	2011-10-08 19:54:19.000000000 +0200
+++ screen/fileio.c	2011-10-08 19:58:46.000000000 +0200
@@ -413,11 +413,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;
@@ -480,7 +475,6 @@
 #ifdef COPY_PASTE
       if (dump == DUMP_EXCHANGE && public)
 	{
-          old_umask = umask(0);
 # ifdef HAVE_LSTAT
 	  if (exists)
 	    {
@@ -501,7 +495,6 @@
 # else
           f = fopen(fn, mode);
 # endif
-          umask(old_umask);
 	}
       else
 #endif /* COPY_PASTE */