recipes: tools/tarlz: added version 0.10a
[dragora.git] / patches / perp / perpd-restore_umask.patch
blobac5bb2e63d80b34b41cf85f7bc4c14bf10a74ab6
1 --- perp/perpd.c.orig 2013-01-11 12:10:32.000000000 -0300
2 +++ perp/perpd.c 2017-05-19 14:11:30.000000000 -0300
3 @@ -217,8 +217,9 @@
4 void
5 perpd_control_init(void)
7 - int fdbase;
8 - int fd = -1;
9 + int fdbase;
10 + int fd = -1;
11 + mode_t umask_orig;
13 /* setup for return to base directory: */
14 if((fdbase = open(".", O_RDONLY)) == -1){
15 @@ -226,7 +227,7 @@
18 /* setup umask for intentional mode on file creation: */
19 - umask(0);
20 + umask_orig = umask(0);
22 /* initialize .control directory: */
23 if(mkdir(PERP_CONTROL, 0700) == -1){
24 @@ -286,6 +287,9 @@
26 close(fdbase);
28 + /* restore umask: */
29 + umask(umask_orig);
31 return;