http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5507





------- Additional Comments From [EMAIL PROTECTED]  2007-08-22 06:48 -------
> +1 for application to 3.2.x, if you want

Perhaps, although there are dozens of other cases which test
for -f, -d, -e and similar, without calling stat() or lstat()
first, and therefore can not distinguish between (for example)
not being a directory or not existing or an access violation,
and not being able to be specific whether a test should follow
a symbolic link or not. In the least this causes a misleading
diagnostics, or at worst can cause a wrong decision.

If you think this can be a good idea, I'd like to undertake
another global sweep across modules and replace simple
tests like -f $file with a: stat($file); ... -f _,
along the lines of the patch above or the following
code section:

+  use Errno qw(ENOENT EACCES);

-  if (... -d $path) { ... }
+  my($errn) = stat($path) ? 0 : 0+$!;
+  if    ($errn == ENOENT) { ... }  # does not exist
+  elsif ($errn) { info("config: \"$path\" is inaccessible: $!") }
+  elsif (-d _)  { ... }  # is a directory ...

The amount of change would make this suitable for 3.3.0,
and probably not worth fixing a single case for 3.2.* .



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to