libgocryptfs/package-static.bash
Jakob Unterwurzacher 07f57314af package[-static].bash: stop leaking the local user id in the tarball
The local user id of the packager is not interesting for users who
download the tarball.

Also it will cause the gocryptfs binary to have an unintended owner
when the tarball is extraced as root.

Fix the issue by using "tar --owner=root --group=root" which
overwrites user and group id with zero.
2017-08-21 14:10:05 +02:00

26 lines
588 B
Bash
Executable File

#!/bin/bash -eu
cd "$(dirname "$0")"
# Compiles the gocryptfs binary and sets $GITVERSION
source build-without-openssl.bash
if ldd gocryptfs > /dev/null ; then
echo "error: compiled binary is not static"
exit 1
fi
# Build gocryptfs.1 man page
./Documentation/MANPAGE-render.bash > /dev/null
cp -a ./Documentation/gocryptfs.1 .
ARCH=$(go env GOARCH)
OS=$(go env GOOS)
TARGZ=gocryptfs_${GITVERSION}_${OS}-static_${ARCH}.tar.gz
tar --owner=root --group=root -czf $TARGZ gocryptfs gocryptfs.1
echo "Tar created."
echo "Hint for signing: gpg -u 23A02740 --armor --detach-sig $TARGZ"