Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Aug 2011 21:01:40 -0400
From:      Sahil Tandon <sahil@FreeBSD.org>
To:        olli hauer <ohauer@gmx.de>
Cc:        ports@FreeBSD.org, ohauer@FreeBSD.org, Miroslav Lachman <000.fbsd@quip.cz>
Subject:   USERS/GROUPS in bsd.port.mk [was: FreeBSD Port: postfix-2.8.4,1]
Message-ID:  <20110802010139.GA981@magic.hamla.org>
In-Reply-To: <4E3722DE.6050206@gmx.de>
References:  <4E368625.7010805@quip.cz> <4E370ADA.9060902@FreeBSD.org> <4E371284.5010806@quip.cz> <4E371B3B.7070806@FreeBSD.org> <4E3722DE.6050206@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, 2011-08-02 at 00:04:14 +0200, olli hauer wrote:

> No, you don't hit the limitation. It seems you really found a bug in
> the Framework!
> 
> From the Framework code in bsd.port.mk existing groups should honored.

Along those lines, what about using groupmod instead of usermod?
Perhaps due to my ignorance, it seems more straightforward and does not
require much sed-fu; I've attached a (probably incomplete) patch to
illustrate my thinking.  I understand what I am suggesting could
introduce other problems, so please do not construe it as an as-is
suggestion, but rather something to stoke discussion.

-- 
Sahil Tandon <sahil@FreeBSD.org>

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bsd.port.mk.diff"
Content-Transfer-Encoding: quoted-printable

Index: bsd.port.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.690
diff -u -r1.690 bsd.port.mk
=1B[34m--- bsd.port.mk  21 Jul 2011 15:10:46 -0000      1.690=1B[0m
=1B[31m+++ bsd.port.mk  2 Aug 2011 00:49:22 -0000=1B[0m
=1B[1m@@ -4237,12 +4237,9 @@=1B[0m
                 IFS=3D","; for _login in $$members; do \
                         for _user in ${USERS}; do \
                                 if [ "x$${_user}" =3D "x$${_login}" ]; the=
n \
=1B[34m-                                        list=3D`${PW} usershow $${_=
login} -P | ${SED} -ne 's/.*Groups: //p'`; \=1B[0m
=1B[34m-                                        ${ECHO_MSG} "Setting \`$${_=
login}' groups to \`$$list$${list:+,}${_group}'."; \=1B[0m
=1B[34m-                                        ${PW} usermod $${_login} -G=
 $$list$${list:+,}${_group}; \=1B[0m
=1B[34m-                                        ${ECHO_CMD} "@exec list=3D\=
`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'\`; \=1B[0m
=1B[34m-                                        echo \"Setting '$${_login}'=
 groups to '$$list$${list:+,}${_group}'.\";  \=1B[0m
=1B[34m-                                        ${PW} usermod $${_login} -G=
 $${list},${_group}" >> ${TMPPLIST}; \=1B[0m
=1B[31m+                                        ${ECHO_MSG} "Adding \`$${_l=
ogin}' to \`${_group}'."; \=1B[0m
=1B[31m+                                        ${PW} groupmod ${_group} -m=
 $${_login}; \=1B[0m
=1B[31m+                                        ${ECHO_CMD} "@exec ${PW} gr=
oupmod ${_group} -m $${_login}" >> ${TMPPLIST}; \=1B[0m
                                 else \
                                         ${ECHO_MSG} "=3D=3D> DEBUG skip lo=
gin $${_login} =3D>  not defined in USERS \"( ${USERS} )\""; \
                                 fi; \

--VbJkn9YxBvnuCH5J--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110802010139.GA981>