This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]