Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 68630 - Wrong permissions on dspam datadir
Summary: Wrong permissions on dspam datadir
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Lim Swee Tat (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-23 06:00 UTC by Alexander Gretencord
Modified: 2004-10-24 08:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Gretencord 2004-10-23 06:00:36 UTC
In the dspam ebuilds theres this:

diropts -m0770 -o dspam -g dspam
dodir ${DATADIR}

Unfortunately this makes dspam not read a users preferences (or anything else) from his datadir.

From an strace of a dspam run:

...
open("/etc/mail/dspam/data/tharkun/tharkun.prefs", O_RDONLY) = -1 EACCES (Permission denied)
...
stat64("/", {st_mode=S_IFDIR|0755, st_size=624, ...}) = 0
stat64("/etc/", {st_mode=S_IFDIR|0755, st_size=3528, ...}) = 0
stat64("/etc/mail/", {st_mode=S_IFDIR|0755, st_size=128, ...}) = 0
stat64("/etc/mail/dspam/", {st_mode=S_IFDIR|0775, st_size=296, ...}) = 0
stat64("/etc/mail/dspam/data/", {st_mode=S_IFDIR|0770, st_size=120, ...}) = 0
stat64("/etc/mail/dspam/data/tharkun/", 0xbfff0a6c) = -1 EACCES (Permission denied)
mkdir("/etc/mail/dspam/data/tharkun/", 0770) = -1 EACCES (Permission denied)
...
write(2, "6594: [Sat Oct 23 14:53:25 2004]"..., 1106594: [Sat Oct 23 14:53:25 2004] Unable to create directory: /etc/mail/dspam/data/tharkun/: Permission denied
) = 110
stat64("/etc/mail/dspam/data/tharkun/DB_CONFIG", 0xbfff1940) = -1 EACCES (Permission denied)
open("/etc/mail/dspam/data/tharkun/DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)
stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=96, ...}) = 0
stat64("/etc/mail/dspam/data/tharkun/__db.001", 0xbfff19d0) = -1 EACCES (Permission denied)
open("/etc/mail/dspam/data/tharkun/__db.001", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0660) = -1 EACCES (Permission denied)
...
------


If DATADIR has permissions 775, everything works correctly. "Of course" you say, "you started dspam as your user instead of the user your mailsystem uses". Well my postfix starts the mailbox_command (in this case dspam) as the user that the mail is to be delivered to, too.

And another thing, untrusted.mailer_args has to have o+r too.
Comment 1 Lim Swee Tat (RETIRED) gentoo-dev 2004-10-24 08:06:04 UTC
Fixed in CVS, and committed dspam-3.2.0