Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Set ovnership of out back to callee user if not root
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogrip authored Nov 1, 2022
1 parent 3343da4 commit 5699eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rootstock-touch
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ BUILDOPTS="SUBPROJECT=${SUBPROJECT} \
PROJECT=${PROJECT} \
ARCH=${ARCH}"

[ "$(id -u)" -ne 0 ] && exec sudo $0 $SUDOARGS
[ "$(id -u)" -ne 0 ] && exec sudo ORGUSER=$(whoami) $0 $SUDOARGS

mkdir $CHROOT || true
touch $CHROOT/build.log
Expand Down Expand Up @@ -323,6 +323,9 @@ copy_artefacts()
for file in $(ls $CHROOT/build/livecd.*|grep -v bootimg); do
cp $file "$OUTDIR/$(echo $file|sed -e s/^.*livecd.// -e s/rootfs/rootfs-$SUITE-$ARCH/ -e s/ubuntu/ubports/)"
done
if [ -n "$ORGUSER" ]; then
chown -R $ORGUSER $OUTDIR
fi
}

_echo()
Expand Down

0 comments on commit 5699eec

Please sign in to comment.