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 2007/07/18 21:51:47 UTC

[Bug 5566] New: Access denied writing to tmp file

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

           Summary: Access denied writing to tmp file
           Product: Spamassassin
           Version: 3.2.1
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: infosis@abelsonsa.com.ar


spamd reports
warn: util: secure_tmpfile failed to create file
'/root/tmp/.spamassassin7688bq4Fdstmp': Permission denied

...followed by a series of warnings about working on closed filehandle $tmpfile

spamd is running as root
/root/tmp permissions are 770
TMPDIR=/root/tmp

Apparently the failure to create the temp file should have been caught but it
wasn't.



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

[Bug 5566] Access denied writing to tmp file

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





------- Additional Comments From felicity@apache.org  2007-07-18 13:30 -------
it's worth noting that when this came up (on the users@ list iirc), it was
specifically related to the Message code using temp files for non-text raw
parts.  it appeared, based on the errors, that even if secure_tmpfile() failed,
Message continued on assuming the file existed, thereby causing a bunch of other
errors to pop up later on if that part was accessed.

the code looks like it's doing the right thing, but then why do the errors come
up? :)   so we should verify the issue anyway.


  if ($msg->{'type'} !~ m@^(?:text/(?:plain|html)$|message\b)@) {
    my $filepath;
    ($filepath, $msg->{'raw'}) = Mail::SpamAssassin::Util::secure_tmpfile();

    if ($filepath) {
      # The temp file was created, add it to the list of pending deletions
      # we cannot just delete immediately in the POSIX idiom, as this is
      # unportable (to win32 at least)
      push @{$self->{tmpfiles}}, $filepath;
      $msg->{'raw'}->print(@{$body});
    }
  }

  # if the part didn't get a temp file, go ahead and store the data in memory
  if (!exists $msg->{'raw'}) {
    $msg->{'raw'} = $body;
  }




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