This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] gnathtml.pl: Use 755 as mask for new directories.
- From: Giuseppe Scrivano <gscrivano at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at act-europe dot fr>
- Date: Mon, 12 Apr 2010 16:49:42 +0200
- Subject: [PATCH] gnathtml.pl: Use 755 as mask for new directories.
Currently the gnathtml.pl script will create world-writable directories
when the process has a too permissive umask. This trivial patch avoids
it. Inspired by CVE-2009-4029 [1].
Cheers,
Giuseppe
[1] http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-4029
gcc/ada/ChangeLog
2010-04-12 Giuseppe Scrivano <gscrivano@gnu.org>
* gnathtml.pl: Use 755 as mask for new directories.
diff --git a/gcc/ada/gnathtml.pl b/gcc/ada/gnathtml.pl
index 1ab4423..548fde1 100644
--- a/gcc/ada/gnathtml.pl
+++ b/gcc/ada/gnathtml.pl
@@ -1090,9 +1090,9 @@ EOF
local ($index_file) = 0;
-mkdir ($output_dir, 0777) if (! -d $output_dir);
-mkdir ($output_dir."/files", 0777) if (! -d $output_dir."/files");
-mkdir ($output_dir."/funcs", 0777) if (! -d $output_dir."/funcs");
+mkdir ($output_dir, 0755) if (! -d $output_dir);
+mkdir ($output_dir."/files", 0755) if (! -d $output_dir."/files");
+mkdir ($output_dir."/funcs", 0755) if (! -d $output_dir."/funcs");
&parse_prj_file ($prjfile) if ($prjfile);