aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage-funcs
diff options
context:
space:
mode:
Diffstat (limited to 'pbuilder-buildpackage-funcs')
-rw-r--r--pbuilder-buildpackage-funcs13
1 files changed, 13 insertions, 0 deletions
diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index 03b4458..093e053 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -66,9 +66,22 @@ function showbuildbanner () {
echo
}
+function cowprotect () {
+ # a hack for cowdancer
+ for A in "$@"; do
+ if readlink -f "$A"; then
+ A=$(readlink -f "$A")
+ mv "$A" "$A"~
+ cp -a "$A"~ "$A"
+ rm -f "$A"~
+ fi
+ done
+}
+
function createbuilduser () {
# create the build user
if [ -n "$SUTOUSER" ]; then
+ cowprotect $BUILDPLACE/etc/passwd $BUILDPLACE/etc/group $BUILDPLACE/etc/shadow
echo "$BUILDUSERNAME:x:$BUILDUSERID:$BUILDUSERID:,,,:/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd
echo "$BUILDUSERNAME:*:$BUILDUSERID:" >> $BUILDPLACE/etc/group
echo "$BUILDUSERNAME:!:::::::" >> $BUILDPLACE/etc/shadow