Hello,

On OpenBSD 5.2 amd64, my spamd (which is used very selectively through 
pf(4)) seems to have died 20 days ago, after continuously running for 
many months, with the following final words in the logs:

Sep 10 09:49:25 Cns spamd[5220]: 87.225.1.10: connected (1/1), lists: 
spamd-greytrap
Sep 10 09:54:47 Cns spamd[29672]: greyreader failed (Error 2)

There were minor changes to grey.c since 5.2.

Back in 5.2, it would appear that at the end of grey.c#greyreader(), 
after the `grey` pipe is exhausted, greyreader() returns at the end 
of the function, and then grey.c#greywatcher() issues the error 
message, as above, unconditionally after greyreader() returns, 
and also exits.

Whereas it remains to be seen what kind of bug I'm facing here 
(Google reveals I'm not alone), it would appear that changes 
introduced in 5.4-current would no longer cause spamd to report 
such situation, because the 0 that would still be returned at the 
end of greyreader() would no longer cause greywatcher() to produce 
the error message that I have received (it'll still quit, though).

http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/spamd/grey.c.diff?r1=1.52;r2=1.53;f=h
http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/spamd/grey.c.diff?r2=1.53&r1=1.52&f=u

Basically, the below part of the recent commit seems to modify the 
behaviour that was not advertised to have been modified:

####
@@ -979,7 +979,7 @@ greyreader(void)
        sync = 1;
        if (grey == NULL) {
                syslog_r(LOG_ERR, &sdata, "No greylist pipe stream!\n");
-               exit(1);
+               return (-1);
        }
 
        /* grab trap suffixes */
@@ -1140,10 +1140,11 @@ greywatcher(void)
                 */
                close(pfdev);
                setproctitle("(%s update)", PATH_SPAMD_DB);
-               greyreader();
-               syslog_r(LOG_ERR, &sdata, "greyreader failed (%m)");
-               /* NOTREACHED */
-               _exit(1);
+               if (greyreader() == -1) {
+                   syslog_r(LOG_ERR, &sdata, "greyreader failed (%m)");
+                   _exit(1);
+               }
+               _exit(0);
        }
 
 
####
                http://bxr.su/o/libexec/spamd/grey.c#greywatcher

Is it indeed intentional that "greyreader failed (Error 2)" will be 
produced no more as a result of the above change?

Any ideas what caused greyreader to fail on my OpenBSD 5.2 in the first place?

Cheers,
Constantine.


On 2013-W34-3 10:13 -0600, Todd C. Miller wrote:
> CVSROOT:      /cvs
> Module name:  src
> Changes by:   mill...@cvs.openbsd.org 2013/08/21 10:13:30
>
> Modified files:
>       usr.sbin/spamdb: Makefile spamdb.c 
>       libexec/spamd  : Makefile grey.c grey.h 
>       libexec/spamlogd: Makefile spamlogd.c 
> Added files:
>       libexec/spamd  : gdcopy.c 
>
> Log message:
> Remove the use of time_t in the greylist db file and use int64_t instead
> with backwards compatibility for records with 32-bit times.
> OK deraadt@ beck@

Reply via email to