ma, 2005-10-31 kello 22:03 +0100, Javier Fernández-Sanguino Peña kirjoitti: > After the feedback of the recent d-d thread, I've adapted the section I wrote > on the best practices related to system users and groups, it is currently > available at: > http://www.debian.org/doc/manuals/developers-reference/ch-best-pkging-practices.en.html#s-bpp-lower-privs > > I would like developers to review and provide feedback for that section, > specially in form of patches. I'm considering doing a bug hunt for:
DON'T do this: addgroup --quiet --system $SERVER_GROUP 2>/dev/null ||true When (not if!) addgroup fails, the poor system administrator gets no indication of it. This is a bug, and a pretty bad one. If adduser isn't quiet enough with --quiet, then fix that, don't hide real errors. Remove both the redirect and the "|| true". Also, sticking all the tens of lines of boilerplate code into the postinst of every package that needs a system user is a good way to invite trouble. When the boilerplate has a bug (possibly because things change in the future), it will have to be fixed in dozes on of packages. It's oh so much more sensible to create a tool that postinsts can call: if boilerplate code is good enough, then it can easily be abstracted away. -- Fundamental truth #1: Complexity is the enemy.