Media scanner does not skip Permission Denied errors
Status: Beta
Brought to you by:
frozen4time
I have a few maps in my music dir without read/execute permissions for the web user.
I did this to prevent it being indexed (Contained some sample mp3-files of a DJ-program); when updating the media database it raises a warning about permission denied in opendir, and after that another warning of readdir, 'cause opendir failed :P
Logged In: YES
user_id=1895263
Originator: YES
Fix:
1. Open core/indexing/MediaDBMaintainer.php
2. Search for opendir
3. Add these lines before opendir:
if(!is_dir($file) || !is_readable($file) || !is_executable($file))
return FALSE;
4. Repeat steps 2 and 3
5. Repeat steps 2 upto 4 for core/indexing/MediaInfoCacheMaintainer.php
And atleast indexing won't raise these errors
Grep on opendir resulted:
core/browser/SLDirExplorer.php: $handle=opendir($dir);
core/indexing/MediaDBMaintainer.php: $dir = opendir( $file );
core/indexing/MediaDBMaintainer.php: $dir = opendir( $file );
core/indexing/MediaInfoCacheMaintainer.php: $dir = opendir( $file );
core/indexing/MediaInfoCacheMaintainer.php: $dir = opendir( $file );
core/playlist/SLPLDirAdder.php: $handle=opendir( $cur_path );
core/theme/SLThemeManager.php: $handle=opendir( $this->path );
core/M3UGenerator.php: $handle=opendir( $cur_path );
Don't know whether all of them are bugging