[aur-general] Prefered way to create users/groups and handle files ownership

Maxime Gauduin alucryd at gmail.com
Sat Jan 25 11:13:04 EST 2014

On Sat, Jan 25, 2014 at 4:03 PM, Nowaker <enwukaer at gmail.com> wrote:

> Hey,
> What is the prefered way of creating users/groups and handling files
> ownership for AUR packages?
> My take is to change the file ownership (`chown`) in .install script.
> That's what I do in the PKGBUILDs I write myself.
> However, inspircd, which I adopted a few months ago takes a different
> approach. The previous maintainer hardcoded a UID and GID directly in the
> package:
> install -o141 -g141 -dm750 "${pkgdir}/var/log/inspircd"
> .install:
> getent group inspircd &>/dev/null || groupadd -r -g 141 inspircd
> getent passwd inspircd &>/dev/null || useradd -r -u 141 -g inspircd -d
> /var/lib/inspircd -s /bin/false inspircdl
> I don't like this approach - what if the user has already assigned UID 141
> to other user? Then effectively inspircd and, say, Apache, are running
> under the same user. But maybe there is some reason behind this approach
> that I'm not aware of.
> Thanks for your help.
> --
> Kind regards,
> Damian Nowak
> StratusHost
> www.AtlasHost.eu

The reason why permissions should be set in the PKGBUILD is because that
way pacman can track them. Then it's up to the maintainer to choose
UIDs/GIDs that do not conflict with official packages, and to the user to
check that they don't already use that particular UID/GID ,before
installing an AUR package.


More information about the aur-general mailing list