statcache need to be updated on chmod, chown or chgrp

This commit is contained in:
Ralf Becker 2014-12-12 13:45:43 +00:00
parent 176b12e18d
commit 079e7d81eb

View File

@ -889,6 +889,10 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
} }
$stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_uid=:fs_uid WHERE fs_id=:fs_id'); $stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_uid=:fs_uid WHERE fs_id=:fs_id');
// update stat-cache
if ($path != '/' && substr($path,-1) == '/') $path = substr($path, 0, -1);
self::$stat_cache[$path]['fs_uid'] = $owner;
return $stmt->execute(array( return $stmt->execute(array(
'fs_uid' => (int) $owner, 'fs_uid' => (int) $owner,
'fs_id' => $stat['ino'], 'fs_id' => $stat['ino'],
@ -930,6 +934,10 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
} }
$stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_gid=:fs_gid WHERE fs_id=:fs_id'); $stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_gid=:fs_gid WHERE fs_id=:fs_id');
// update stat-cache
if ($path != '/' && substr($path,-1) == '/') $path = substr($path, 0, -1);
self::$stat_cache[$path]['fs_gid'] = $owner;
return $stmt->execute(array( return $stmt->execute(array(
'fs_gid' => $owner, 'fs_gid' => $owner,
'fs_id' => $stat['ino'], 'fs_id' => $stat['ino'],
@ -969,6 +977,10 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
} }
$stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_mode=:fs_mode WHERE fs_id=:fs_id'); $stmt = self::$pdo->prepare('UPDATE '.self::TABLE.' SET fs_mode=:fs_mode WHERE fs_id=:fs_id');
// update stat cache
if ($path != '/' && substr($path,-1) == '/') $path = substr($path, 0, -1);
self::$stat_cache[$path]['fs_mode'] = ((int) $mode) & 0777;
return $stmt->execute(array( return $stmt->execute(array(
'fs_mode' => ((int) $mode) & 0777, // we dont store the file and dir bits, give int overflow! 'fs_mode' => ((int) $mode) & 0777, // we dont store the file and dir bits, give int overflow!
'fs_id' => $stat['ino'], 'fs_id' => $stat['ino'],