On Sun, Feb 14, 2016 at 10:04:57PM +0000, Thorsten Glaser wrote: > No, it must remove the group with that gid from groups first > if it already exists, or append to that line.
The attached patch removes the line before adding, if it finds the group name at the beginning or the gid in the third field.
From 28b08bfcc1988ef70695f014d3f4156e7a9262b4 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann <rei...@reiner-h.de> Date: Sun, 14 Feb 2016 23:45:25 +0100 Subject: [PATCH] Remove group if name or gid already exists --- pbuilder-buildpackage-funcs | 1 + 1 file changed, 1 insertion(+) diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs index e1b4b6c..fc86f6a 100644 --- a/pbuilder-buildpackage-funcs +++ b/pbuilder-buildpackage-funcs @@ -94,6 +94,7 @@ function addgrsecgroup () { local TPEGID=$(sysctl -n kernel.grsecurity.tpe_gid) log.i "Adding build user to grsec-tpe group" + sed -i "/\(^grsec-tpe:\|:$TPEGID:\)/d" "$BUILDPLACE/etc/group" echo "grsec-tpe:x:$TPEGID:$BUILDUSERNAME" >> "$BUILDPLACE/etc/group" } -- 2.7.0
signature.asc
Description: PGP signature