From 5cdd120f0c6423a42fa2eec2311126142a9a49f0 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 6 Feb 2018 17:59:32 +0100 Subject: unzip: do not set directory mode to 0777 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882177 Signed-off-by: Denys Vlasenko --- archival/unzip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archival') diff --git a/archival/unzip.c b/archival/unzip.c index 653fdd1..da4b2a5 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -336,7 +336,9 @@ static void unzip_create_leading_dirs(const char *fn) { /* Create all leading directories */ char *name = xstrdup(fn); - if (bb_make_directory(dirname(name), 0777, FILEUTILS_RECUR)) { + + /* mode of -1: set mode according to umask */ + if (bb_make_directory(dirname(name), -1, FILEUTILS_RECUR)) { xfunc_die(); /* bb_make_directory is noisy */ } free(name); -- cgit v1.1