diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-03-02 16:44:58 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-03-02 16:44:58 +0000 |
commit | 11f5cfdca1fe2bf6cf756f8ec29f7e9030c4e771 (patch) | |
tree | 6a75947aa17e290cbb5ce888e71518a4595ffb89 /lib/libarchive | |
parent | a02f7880b03bb39cf812da3f91b0fbd0019d3311 (diff) | |
download | FreeBSD-src-11f5cfdca1fe2bf6cf756f8ec29f7e9030c4e771.zip FreeBSD-src-11f5cfdca1fe2bf6cf756f8ec29f7e9030c4e771.tar.gz |
Force the umask to something predictable while creating objects
on disk. In particular, this fixes tar -xp restore of mode bits.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_read_extract.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index d86dddd..ef2e2b5 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -262,6 +262,7 @@ archive_read_extract(struct archive *a, struct archive_entry *entry, int flags) if (stat(archive_entry_pathname(entry), &extract->st) == 0) extract->pst = &extract->st; + extract->umask = umask(0); /* Set the umask to zero, record old one. */ if (extract->pst != NULL && extract->pst->st_dev == a->skip_file_dev && @@ -295,7 +296,7 @@ archive_read_extract(struct archive *a, struct archive_entry *entry, int flags) break; } } - + umask(extract->umask); /* Restore umask. */ cleanup: #ifdef HAVE_FCHDIR |