Package: sendmail
Version: 8.13.4-3sarge3
Severity: normal

The /usr/share/sendmail/sendmail script uses ad-hoc locking techniques
when invoked with the argument cron-msp.  Here's the code:

if [ ! -f $STAMP_DIR/cron_msp ]; then
        touch $STAMP_DIR/cron_msp;
        #clean_queues /var/spool/mqueue-client;
        $MSP_COMMAND -q $MSP_A $MSP_L_QUEUE \
                $MSP_PARMS $MISC_PARMS \
                $CRON_PARMS || true;
        rm -f $STAMP_DIR/cron_msp;
        fi;
fi;

There are several problems with that code:

1) It's vulnerable to a race condition.  Admittedly, in real life, the race
is extremely unlikely to happen.

2) More seriously, if the script dies for some reason (like OOM killer or
something) after the "touch" and before the "rm", the lock file stays
around forever, and your Sendmail queue runs simply never happen...

3) Furthermore, the $MSP_COMMAND -q invocation returns almost immediately,
leaving the queue runner running in the background.  So although this
code sort-of works to ensure that you don't have simultaneous cron jobs
running, it does *absolutely nothing* to guard against multiple Sendmail
mqueue-client queue runs.

IMO, the whole idea of doing queue runs from cron should be trashed,
because you have no way to gracefully control the maximum number of
queue runners (in Daemon Mode, you can use MaxQueueChildren.)

Regards,

David.

-- Package-specific info:
Ouput of /usr/share/bug/sendmail/script:

ls -alR /etc/mail:
/etc/mail:
total 612
drwxr-sr-x    8 smmta smmsp  4096 Sep  6 22:01 .
drwxr-xr-x  120 root  root   8192 Sep  7 08:56 ..
-rwxr-xr--    1 root  smmsp  9901 Sep  6 22:01 Makefile
-rw-------    1 root  root   4280 Sep  6 16:36 access
-rw-r--r--    1 root  root   4280 Sep  6 16:36 access.1
-rw-r--r--    1 root  root   4299 Apr 18 12:31 access.10
-rw-r--r--    1 root  root   4280 Apr 25 16:20 access.2
-rw-r--r--    1 root  root   4280 Apr 25 16:08 access.3
-rw-r--r--    1 root  root   4280 Apr 25 11:38 access.4
-rw-r--r--    1 root  root   4280 Apr 19 10:58 access.5
-rw-r--r--    1 root  root   4280 Apr 18 16:18 access.6
-rw-r--r--    1 root  root   4280 Apr 18 15:32 access.7
-rw-r--r--    1 root  root   4307 Apr 18 13:12 access.8
-rw-r--r--    1 root  root   4280 Apr 18 13:12 access.9
-rw-r-----    1 smmta smmsp 12288 Sep  6 22:01 access.db
-rw-r--r--    1 root  root    281 Jun  3  2005 address.resolve
lrwxrwxrwx    1 root  smmsp    10 Aug 11  2005 aliases -> ../aliases
-rw-r-----    1 smmta smmsp 12288 Sep  6 22:01 aliases.db
drwxr-xr-x    3 root  root   4096 Sep  6 14:56 canit
-rw-r--r--    1 root  root   3088 Sep  6 22:01 databases
-rw-r--r--    1 root  root   5588 Jun  3  2005 helpfile
-rw-r--r--    1 root  smmsp    38 Aug 11  2005 local-host-names
drwxr-sr-x    2 smmta smmsp  4096 Aug 11  2005 m4
-rw-r--r--    1 root  root     72 Sep  6 16:36 mailertable
-rw-r--r--    1 root  root     72 Sep  6 16:36 mailertable.1
-rw-r--r--    1 root  root    114 Apr 18 12:31 mailertable.10
-rw-r--r--    1 root  root     72 Apr 25 16:20 mailertable.2
-rw-r--r--    1 root  root     72 Apr 25 16:08 mailertable.3
-rw-r--r--    1 root  root     72 Apr 25 11:38 mailertable.4
-rw-r--r--    1 root  root     72 Apr 19 10:58 mailertable.5
-rw-r--r--    1 root  root     72 Apr 18 16:18 mailertable.6
-rw-r--r--    1 root  root     72 Apr 18 15:32 mailertable.7
-rw-r--r--    1 root  root    116 Apr 18 13:12 mailertable.8
-rw-r--r--    1 root  root     72 Apr 18 13:12 mailertable.9
-rw-r-----    1 root  smmsp 12288 Sep  6 22:01 mailertable.db
-rw-r--r--    1 root  root  14720 Jan 13  2006 mimedefang-filter
-rw-r--r--    1 root  root  14151 Sep  6 14:46 mimedefang-filter.example
drwxr-xr-x    2 root  root   4096 Sep  6 22:01 peers
-rw-r--r--    1 root  root   2872 Jun 20 09:36 sa-mimedefang.cf.example
drwxr-xr-x    2 root  smmsp  4096 Jun  3  2005 sasl
-rw-r--r--    1 root  smmsp 63419 Sep  6 22:01 sendmail.cf
-rw-r--r--    1 root  root  63420 Sep  6 22:01 sendmail.cf.old
-rw-r--r--    1 root  root  11882 Sep  6 22:01 sendmail.conf
-rw-r--r--    1 root  smmsp  4150 Sep  6 22:01 sendmail.mc
-rw-r--r--    1 root  root    149 Jun  3  2005 service.switch
-rw-r--r--    1 root  root    180 Jun  3  2005 service.switch-nodns
drwxr-sr-x    2 smmta smmsp  4096 Aug 11  2005 smrsh
lrwxrwxrwx    1 root  root     15 Jun 13 13:34 spamassassin -> ../spamassassin
-rw-r--r--    1 root  smmsp 43644 Sep  6 22:01 submit.cf
-rw-r--r--    1 root  root  43645 Sep  6 22:01 submit.cf.old
-rw-r--r--    1 root  smmsp  2284 Sep  6 22:01 submit.mc
drwxr-xr-x    2 smmta smmsp  4096 Aug 11  2005 tls
-rw-r--r--    1 root  smmsp     0 Aug 11  2005 trusted-users

/etc/mail/canit:
total 240
drwxr-xr-x  3 root  root  4096 Sep  6 14:56 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..
drwxr-xr-x  2 root  root  4096 Sep  6 14:46 BAK-2006-09-06-14-46-05
-rw-r--r--  1 root  root   197 Sep  6 14:47 account-info
-rwxr-xr-x  1 root  root  1532 Sep  6 14:46 account-lookup-test.pl
-rwxr-xr-x  1 root  root    90 Sep  6 14:47 address-to-stream
-rwxr-xr-x  1 root  root  2953 Sep  6 14:46 bayes-pg-to-dbfile.pl
-rwxr-xr-x  1 root  root   830 Sep  6 14:46 canit-build-graphs.pl
-rw-r--r--  1 root  root  1176 Sep  6 14:46 canit-config.sh
-rw-r--r--  1 root  root  5141 Sep  6 14:46 canit-domain-pro-filter
-rw-r--r--  1 root  root  5115 Sep  6 14:46 canit-filter
-rw-r--r--  1 root  root  5116 Sep  6 14:46 canit-pro-filter
-rwxr-xr-x  1 root  root  1474 Sep  6 14:46 canit-process-log.pl
-rwxr-xr-x  1 root  root  2451 Sep  6 14:46 canit-run-pg
-rwxr-xr-x  1 root  root  1096 Sep  6 14:46 canit-scanner-startup.pl
-rwxr-xr-x  1 root  root  5904 Sep  6 14:46 canit-sendmail-wrapper
-rw-r--r--  1 root  root  5097 Sep  6 14:46 canit-smb-filter
-rwxr-xr-x  1 root  root  8496 Sep  6 14:46 canit.cron
-rwxr-xr-x  1 root  root  2493 Sep  6 14:46 clamav-ctrl
-rw-r--r--  1 root  root   523 Sep  6 14:46 cron-settings
-rw-r--r--  1 root  root   117 Sep  6 14:46 db-settings
-rwxr-xr-x  1 root  root   613 Sep  6 14:46 dump-berkeley-db.pl
-rwxr-xr-x  1 root  root   847 Sep  6 14:46 expire.pl
-rw-r--r--  1 root  root  2347 Sep  6 14:51 filter-settings.pl
-rwxr-xr-x  1 root  root   307 Sep  6 14:46 freshclam.cron
-rwxr-xr-x  1 root  root  1267 Sep  6 14:46 gen-charts-example.sh
-rwxr-xr-x  1 root  root  8740 Sep  6 14:46 mimedefang-ctrl
-rw-r--r--  1 root  root  5616 Sep  6 14:46 mimedefang.conf
-rw-r--r--  1 root  root    17 Sep  6 14:47 not-executable-file
-rw-r--r--  1 root  root  1484 Sep  6 14:46 path-locations
-rwxr-xr-x  1 root  root    47 Sep  6 14:56 prog-base
-rwxr-xr-x  1 root  root    47 Sep  6 14:56 prog-test
-rwxr-xr-x  1 root  root  2165 Sep  6 14:46 reset-password.pl
-rwxr-xr-x  1 root  root   934 Sep  6 14:46 rpenguind
-rwxr-xr-x  1 root  root  1218 Sep  6 14:46 run-rpenguind-cmd
-rw-r--r--  1 root  root   259 Sep  6 14:46 sa-canit.cf
-rwxr-xr-x  1 root  root  9119 Sep  6 14:46 send-trapped-report.pl
-rwxr-xr-x  1 root  root  2617 Sep  6 14:46 sync-berkeley-db-example
-rwxr-xr-x  1 root  root  3216 Sep  6 14:46 sync-berkeley-db-multi-example
-rwxr-xr-x  1 root  root  4380 Sep  6 14:46 ticker-ctrl
-rw-r--r--  1 root  root  1044 Sep  6 14:46 ticker-filter
-rwxr-xr-x  1 root  root  1023 Sep  6 14:46 undump-berkeley-db.pl
-rwxr-xr-x  1 root  root   879 Sep  6 14:46 unquarantine
-rw-r--r--  1 root  root   159 Sep  6 14:46 virus-scanners.pl
-rw-r--r--  1 root  root  4370 Sep  6 14:46 virus-scanners.pl.DIST
-rwxr-xr-x  1 root  root   413 Sep  6 14:46 watch-canit

/etc/mail/canit/BAK-2006-09-06-14-46-05:
total 12
drwxr-xr-x  2 root root 4096 Sep  6 14:46 .
drwxr-xr-x  3 root root 4096 Sep  6 14:56 ..
-rwxr-xr-x  1 root root 1532 Sep  6 14:46 account-lookup-test.pl

/etc/mail/m4:
total 8
drwxr-sr-x  2 smmta smmsp 4096 Aug 11  2005 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..
-rw-r-----  1 root  smmsp    0 Aug 11  2005 dialup.m4
-rw-r-----  1 root  smmsp    0 Aug 11  2005 provider.m4

/etc/mail/peers:
total 12
drwxr-xr-x  2 root  root  4096 Sep  6 22:01 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..
-rw-r--r--  1 root  root   328 Jun  3  2005 provider

/etc/mail/sasl:
total 8
drwxr-xr-x  2 root  smmsp 4096 Jun  3  2005 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..

/etc/mail/smrsh:
total 8
drwxr-sr-x  2 smmta smmsp 4096 Aug 11  2005 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..
lrwxrwxrwx  1 root  smmsp   26 Aug 11  2005 mail.local -> 
/usr/lib/sm.bin/mail.local
lrwxrwxrwx  1 root  smmsp   17 Aug 11  2005 procmail -> /usr/bin/procmail

/etc/mail/tls:
total 44
drwxr-xr-x  2 smmta smmsp 4096 Aug 11  2005 .
drwxr-sr-x  8 smmta smmsp 4096 Sep  6 22:01 ..
-rw-r--r--  1 root  root     7 Aug 11  2005 no_prompt
-rw-------  1 root  root  1191 Aug 11  2005 sendmail-client.cfg
-rw-r--r--  1 root  smmsp 1273 Aug 11  2005 sendmail-client.crt
-rw-------  1 root  root  1037 Aug 11  2005 sendmail-client.csr
-rw-r-----  1 root  smmsp 1679 Aug 11  2005 sendmail-common.key
-rw-------  1 root  root     0 Aug 11  2005 sendmail-common.prm
-rw-------  1 root  root  1191 Aug 11  2005 sendmail-server.cfg
-rw-r--r--  1 root  smmsp 1273 Aug 11  2005 sendmail-server.crt
-rw-------  1 root  root  1037 Aug 11  2005 sendmail-server.csr
-rwxr--r--  1 root  root  3141 Sep  6 22:01 starttls.m4

sendmail.conf:
DAEMON_NETMODE="Static";
DAEMON_NETIF="lo";
DAEMON_MODE="Daemon";
DAEMON_PARMS="";
DAEMON_HOSTSTATS="No";
DAEMON_MAILSTATS="No";
QUEUE_MODE="${DAEMON_MODE}";
QUEUE_INTERVAL="10m";
QUEUE_PARMS="";
MSP_MODE="Cron";
MSP_INTERVAL="20m";
MSP_PARMS="";
MSP_MAILSTATS="${DAEMON_MAILSTATS}";
MISC_PARMS="";
CRON_MAILTO="root";
CRON_PARMS="";
LOG_CMDS="No";
HANDS_OFF="No";
AGE_DATA="";
DAEMON_RUNASUSER="No";
DAEMON_STATS="${DAEMON_MAILSTATS}";
MSP_STATS="${MSP_MAILSTATS}";


sendmail.mc:
divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.13.4-3 2005-06-03 16:49:22 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
FEATURE(`no_default_msa')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission')dnl
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(`access_db', , `skip')dnl
FEATURE(`mailertable', , `skip')dnl
FEATURE(`delay_checks', `friend', `n')dnl
define(`confBAD_RCPT_THROTTLE',`3')dnl
FEATURE(`always_add_domain')dnl
MASQUERADE_AS(`localhost.localdomain')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
INPUT_MAIL_FILTER(`mimedefang', `S=unix:/var/spool/MIMEDefang/mimedefang.sock, 
F=T, T=S:5m;R:5m;E:15m')

submit.mc...
divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: submit.mc, v 8.13.4-3 2005-06-03 16:49:22 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-msp')dnl
FEATURE(`msp', `[127.0.0.1]', `MSA')dnl


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages sendmail depends on:
ii  rmail                     8.13.4-3sarge3 MTA->UUCP remote mail handler
ii  sendmail-base             8.13.4-3sarge3 powerful, efficient, and scalable 
ii  sendmail-bin              8.13.4-3sarge3 powerful, efficient, and scalable 
ii  sendmail-cf               8.13.4-3sarge3 powerful, efficient, and scalable 
ii  sensible-mda              8.13.4-3sarge3 Mail Delivery Agent wrapper

Versions of packages sensible-mda depends on:
ii  libc6                     2.3.2.ds1-22   GNU C Library: Shared libraries an
ii  procmail                  3.22-11        Versatile e-mail processor
ii  sendmail-bin [mail-transp 8.13.4-3sarge3 powerful, efficient, and scalable 

Versions of packages rmail depends on:
ii  libc6                     2.3.2.ds1-22   GNU C Library: Shared libraries an
ii  libldap2                  2.1.30-8       OpenLDAP libraries
ii  sendmail-bin [mail-transp 8.13.4-3sarge3 powerful, efficient, and scalable 

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to