sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 66b6150d300f96e009d04d0fd3a22747c4e354b9
parent 691cdc8e55839b37c9bb7dddd3b37b6e02f7fc5e
Author: Brad Barden <brad@13os.net>
Date:   Wed Nov 18 20:49:07 -0600

tar: extract creation mode

mode for newly-created files should be restrictive. chmod is always
called soon after to set correct mode from the archive.

Diffstat:
tar.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tar.c b/tar.c @@ -270,7 +270,7 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ]) case RESERVED: if ((mode = strtol(h->mode, &p, 8)) < 0 || *p != '\0') eprintf("strtol %s: invalid number\n", h->mode); - fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT, 0644); + fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT, 0600); if (fd < 0) eprintf("open %s:", fname); if (fchmod(fd, mode) < 0)