12345678910111213141516171819202122232425262728293031323334 |
- --- perp/perpd.c.orig 2013-01-11 12:10:32.000000000 -0300
- +++ perp/perpd.c 2017-05-19 14:11:30.000000000 -0300
- @@ -217,8 +217,9 @@
- void
- perpd_control_init(void)
- {
- - int fdbase;
- - int fd = -1;
- + int fdbase;
- + int fd = -1;
- + mode_t umask_orig;
-
- /* setup for return to base directory: */
- if((fdbase = open(".", O_RDONLY)) == -1){
- @@ -226,7 +227,7 @@
- }
-
- /* setup umask for intentional mode on file creation: */
- - umask(0);
- + umask_orig = umask(0);
-
- /* initialize .control directory: */
- if(mkdir(PERP_CONTROL, 0700) == -1){
- @@ -286,6 +287,9 @@
- }
- close(fdbase);
-
- + /* restore umask: */
- + umask(umask_orig);
- +
- return;
- }
-
|