From c466b946a00c99ec3352212b90b9a12591f93a43 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 7 May 2012 13:12:20 -0400 Subject: [PATCH] CC-3770: Make sure files in /srv/airtime/stor have world-readable permissions. -change read permissions on files right after they're uploaded --- airtime_mvc/application/models/StoredFile.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index d699b47d1..b09421aca 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -879,6 +879,11 @@ Logging::log("getting media! - 2"); $audio_stor = Application_Common_OsPath::join($stor, "organize", $fileName); Logging::log("copyFileToStor: moving file $audio_file to $audio_stor"); + + if (chmod($audio_file, 0644) === false){ + Logging::log("Warning: couldn't change permissions of $audio_file to 0644"); + } + //Martin K.: changed to rename: Much less load + quicker since this is an atomic operation $r = @rename($audio_file, $audio_stor);