Summary: | [PATCH] mail-filter/dspam dspam.cron is not POSIX compliant | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Natanael Copa <natanael.copa> |
Component: | New packages | Assignee: | Alin Năstac (RETIRED) <mrness> |
Status: | RESOLVED WONTFIX | ||
Severity: | trivial | CC: | steeeeeveee |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | dspam.cron.patch |
Description
Natanael Copa
2007-03-30 11:35:20 UTC
Created attachment 114942 [details, diff]
dspam.cron.patch
Should fix it without changing the behaviour of the script.
I do have a suggestion of a change though. Why not ignore the *.data files when detecting the DSPAM_HOMEDIR and only look for the dspam.conf file?
Replace this:
DSPAM_HOMEDIR="$(getent passwd dspam | awk -F : '{print $6}')"
[[ ! -d "${DSPAM_HOMEDIR}" ]] && exit 2
DSPAM_DATA_FILES=( "${DSPAM_HOMEDIR}"/*.data )
if [ ! -f "${DSPAM_DATA_FILES[0]}" ]
then
DSPAM_DATA_FILES=( /etc/mail/dspam/*.data )
if [ -f "${DSPAM_DATA_FILES[0]}" ]
then
DSPAM_HOMEDIR="/etc/mail/dspam"
fi
fi
[[ ! -f "${DSPAM_HOMEDIR}/dspam.conf" ]] && exit 2
whith this:
DSPAM_HOMEDIR="$(getent passwd dspam | awk -F : '{print $6}')"
if [ ! -f "${DSPAM_HOMEDIR}/dspam.conf" -a -f /etc/mail/dspam/dspam.conf ]
then
DSPAM_HOMEDIR=/etc/mail/dspam
else
exit 2
fi
my $0.02
My patch don't does this in case of wierd situation where there are dspam.conf in both dirs but no *.data in one of them.
(In reply to comment #1) > Created an attachment (id=114942) [edit] > dspam.cron.patch > > Should fix it without changing the behaviour of the script. > > I do have a suggestion of a change though. Why not ignore the *.data files when > detecting the DSPAM_HOMEDIR and only look for the dspam.conf file? > Replace this: > > DSPAM_HOMEDIR="$(getent passwd dspam | awk -F : '{print $6}')" > [[ ! -d "${DSPAM_HOMEDIR}" ]] && exit 2 > DSPAM_DATA_FILES=( "${DSPAM_HOMEDIR}"/*.data ) > if [ ! -f "${DSPAM_DATA_FILES[0]}" ] > then > DSPAM_DATA_FILES=( /etc/mail/dspam/*.data ) > if [ -f "${DSPAM_DATA_FILES[0]}" ] > then > DSPAM_HOMEDIR="/etc/mail/dspam" > fi > fi > > [[ ! -f "${DSPAM_HOMEDIR}/dspam.conf" ]] && exit 2 > > > whith this: > DSPAM_HOMEDIR="$(getent passwd dspam | awk -F : '{print $6}')" > if [ ! -f "${DSPAM_HOMEDIR}/dspam.conf" -a -f /etc/mail/dspam/dspam.conf ] > then > DSPAM_HOMEDIR=/etc/mail/dspam > else > exit 2 > fi > > my $0.02 > My patch don't does this in case of wierd situation where there are dspam.conf > in both dirs but no *.data in one of them. > You are right about the *.data file. The *.data file only exists on some installations. If you use the hash driver or SQLite, then there is no *.data file. I have created a new ebuild for DSPAM (Bug ID: #172929) and I will add there a new DSPAM cron script which is hopefully fixing that issue. The cron script in dspam-3.8.0 will be (hopefully) POSIX compliant (see bug 172929). If not, please let me know ASAP. |