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 2019/01/02 20:19:56 UTC

[Bug 7675] New: The -D/--debug option is mis-parsed in sa-learn, spamassassin, and possibly other scripts.

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7675

            Bug ID: 7675
           Summary: The -D/--debug option is mis-parsed in sa-learn,
                    spamassassin, and possibly other scripts.
           Product: Spamassassin
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: spamassassin
          Assignee: dev@spamassassin.apache.org
          Reporter: billcole@apache.org
  Target Milestone: Undefined

There is a logical error/pitfall in parsing the -D/--debug argument in AT LEAST
the spamassassin and sa-learn scripts which needs to be either fixed or
documented. If you do not follow the option with a list of debug channels,
another option, or '--' (indicating the end of options,) it MUST be the last
token on the command line. If there is one or more pathnames after --debug, the
first will be interpreted as a debug channel. I do not see exactly how this
could lead 

Conversely, the documentation for sa-learn does not actually cover the use case
of feeding the messages to be learned to sa-learn via STDIN, although that does
work. 

For 3.4.3 I think the best approach is to document that -D/--debug MUST have an
argument rather than saying it defaults to 'all' when in fact that does not
work in the sa-learn or spamassassin scripts if it is at all possible to
interpret the following command line token as a channel. It could be disruptive
in the terminal 3.x release to change the behavior, even if the existing
behavior is arguably a bug. 

For 4.x we need to fix the behavior. Either remove the botched 'default to all'
implementation which is inconsistent with the implementation of an extensible
set of arbitrarily-named debug channels or fix the Getopt::Long-based command
line parser to detect when the token after -D/--debug is a pathname.

I ran across this while investigating bug 7674, which may or may not be
related.

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

[Bug 7675] The -D/--debug option is mis-parsed in sa-learn, spamassassin, and possibly other scripts.

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7675

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|Undefined                   |4.0.0
             Status|NEW                         |RESOLVED

--- Comment #2 from Sidney Markowitz <si...@sidney.com> ---
Committed revision 1899918.

Documentation change

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

[Bug 7675] The -D/--debug option is mis-parsed in sa-learn, spamassassin, and possibly other scripts.

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7675

Stingertough <wo...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wolfsplat@gmail.com

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

[Bug 7675] The -D/--debug option is mis-parsed in sa-learn, spamassassin, and possibly other scripts.

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7675

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sidney@sidney.com

--- Comment #1 from Sidney Markowitz <si...@sidney.com> ---
It is not possible to distinguish between a pathname and a debug area name.
There could be a file in the current directory whose name is a debug area name,
making it truly ambiguous. The two solutions I see are to either 1) document in
the perldoc description of -D that when it is the last option on the command
line before a path, to specify all areas use either -- '' or 'all'  or 2) make
the area argument to -D not optional.

I don't like the second alternative because it will break what people are used
to and may have put in scripts. Note that, for example spamassassin -D -L ...
silently changes behavior because when the argument to -D is not optional '-L'
is not recognized as a new option and unknown debug areas silently do nothing.
The first alternative seems good enough, and that makes it just a documentation
change.

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