Blame SOURCES/shadow-4.1.5.1-backup-mode.patch

9f90df
diff -up shadow-4.1.5.1/lib/commonio.c.backup-mode shadow-4.1.5.1/lib/commonio.c
9f90df
--- shadow-4.1.5.1/lib/commonio.c.backup-mode	2012-05-18 21:44:54.000000000 +0200
9f90df
+++ shadow-4.1.5.1/lib/commonio.c	2012-09-19 20:27:16.089444234 +0200
9f90df
@@ -301,15 +301,12 @@ static int create_backup (const char *ba
9f90df
 	struct utimbuf ub;
9f90df
 	FILE *bkfp;
9f90df
 	int c;
9f90df
-	mode_t mask;
9f90df
 
9f90df
 	if (fstat (fileno (fp), &sb) != 0) {
9f90df
 		return -1;
9f90df
 	}
9f90df
 
9f90df
-	mask = umask (077);
9f90df
-	bkfp = fopen (backup, "w");
9f90df
-	(void) umask (mask);
9f90df
+	bkfp = fopen_set_perms (backup, "w", &sb);
9f90df
 	if (NULL == bkfp) {
9f90df
 		return -1;
9f90df
 	}