summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2007-03-02 16:44:58 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2007-03-02 16:44:58 +0000
commit03bb132ddcea51c4c497b46558ca2c058da312fc (patch)
tree6a75947aa17e290cbb5ce888e71518a4595ffb89
parentfab48452ae20b55687c6c17d15e2e8491983ba77 (diff)
Notes
-rw-r--r--lib/libarchive/archive_read_extract.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index d86ddddcbdff..ef2e2b50d820 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