ports/130184: [patch] mail/exim: fix user/group creation order and errors
Artis Caune
Artis.Caune at gmail.com
Mon Jan 5 12:50:02 UTC 2009
>Number: 130184
>Category: ports
>Synopsis: [patch] mail/exim: fix user/group creation order and errors
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Jan 05 12:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Artis Caune
>Release: stable/7
>Organization:
>Environment:
FreeBSD builder 7.1-STABLE FreeBSD 7.1-STABLE #0 r186761: Mon Jan 5 11:46:44 EET 2009 root at builder:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
- If using EXIM_USER and EXIM_GROUP with packages, install script will fail because it will first try to add user and then group. You can not add user without existing group.
- Install script use ${EXIM_USER}, ${EXIM_GROUP} variables, which are only used in ports, not packages.
>How-To-Repeat:
# make EXIM_USER=exim EXIM_GROUP=exim package clean
# pkg_delete exim-4.69_2
# pw group del exim
# pw user del exim
# pkg_add ./exim-4.69_2.tbz
>Fix:
Patch attached with submission follows:
--- pkg-install.orig 2007-08-04 14:41:00.000000000 +0300
+++ pkg-install 2009-01-05 14:29:08.999104684 +0200
@@ -18,12 +18,12 @@
logdir=%%LOGDIR%%
if [ "$2" = "PRE-INSTALL" ]; then
- if ! /usr/bin/id ${user} > /dev/null; then
- /usr/sbin/pw useradd ${EXIM_USER} -g ${EXIM_GROUP} -u 125 \
- -h - -d /var/spool/exim -s /nonexistent -c "Exim User"
+ if ! /usr/sbin/pw groupshow ${group} >/dev/null; then
+ /usr/sbin/pw groupadd ${group} -g 125
fi
- if ! /usr/bin/grep -q "^${group}:" /etc/group; then
- /usr/sbin/pw groupadd ${EXIM_GROUP} -g 125
+ if ! /usr/sbin/pw usershow ${user} >/dev/null; then
+ /usr/sbin/pw useradd ${user} -g ${group} -u 125 \
+ -h - -d /var/spool/exim -s /nonexistent -c "Exim User"
fi
/bin/mkdir -p ${logdir}
/usr/sbin/chown ${user}:${group} ${logdir}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list