From f211caf8ae98eaea28d1dc4cf3affd56de0e1adc Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 21 Dec 2007 21:01:13 +0000 Subject: [PATCH] - user web: when creating cache dir, chmod() so that protections are right regardless of umask. From Nicolas Alvarez; fixes #344 svn path=/trunk/boinc/; revision=14435 --- checkin_notes | 8 ++++++++ html/inc/cache.inc | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 5409e56309..f9f33f9c4a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -12438,3 +12438,11 @@ David 21 Dec 2007 boinc_api.C sched/ delete_file.C + +David 21 Dec 2007 + - user web: when creating cache dir, chmod() so that + protections are right regardless of umask. + From Nicolas Alvarez; fixes #344 + + html/inc/ + cache.inc diff --git a/html/inc/cache.inc b/html/inc/cache.inc index f431d511ef..1c55a8c8f9 100644 --- a/html/inc/cache.inc +++ b/html/inc/cache.inc @@ -11,11 +11,15 @@ if (function_exists("apache_request_headers")) { // mechanism for caching commonly-accessed pages function make_cache_dirs() { - if (!@filemtime("../cache")) mkdir("../cache", 0770); + if (!@filemtime("../cache")) { + mkdir("../cache", 0770); + chmod("../cache", 0770); + } for ($i=0;$i<256;$i++) { $j=sprintf("%02x",$i); if (!@filemtime("../cache/$j")) { mkdir("../cache/$j", 0770); + chmod("../cache/$j", 0770); } } }