2016-05-30 12:38:25 +02:00
|
|
|
--- lib/commonio.c
|
|
|
|
+++ lib/commonio.c
|
|
|
|
@@ -301,15 +301,12 @@ static int create_backup (const char *backup, FILE * fp)
|
2013-09-17 14:59:36 +02:00
|
|
|
struct utimbuf ub;
|
|
|
|
FILE *bkfp;
|
|
|
|
int c;
|
|
|
|
- mode_t mask;
|
|
|
|
|
|
|
|
if (fstat (fileno (fp), &sb) != 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- mask = umask (077);
|
|
|
|
- bkfp = fopen (backup, "w");
|
|
|
|
- (void) umask (mask);
|
|
|
|
+ bkfp = fopen_set_perms (backup, "w", &sb);
|
|
|
|
if (NULL == bkfp) {
|
|
|
|
return -1;
|
|
|
|
}
|