Up to and including PermissionScanner 1.5, that free utility to check for incorrect permissions has used a simple method of determining whether any given file has read or write permissions. I described this in detail here, and lamented its shortcomings yesterday. This new version of PermissionScanner should return far fewer false positives and negatives, as it uses a more sophisticated algorithm.
Previous versions of PermissionScanner have relied on Foundation’s FileManager to discover whether each file found during a scan is readable/writable. As two users have recently reported (thank you Al and Adam), this doesn’t seem reliable and can make it appear that some files which are readable/writable aren’t. The two possibilities are that the FileManager calls are returning incorrect results, or that FileManager can’t determine a result for that particular file.
This new version uses a more complex algorithm, which uses calls on URLs to check whether an item is readable/writable when FileManager might be returning an incorrect answer. This is explained in the following diagram.
First, PermissionScanner now always ignores all symbolic links. It then asks FileManager whether the item exists. If FileManager reports that it can’t determine whether the item exists (or it doesn’t exist), then instead of asking FileManager whether the item is readable/writable, the app then uses the item’s URL to check whether it’s readable/writable. If FileManager reports that the file exists, the code first uses FileManager to check whether the item is readable/writable. If that result indicates that it’s not, then the URL is checked as well before accepting that file as not being readable/writable.
In testing here, this greatly reduces the number of items reported as being not readable/writable, while files with incorrect permissions are still correctly detected.
Replacing the Shallow option in version 1.5 is a Strict option, which currently only reports some results in a different way by applying this algorithm in a slightly stricter manner. Where PermissionScanner appears to be working correctly, this isn’t going to make any difference to detection or reporting, I hope.
The end result should be a utility which is both more accurate and more useful.