Browse Source

Merge pull request #174 from reneluria/master

loosen perms for fpm
Tobias Reich 10 years ago
parent
commit
cbddb79391
1 changed files with 4 additions and 1 deletions
  1. 4 1
      php/modules/misc.php

+ 4 - 1
php/modules/misc.php

@@ -120,6 +120,9 @@ function get_hashed_password($password) {
 
 function hasPermissions($path, $permissions = '0777') {
 
+	/* assume that if running with the same uid as the owner of the directory it's ok */
+	$stat = @stat($path);
+	if ($stat && ($stat['uid'] == getmyuid())) return true;
 	if (substr(sprintf('%o', @fileperms($path)), -4)!=$permissions) return false;
 	else return true;
 
@@ -157,4 +160,4 @@ function fastimagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x,
 
 }
 
-?>
+?>