SHA256
1
0
forked from pool/shadow
shadow/shadow-4.1.5.1-backup-mode.patch
Thorsten Kukuk 214efedae2 - Add some fixes from Fedora:
- shadow-4.1.5.1-backup-mode.patch: open backup file with correct
    permissions.
  - shadow-4.1.5.1-logmsg.patch: fix error message
  - shadow-4.1.5.1-errmsg.patch: print error reason
  - shadow-4.1.5.1-manfix.patch: fix manual page

OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=9
2013-09-17 12:59:36 +00:00

21 lines
576 B
Diff

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;
}