Page MenuHomeFreeBSD

Improve blacklistd support in mail/sendmail port
ClosedPublic

Authored by lidl on Dec 13 2017, 4:47 AM.

Details

Reviewers
dinoex
emaste
Summary

Rather than hacking the support into main.c, properly construct
a better diff against sendmail.

Now requires a configuration file option, or command line option to
enable blacklistd support, but this means the support can be
distributed in all binaries, and only activated when needed.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

lidl created this revision.Dec 13 2017, 4:47 AM
dinoex requested changes to this revision.Dec 16 2017, 6:49 AM

instead of hard define(`bldSOURCES') is sould be better to extend the the m4 macro in a seperate line,
else the given patch will break with new sendmail releases.

This revision now requires changes to proceed.Dec 16 2017, 6:49 AM
lidl updated this revision to Diff 36702.Dec 18 2017, 3:21 AM

Since the blacklistd support now needs to be enabled at runtime,
it is safe to turn on support for it in all cases, so do that in the Makefile.

Adjust how blacklistd.c is added to the sendmail/Makefile.m4 file,
as requested in review.

Fixed an error where a non-blacklistd related change to Makefile.m4
was dropped in the previous version of the patch.

in case blacklist is not used, the extra calls to sm_io_getinfo are not covered my the #ifdef

fd = sm_io_getinfo( ... )

Is this intentional?

lidl added a comment.Dec 18 2017, 11:00 PM

Pretty much, yes.

I didn't think it was worthwhile cluttering up the files with extra
#ifdef/#endif pairs around the allocation of the variable and
the setting of the variable.

mat added inline comments.Dec 19 2017, 6:07 PM
Makefile
82–85

This cannot possibly work. You cannot change the content of OPTIONS_DEFAULT after including b.p.options.mk. (Well, you can change it, it simply will not do anything.)

lidl added a comment.Dec 20 2017, 2:47 PM

Ok, I see where my testing lead me to believe this worked. Turns out the 'make config'
stage was picking up an options file that I did not believe existed.

Is there a way to alter the DEFAULT_OPTIONS such that they are different on
FreeBSD 11.x (and newer) compared to the settings for older releases?

mat added a comment.Dec 20 2017, 2:51 PM

There are no simple ways, no.

If blacklistd has is not supported before 11, what you can do is:

OPTIONS_EXCLUDE_FreeBSD_10= BLACKLISTD
lidl added a comment.Dec 20 2017, 8:44 PM

Is FreeBSD10 the only other OS version that is still supported for building /usr/ports
and the only one that needs to be listed this way?

dinoex added a comment.Jan 2 2018, 8:56 PM

FreeBSD10 and FreeBSD11 are supported for building /usr/ports

so we can add to OPTIONS:DEFAULT and disabled it on FreeBSD10.

The build on FreeBSD10 still failed:

../../sendmail/sendmail.h:60:10: fatal error: 'blacklist.h' file not found
#include <blacklist.h>

^

1 error generated.

I had to skip the include in sendmail.h:
+#if USE_BLACKLIST
+#include <blacklist.h>
+#endif

I have a cleaned up patch in testing, but i conflicts with the recent smtputf8 commit.

The patch was merged and commited.

dinoex accepted this revision.Jan 15 2018, 12:48 PM

please close D13475
the patches have been merged.

This revision is now accepted and ready to land.Jan 15 2018, 12:48 PM
lidl closed this revision.Jan 17 2018, 12:29 AM