You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2006/03/16 03:57:25 UTC

[Bug 4827] New: M::SA::find_existing_path() returns last path if none exist

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

           Summary: M::SA::find_existing_path() returns last path if none
                    exist
           Product: Spamassassin
           Version: 3.1.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: felicity@apache.org


While trying to track down a user's issue off of the mailing list, I found out that no matter what the default 
rules directory was supposed to be, "spamassassin -D" always reported /usr/share/spamassassin.  Further 
debugging found that if none of the standard directories existed, or if permissions were such that the 
standard directories weren't accessable, /usr/share/spamassassin was chosen by default.

I'd like to change the behavior so that if none of the paths are accessible undef is returned, and then for 
anything calling find_existing_path(), we check for that and throw a warning that the directory wasn't 
found.  Ideally I'd like spamassassin/spamd to throw an error and quit, but that requires a lot more 
changes.  At least with this small change, reading the debug output won't be so confusing.



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


spamassassin@dostech.ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes               |needs 1 vote




------- Additional Comments From spamassassin@dostech.ca  2006-03-31 02:47 -------
+1



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From felicity@apache.org  2006-04-03 19:46 -------
Committed revision 391116.

:)



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827





------- Additional Comments From jm@jmason.org  2006-04-03 10:51 -------
+1



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

[Bug 4827] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827





------- Additional Comments From felicity@apache.org  2006-03-16 04:57 -------
Created an attachment (id=3415)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3415&action=view)
suggested patch

ok, here's the patch that makes first_existing_path() return undef if no paths
are found, and also deals with the cascading effect throughout M::SA for
functions which return what first_existing_path() returns, etc.  passes "make
test" for 3.1 and 3.2.

original version with no system installed rules:

[7019] dbg: config: using "/usr/share/spamassassin" for sys rules pre files
[7019] dbg: config: using "/usr/share/spamassassin" for default rules dir

and with the patch:

[7017] warn: config: could not find site rules directory
[7017] warn: config: could not find sys rules directory


:)



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|M::SA::find_existing_path() |[review]
                   |returns last path if none   |M::SA::first_existing_path()
                   |exist                       |returns last path given if
                   |                            |none exist




------- Additional Comments From felicity@apache.org  2006-03-16 03:06 -------
in case my original comment isn't clear:

$path = first_existing_path(qw@ /notexist1 /notexist2 /notexist3 @);

will set $path to "/notexist3", even though it doesn't exist, which makes it annoying to debug because it's 
not clear where that path comes from.



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

[Bug 4827] M::SA::find_existing_path() returns last path if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|Undefined                   |3.1.2






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

[Bug 4827] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[review]                    |M::SA::first_existing_path()
                   |M::SA::first_existing_path()|returns last path given if
                   |returns last path given if  |none exist
                   |none exist                  |




------- Additional Comments From felicity@apache.org  2006-03-16 03:37 -------
prematurely set this to review, sorry.



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bryanh@giraffe-data.com




------- Additional Comments From felicity@apache.org  2006-04-30 02:45 -------
*** Bug 4886 has been marked as a duplicate of this bug. ***



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

[Bug 4827] [review] M::SA::first_existing_path() returns last path given if none exist

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4827


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|M::SA::first_existing_path()|[review]
                   |returns last path given if  |M::SA::first_existing_path()
                   |none exist                  |returns last path given if
                   |                            |none exist
  Status Whiteboard|                            |needs 2 votes






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