From 2794b23fb331a1f69807d04defa2c2c21d02c588 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 26 Apr 2019 10:53:01 -0700 Subject: gzip: fix permissions perservation despite umask. --- toys/lsb/gzip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/toys/lsb/gzip.c b/toys/lsb/gzip.c index df5bf3af..0fa9b7e1 100644 --- a/toys/lsb/gzip.c +++ b/toys/lsb/gzip.c @@ -143,6 +143,7 @@ static void do_gzip(int ifd, char *in) struct timespec times[] = {sb.st_atim, sb.st_mtim}; if (utimensat(AT_FDCWD, out, times, 0)) perror_exit("utimensat"); + if (chmod(out, sb.st_mode)) perror_exit("chmod"); close(ofd); if (!FLAG(k) && in && unlink(in)) perror_msg("unlink %s", in); free(out); -- cgit v1.2.3