You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by "Kevin A. McGrail" <KM...@PCCC.com> on 2011/08/27 04:37:42 UTC

Re: Fwd: sa-update bug: TMPDIR full?

Moving this from private to dev.

On 8/26/2011 5:23 PM, Michael Scheidell wrote:
> who wants to test out my patch?
> then maybe we can contact some of these 'abusers' and see if they want 
> to test patch.
> (its NOT spam, its transactional email.. we aren't trying to sell them 
> anything)
I don't believe this is spam.  We have a business relationship since 
they are using sa-update
> who wants to write the template email?  our SOC engineers (who are 
> good at tracking down people) can find responsible party.
I don't think we need anything that official.  We are trying to fix a 
legitimate problem and I believe their IT people will be interested in 
trying to resolve the issue.  At worst, they can modify their cron to 
only try 1x per day.
> <https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6655>
>
> i found that sa-update will just happily go about its business (try to 
> pull files from the mirrors, even if it can't write to the TMPDIR).
>
> This patch checks to see if the dir exists (opendir/closedir), and, 
> fixes a problem in logic.
> for some reason, you can open $tmpfile in Util.pm, and it complains if 
> you closefile() it, but it doesn't undef $tmpfile.
>
> diff -bBru  /tmp/Util.pm 
> /usr/local/lib/perl5/site_perl/5.10.1/Mail/SpamAssassin/Util.pm
> --- /tmp/Util.pm    2011-06-06 19:59:17.000000000 -0400
> +++ /usr/local/lib/perl5/site_perl/5.10.1/Mail/SpamAssassin/Util.pm    
> 2011-08-26 17:12:19.000000000 -0400
> @@ -1025,6 +1024,8 @@
>      return;
>    }
>
> +  opendir(my $dh, $tmpdir) || die "Could not open $tmpdir: $!";
> +  closedir $dh;

Michael, doesn't this close the directory handle with no logic to ever 
leave it open?  Is that what you meant?

Also, I don't see why we aren't exiting the program after you've found 
this error.  Is there any point in continuing?

Additionally, I'm thinking we should modify http_get as well to add some 
error traps.

Below this:

if ($response->is_success) {
       return $response->content;
     }

adding something like
else {

if ($result->is_error) {
     dbg("http: $result->error_as_HTML");
     die("ERROR: There was an error contacting: $url.");
}

Regards,
KAM

Re: Fwd: sa-update bug: TMPDIR full?

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Fri, 2011-08-26 at 22:37 -0400, Kevin A. McGrail wrote:
> Moving this from private to dev.
> 
> On 8/26/2011 5:23 PM, Michael Scheidell wrote: 
> > then maybe we can contact some of these 'abusers' and see if they
> > want to test patch.
> > (its NOT spam, its transactional email.. we aren't trying to sell
> > them anything)
> 
> I don't believe this is spam.  We have a business relationship since
> they are using sa-update 

Hah! I believe this is in line with my previous "and occasionally vent"
introduction for the non users@ followers. ;)

For perspective: Shortly before that whole mirror incident and offer by
Michael, he vented about Spamhaus external service provider to falsely
poke him about (ab)using Spamhaus and getting the paid stream.

This scenario, IMHO, is completely different. We wouldn't complain at
all. We don't want money. We won't threaten them to be blocked.

We DO would let them know that  (a) they have a severe configuration
issue on their end, and  (b) we discovered it. That's it. If they
listen, less bandwidth for us, and a problem fixed for them they didn't
even found out about.


So, yes, that would not be spam in any way. And I don't care about
"transactional" or whatever. That is the very reason email addresses for
tech and admin are in whois.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: Fwd: sa-update bug: TMPDIR full?

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
To clarify, I meant run 1x while they work on the issue or until we fix sa-update. Sa-update should be able to run more often.
Regards,
KAM

"Daryl C. W. O'Shea" <sp...@dostech.ca> wrote:

On 26/08/2011 10:37 PM, Kevin A. McGrail wrote:
> I don't think we need anything that official. We are trying to fix a
> legitimate problem and I believe their IT people will be interested in
> trying to resolve the issue. At worst, they can modify their cron to
> only try 1x per day.

I'm -1 on asking people to only run sa-update once a day. I have no 
issue with it being run hourly (or more). I would encourage people to 
run it more than once a day.

Frequent runs of sa-update means a faster automatic time to recovery 
from a bad sa-update update release. If we tell/make people only run it 
once a day they have the very likely potential to have a busted/bad 
update for a day or two.

So long as sa-update is not broken (temp file issue sounds like a 
possible broken-bit) we can control the impact on our DNS servers with 
TTLs. Impact on mirrors should be controlled by the frequency of update 
releases. Essentially... we control everything. If people want to run 
sa-update */5, that's fine by me. I think I run all of mine */15.

Daryl


Re: Fwd: sa-update bug: TMPDIR full?

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
On 26/08/2011 10:37 PM, Kevin A. McGrail wrote:
> I don't think we need anything that official. We are trying to fix a
> legitimate problem and I believe their IT people will be interested in
> trying to resolve the issue. At worst, they can modify their cron to
> only try 1x per day.

I'm -1 on asking people to only run sa-update once a day.  I have no 
issue with it being run hourly (or more).  I would encourage people to 
run it more than once a day.

Frequent runs of sa-update means a faster automatic time to recovery 
from a bad sa-update update release.  If we tell/make people only run it 
once a day they have the very likely potential to have a busted/bad 
update for a day or two.

So long as sa-update is not broken (temp file issue sounds like a 
possible broken-bit) we can control the impact on our DNS servers with 
TTLs.  Impact on mirrors should be controlled by the frequency of update 
releases.  Essentially... we control everything.  If people want to run 
sa-update */5, that's fine by me.  I think I run all of mine */15.

Daryl

Re: Fwd: sa-update bug: TMPDIR full?

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
> I don't think we want to die during the 'for /next mirror()' loop.
An interesting point but perhaps still add a debug statement for 
information?
> if a mirror is busy (503), or is missing a tarball (404), we don't 
> want it to die, we want it to try next mirror.
> does it follow the referrer for the 3xx error? should it?  its gpg 
> signed, so, what is worse that could happen? mirror admin wants to 
> redirect tmp?
How would a 3xx error be generated to begin with?  I would not want 
mirror admins doing any modification of the rsync data.

> actually, it all looks like it's in ram till it writes to tmpdir/fsy 
> at. 681..
> so, a full tmpdir will still pull from the first mirror, but with my 
> patches to Util.pm, it won't even try if tmpdir is missing or read only.
> Util.pm MIGHT need to check for minimum free space, but I think that 
> is not necessary at this time.
>
>
> which already looks like it has this:
>   open(TMP, ">$content_file") || die "fatal: can't write to content 
> temp file $content_file: $!\n";
>   binmode TMP;
>   print TMP $content;
>   close(TMP);
>
> I suggest this:
>   open(TMP, ">$content_file") || die "fatal: can't open content temp 
> file $content_file: $!\n";
>   binmode TMP;
>   print TMP $content || die "fatal: can't write to content temp file 
> $content_file: $!\n";
>   close(TMP);
The check that the print worked and the tmp dir is moving in the write 
direction.
> which bring up another point  if http_get() runs out of RAM, there 
> isn't anything to catch that.
The error trapping is pretty minimal.
>
> so, I am going to add the above patch to my bug after I try it out.
> if this works, I will try to have out third shift guys contact admins 
> at the 'buggy' sa installs and see if we can't get them to test these 
> patches.
Can you add the current patch to the bugzilla note for Util.pm and 
sa-update.raw?  I'll test em and make sure they compile/work for me.  
Otherwise, sounds like a plan.  I'm all for contacting them ahead of 
time and seeing what is causing their real-world issue as well.

Regards,
KAM