diff options
author | Martin Schulze <joey@infodrom.org> | 2004-09-13 09:07:18 +0200 |
---|---|---|
committer | Andreas Beckmann <debian@abeckmann.de> | 2012-10-01 19:58:43 +0200 |
commit | ae03fe5d926a63cab418207f760d62a947957123 (patch) | |
tree | aa48cfe56ac7c47fb9b0abce4d4689033d3098d6 /debian/local/update_tcpd | |
parent | dd994db23cb7f88732be927fad3a7039bd6301db (diff) | |
download | sendmail-debian/8.12.3-7.1.tar.gz |
Imported Debian patch 8.12.3-7.1debian/8.12.3-7.1
Diffstat (limited to 'debian/local/update_tcpd')
-rw-r--r-- | debian/local/update_tcpd | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/debian/local/update_tcpd b/debian/local/update_tcpd new file mode 100644 index 0000000..e3b430a --- /dev/null +++ b/debian/local/update_tcpd @@ -0,0 +1,53 @@ +#!/bin/sh -e +#----------------------------------------------------------------------------- +# +# Update TCPD environment (TCP Wrappers) for sendmail +# +# Copyright (c) 2001-2001 Richard Nelson. All Rights Reserved. +# Time-stamp: <2001/01/17 10:00:00 cowboy> +# +# Notes (to all): +# +# Notes (to self): +# +#----------------------------------------------------------------------------- +set -e + +#------------------------------------------------------------------------------ +# Check to see if sendmail is mentioned in /etc/hosts.allow +# Note: This check is far from perfect - it requires sendmail and : be +# on the same line. If you've got a better approach, I'd love to +# see it (Maybe awk/perl)! + +if grep -qEe "^[^#:]*sendmail[^:]*[:]" /etc/hosts.allow 2>/dev/null; then + need_tcpd=0 +else + need_tcpd=1 + fi + +if [ ! -e /etc/hosts.allow ]; then + need_tcpd=0 + fi + +if [ $need_tcpd -eq 1 ]; then + cat <<-EOT + + Updating /etc/hosts.allow, adding "sendmail: all". + + Please edit /etc/hosts.allow and check the rules location to + make sure your security measures have not been overridden - + it is common to move the sendmail:all line to the *end* of + the file, so your more selective rules take precedence. +EOT + + echo "sendmail: all" | cat - /etc/hosts.allow >/etc/hosts.allow.new + mv -f /etc/hosts.allow.new /etc/hosts.allow + + if [ -e /etc/init.d/netbase ]; then + /etc/init.d/netbase reload >/dev/null + elif [ -e /etc/init.d/inetd ]; then + /etc/init.d/inetd reload >/dev/null + fi + fi + +exit 0 |