new upstream version
- use the original file permissions when creating backup (#853102)
This commit is contained in:
parent
cae35b95ab
commit
44a40b2f4e
10 changed files with 175 additions and 141 deletions
20
shadow-4.1.5.1-backup-mode.patch
Normal file
20
shadow-4.1.5.1-backup-mode.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
diff -up shadow-4.1.5.1/lib/commonio.c.backup-mode shadow-4.1.5.1/lib/commonio.c
|
||||
--- shadow-4.1.5.1/lib/commonio.c.backup-mode 2012-05-18 21:44:54.000000000 +0200
|
||||
+++ shadow-4.1.5.1/lib/commonio.c 2012-09-19 20:27:16.089444234 +0200
|
||||
@@ -301,15 +301,12 @@ static int create_backup (const char *ba
|
||||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue