[Popcon-developers] Bug#820298: popularity-contest: Garbage E-Mail: UID must be less than 49999 (from pam)
Juergen Pfennig
info at j-pfennig.de
Thu Apr 7 07:52:23 UTC 2016
Package: popularity-contest
Version: 1.61
Severity: normal
Dear Maintainer,
your cron.daily scripts does something like "su .... nobody".
Unfortunately some pam module outputs the UID warning.
Although being a pam bug this causes a lot of garbage email from
popularity-contest.
Could you please modify popularity-contest to avoid this?
Suggestion: redirect su output to a tmp file and send output only on
error:
TMP_FILE=...
su ... nobody 2> $TMP_FILE || cat $TMP_FILE
rm $TMP_FILE
Thank you
Jürgen
-- System Information:
Debian Release: 8.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.4.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages popularity-contest depends on:
ii debconf [debconf-2.0] 1.5.56
ii dpkg 1.17.26
ii libio-socket-ip-perl 0.32-1
ii perl-base [libio-socket-ip-perl] 5.20.2-3+deb8u4
Versions of packages popularity-contest recommends:
ii cron 3.0pl1-127+deb8u1
ii exim4 4.84.2-1
ii exim4-daemon-light [mail-transport-agent] 4.84.2-1
ii gnupg 1.4.18-7+deb8u1
Versions of packages popularity-contest suggests:
ii anacron 2.3-23
-- Configuration Files:
/etc/cron.daily/popularity-contest changed:
set -e
if [ ! -f /usr/sbin/popularity-contest ]; then
exit 0
fi
unset MAILFROM
unset MAILTO
unset MY_HOSTID
unset PARTICIPATE
unset SUBMITURLS
unset USEHTTP
unset MTAOPS
. /usr/share/popularity-contest/default.conf
. /etc/popularity-contest.conf
if test -d /etc/popularity-contest.d/; then
for file in `run-parts --list --regex '\.conf$' /etc/popularity-contest.d/`;
do
. $file
done
fi
if [ -z "$MAILTO" ] && [ "yes" != "$USEHTTP" ]; then exit 0; fi
if [ "$PARTICIPATE" = "no" ] || [ -z "$PARTICIPATE" ]; then exit 0; fi
if [ -n "$HTTP_PROXY" ]; then
export http_proxy="$HTTP_PROXY";
fi
POPCON=/var/log/popularity-contest
if [ "$DAY" ] && [ "$DAY" != "$(date +%w)" ] ; then
# Ensure that popcon runs at least once in the last week
if [ -f "$POPCON" ] ; then
now=$(date +%s)
lastrun=$(date -r $POPCON +%s)
# 6.5 days, in seconds
week=561600
if [ "$(( $now - $lastrun ))" -le "$week" ]; then
exit 0
fi
fi
fi
cd /var/log
umask 022
savelog -c 7 popularity-contest >/dev/null
run_popcon()
{
su -s /bin/sh -c "/usr/sbin/popularity-contest" nobody
}
do_sendmail()
{
if [ -n "$MAILFROM" ]; then
sendmail -oi $MTAOPS -f "$MAILFROM" $MAILTO
else
sendmail -oi $MTAOPS $MAILTO
fi
}
run_popcon > $POPCON 2>/dev/null
GPG=/usr/bin/gpg
if [ "$ENCRYPT" = "yes" ] && ! [ -x "$GPG" ]; then
logger -t popularity-contest "encrytion required but gpg is not available."
echo "popularity-contest: encrytion required but gpg is not available." 2>&1
exit 1
fi
if [ -x "$GPG" ] && [ "$ENCRYPT" = "maybe" ] || [ "$ENCRYPT" = "yes" ]; then
POPCONGPG="$POPCON.gpg"
rm -f "$POPCONGPG"
GPGHOME=`mktemp -d`
$GPG --batch --no-options --no-default-keyring --trust-model=always \
--homedir "$GPGHOME" --keyring $KEYRING --quiet \
--armor -o "$POPCONGPG" -r $POPCONKEY --encrypt "$POPCON"
rm -rf "$GPGHOME"
POPCON="$POPCONGPG"
fi
SUBMITTED=no
if [ "$SUBMITURLS" ] && [ "yes" = "$USEHTTP" ]; then
for URL in $SUBMITURLS ; do
if setsid /usr/share/popularity-contest/popcon-upload \
-u $URL -f $POPCON 2>/dev/null ; then
SUBMITTED=yes
else
logger -t popularity-contest "unable to submit report to $URL."
fi
done
fi
if [ yes != "$SUBMITTED" ] && [ "$MAILTO" ]; then
if [ -x "`which sendmail 2>/dev/null`" ]; then
(
if [ -n "$MAILFROM" ]; then
echo "From: <$MAILFROM>"
echo "Sender: <$MAILFROM>"
fi
echo "To: $MAILTO"
echo "Subject: popularity-contest submission"
echo "MIME-Version: 1.0"
echo "Content-Type: text/plain"
echo
cat $POPCON
) | do_sendmail
SUBMITTED=yes
else
logger -t popularity-contest "unable to submit report using sendmail."
fi
fi
if [ "yes" != "$SUBMITTED" ] ; then
logger -t popularity-contest "unable to submit report."
fi
-- debconf information:
popularity-contest/submiturls:
* popularity-contest/participate: true
More information about the Popcon-developers
mailing list