Bug 3571 - [review] Add notice about SSL support to spamc -V
Summary: [review] Add notice about SSL support to spamc -V
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All Linux
: P5 enhancement
Target Milestone: 3.0.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3573
  Show dependency tree
 
Reported: 2004-07-06 11:34 UTC by Malte S. Stretz
Modified: 2004-07-07 05:18 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
patch against spamc.c patch None Malte S. Stretz [HasCLA]
patch against spamd.raw patch None Malte S. Stretz [HasCLA]
real patch against spamd.raw patch None Malte S. Stretz [HasCLA]
combined patch with stdout instead of stderr patch None Malte S. Stretz [HasCLA]
Test case that spamd/spamc work using SSL application/zip None Sidney Markowitz [HasCLA]
patch for t/SATest.pm to define $SSL_AVAILABLE patch None Sidney Markowitz [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Malte S. Stretz 2004-07-06 11:34:16 UTC
Theo suggested this on the mailinglist, I liked the idea, here's the patch :)
Comment 1 Malte S. Stretz 2004-07-06 11:34:51 UTC
Created attachment 2085 [details]
patch against spamc.c
Comment 2 Malte S. Stretz 2004-07-06 11:54:00 UTC
Created attachment 2086 [details]
patch against spamd.raw

Why not for spamd, too?
Comment 3 Malte S. Stretz 2004-07-06 11:56:54 UTC
Created attachment 2087 [details]
real patch against spamd.raw

oops, I accidently attached spamd.raw, not the patch
Comment 4 Theo Van Dinter 2004-07-06 12:11:14 UTC
Subject: Re:  [review] Add notice about SSL support to spamc -V

On Tue, Jul 06, 2004 at 11:54:01AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote:
> Why not for spamd, too?

IMO, spamd can use either all the time.  spamc can only do SSL if it's
built to support it.

I'm not quite sure why we changed it from "always link SSL if it's
available" , but ...

Comment 5 Malte S. Stretz 2004-07-06 12:23:49 UTC
doh. now I remember why the ENABLE_SSL wasn't passed to configure: it detected 
the presence of the OpenSSL libs automagically. 
 
Should we change the fix from bug 3569 so it passes the --enable-ssl only if 
ENABLE_SSL was given so its still determined automagically else? 
 
I actually prefer the current, new behaviour: It's more deterministic and 
linking against OpenSSL can be a real PITA because the interface often isn't 
binary compatible even between minor releases. 
Comment 6 Sidney Markowitz 2004-07-06 17:32:29 UTC
I have some problems trying to use this:

In spamd, --version doesn't show up in in the usage display. Is that a bug?

I tried to use this by adding the following to SATest.pm:

I declared our $SSL_AVAILABLE; where the other our variables are declared, and
assigned it in sa_t_init after the commands for calling spamd and spamc are
defined, using the statement:

$SSL_AVAILABLE = ((`$perl_cmd ../spamd/spamd --version` =~ /with SSL support/) &&
                  (`$spamc -V` =~ /with SSL support/));

The problem is that spamc -V writes only to stderr. Can it go to stdout to make
it easy to capture with `spamc -V` or is there a simple way I don't know about
to do it with stderr? Remember that redirection syntax will not work with the
system command when running under Windows.

By defining and assigning $SSL_AVAILABLE in SATest.pm, it is available for my
spamd_ssl.t test to use to decide whether to run.
Comment 7 Malte S. Stretz 2004-07-06 18:10:46 UTC
Yeah, --version should probably appear in spamd's usage. The same is true for 
--help. 
 
The version output should really go to stdout, don't ask me why I directed it 
to stderr when I wrote that code. Revised patch follows.  
 
(Side note: eat least under Windows XP's cmd.exe '2> &1' works :) 
Comment 8 Malte S. Stretz 2004-07-06 18:11:45 UTC
Created attachment 2088 [details]
combined patch with stdout instead of stderr
Comment 9 Sidney Markowitz 2004-07-06 18:14:42 UTC
Created attachment 2089 [details]
Test case that spamd/spamc work using SSL

A test case t/spamd_ssl.t and test key/certificate files to be installed in
t/data/etc/

The code in spamd_ssl.t refers to $SSL_AVAILABLE which is assumed to be set in
SATest.pm as per my comment, and which depends on the other patches uploaded
for this bug.
Comment 10 Sidney Markowitz 2004-07-06 18:24:30 UTC
> at least under Windows XP's cmd.exe '2> &1' works :) 

Oh, right, it's some other case involving exec and redirection that doesn't work
under Windows whicn we had to deal with for forking a spamd for testing. My
brain refuses to retain exactly what that case is without looking it up again
every time :-)
Comment 11 Daniel Quinlan 2004-07-06 18:28:17 UTC
Are any of these sent over the wire or something that needs to be read?

If so, this sort of information should be put into an easily parsed format
that would support more compile-time options than just SSL, the SSL
version number, etc.
Comment 12 Sidney Markowitz 2004-07-06 18:48:21 UTC
Created attachment 2090 [details]
patch for t/SATest.pm to define $SSL_AVAILABLE

This patch uses the patches that are here for spamc and spamd to set a variable
$SSL_AVAILABLE that is used by the new test case spamd_ssl.t submitted in
another patch.

This completes the patches for this bug.

I vote +1
Comment 13 Sidney Markowitz 2004-07-06 18:51:21 UTC
By the way, I pulled out the fix for bug 3527 and verified that this test case
would have caught that, as well as the build problem that was fixed for bug 3569
Comment 14 Theo Van Dinter 2004-07-06 19:43:31 UTC
-1 for the test stuff.  this ticket isn't about a ssl test.  feel free to open another ticket/etc.
Comment 15 Sidney Markowitz 2004-07-06 19:52:11 UTC
> this ticket isn't about a ssl test

Ah, ok. I thought of it as coming out of my question about the test on the
mailing list. But a mailing list post is not a ticket either... I'm off to file
a ticket...

I'm still +1 on the non-test parts of this one.
Comment 16 Justin Mason 2004-07-07 12:19:23 UTC
+1 on patch 2088
Comment 17 Theo Van Dinter 2004-07-07 12:55:48 UTC
+1 on 2088

committed.  r22683