/usr/lib/courier/makedat is in courier-base 0.78.0-2ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | #! /bin/sh
#
#
# Copyright 1998 - 2004 Double Precision, Inc. See COPYING for
# distribution information.
#
# Generic wrapper for makedat.
#
# Usage: makedat.sh -src=src -file=file -tmp=tmpfile -hup=hupfile [ -cidr ]
#
# Create [file] from [src]. [src] can be either a plain text file, or a
# directory. [tmpfile] is used. if [hupfile] is specified and it exists,
# this file contains a PID, which is SIGHUPed.
#
# -cidr - [src] contains a list of IP netblocks. Expand entries in [src]
# that use CIDR or start-end notation using the Net::CIDR Perl
# module. Download the Net::CIDR module from
# http://www.cpan.org/authors/id/M/MR/MRSAM/
prefix="/usr";
exec_prefix="${prefix}";
srcfile=""
dstfile=""
tmpfile=""
hupfile=""
usage() {
echo "Usage: $0 -src=src -file=file -tmp=tmpfile -hup=hupfile [-cidr]" >&2
exit 1
}
cidr=""
while test $# -gt 0
do
case $1 in
-cidr)
cidr=1
shift
;;
-src=*)
srcfile=`echo "$1" | sed 's/-src=//'`;
shift
;;
-tmp=*)
tmpfile=`echo "$1" | sed 's/-tmp=//'`;
shift
;;
-file=*)
dstfile=`echo "$1" | sed 's/-file=//'`;
shift
;;
-hup=*)
hupfile=`echo "$1" | sed 's/-hup=//'`;
shift
;;
*)
usage
;;
esac
done
if test "$dstfile" = ""
then
usage
fi
if test "$srcfile" = ""
then
usage
fi
if test "$tmpfile" = ""
then
usage
fi
get_access() {
if test -d "$srcfile"
then
if test "$srcfile" != "CVS"
then
find -L "$srcfile" -maxdepth 1 -type f -not -name "*~" -not -regex ".*\.dpkg-[a-z]*" -exec cat {} \;
fi
else
cat "$srcfile" || return
fi
echo "."
}
docidr() {
if test "$cidr" = 1
then
/usr/bin/perl -e '
eval "use Net::CIDR;";
while (<>)
{
unless ( $Net::CIDR::VERSION &&
/^([a-fA-F0-9:\.]+[\-\/][a-fA-F0-9:\.]+)\s+(.*)$/)
{
print;
next;
}
my ($net, $line)=($1, $2);
foreach ( Net::CIDR::cidr2octets(
Net::CIDR::range2cidr($net)))
{
print "$_\t$line\n";
}
}
'
else
/bin/cat
fi
}
get_access | docidr | /usr/lib/courier/courier/makedatprog - "$tmpfile" "$dstfile" || exit 1
if test "$hupfile" != ""
then
if test -f $hupfile
then
kill -HUP `cat "$hupfile"`
fi
fi
|