[Toybox] [PATCH] gzip: fix permissions perservation despite umask.

enh enh at google.com
Fri Apr 26 10:55:09 PDT 2019


---
 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);
-- 
2.21.0.593.g511ec345e18-goog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gzip-fix-permissions-perservation-despite-umask.patch
Type: text/x-patch
Size: 777 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20190426/41bf1798/attachment-0002.bin>


More information about the Toybox mailing list