From edc00340c81da600e6af7bbe0e68e9b0a3e2b4b8 Mon Sep 17 00:00:00 2001 From: aCaB Date: Fri, 29 Aug 2008 01:01:34 +0000 Subject: [PATCH] allow skipping checks on sendmail.cf - bb#726 git-svn: trunk@4149 --- ChangeLog | 9 +++++++++ clamav-milter/clamav-milter.c | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa24d60da..bd449f954 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Aug 29 02:46:19 CEST 2008 (acab) +------------------------------------ + * clamav-milter: Add option "--no-check-cf" to bypass sendmail.cf sanity + checks. For use by package maintainers on fresh installs, + when sendmail.cf is present for any reason although it's + not used or when the milter is configured via an m4 file + included in sendmail.cf. This option is intentionally + not extensively documented (bb#726) + Thu Aug 28 15:13:07 CEST 2008 (acab) ------------------------------------ * unit_tests/check_disasm: add the remaining test cases (fpu, prefixes and more) diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c index 0ed81585f..a393b4bc3 100644 --- a/clamav-milter/clamav-milter.c +++ b/clamav-milter/clamav-milter.c @@ -542,6 +542,7 @@ static const char *whitelistFile; /* * addresses that we don't scan */ static const char *sendmailCF; /* location of sendmail.cf to verify */ +static int checkCF = 1; static const char *pidfile; static int black_hole_mode; /* * Since sendmail calls its milters before it @@ -686,6 +687,7 @@ help(void) puts(_("\t--quarantine-dir=DIR\t-U DIR\tDirectory to store infected emails.")); puts(_("\t--server=SERVER\t\t-s SERVER\tHostname/IP address of server(s) running clamd (when using TCPsocket).")); puts(_("\t--sendmail-cf=FILE\t\tLocation of the sendmail.cf file to verify")); + puts(_("\t--no-check-cf\t\tSkip verification of sendmail.cf")); puts(_("\t--sign\t\t\t-S\tAdd a hard-coded signature to each scanned message.")); puts(_("\t--signature-file=FILE\t-F FILE\tLocation of signature file.")); puts(_("\t--template-file=FILE\t-t FILE\tLocation of e-mail template file.")); @@ -893,6 +895,9 @@ main(int argc, char **argv) { "sendmail-cf", 1, NULL, '0' }, + { + "no-check-cf", 0, &checkCF, 0 + }, { "server", 1, NULL, 's' }, @@ -934,8 +939,8 @@ main(int argc, char **argv) if(ret == -1) break; - else if(ret == 0) - ret = long_options[opt_index].val; + else if(ret == 0) + continue; switch(ret) { case 'a': /* e-mail errors from here */ @@ -1135,7 +1140,7 @@ main(int argc, char **argv) port = argv[optind]; if(rootdir == NULL) /* FIXME: Handle CHROOT */ - if(verifyIncomingSocketName(port) < 0) { + if(checkCF && verifyIncomingSocketName(port) < 0) { fprintf(stderr, _("%s: socket-addr (%s) doesn't agree with sendmail.cf\n"), argv[0], port); return EX_CONFIG; }