Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 86271 - Create dedicated user and group in net-mail/freepops ebuild to make freepopsd drop root privileges
Summary: Create dedicated user and group in net-mail/freepops ebuild to make freepopsd...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: SpanKY
URL: http://www.freepops.org/en/files/html...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-22 09:03 UTC by Olivier Castan
Modified: 2005-04-19 15:13 UTC (History)
1 user (show)

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 Olivier Castan 2005-03-22 09:03:35 UTC
freepopsd can be launched as a service in /etc/init.d. The command line supports the argument -s user.group to drop root privileges.

For example, that can be added to freepops ebuild (mimic hal ebuild) :
pkg_preinst() {

        enewgroup freepopsd || die "Problem adding freepopsd group"
        enewuser freepopsd -1 /bin/false /dev/null freepopsd || die "Problem adding freepopsd user"

}

Add to start() function in /etc/init.d/freepopsd :
        if  [ ${DAEMON_USER} ] && [ ${DAEMON_GROUP} ]; then
                ARGS="${ARGS} -s ${DAEMON_USER}.${DAEMON_GROUP}"
        fi

Add to /etc/conf.d/freepopsd :
# User and group to make freepopsd drop root privileges
DAEMON_USER="freepopsd"
DAEMON_GROUP="freepopsd"

Reproducible: Always
Steps to Reproduce:
Comment 1 SpanKY gentoo-dev 2005-04-16 00:19:40 UTC
cant it just run as 'nobody' ?
Comment 2 MickKi 2005-04-18 23:35:54 UTC
Meanwhile, I run it as:

# freepopsd -s michael.users
Comment 3 SpanKY gentoo-dev 2005-04-19 15:13:50 UTC
0.0.27-r1 has the default init script run under the nobody user