commit: 6273bb84906a43836a25088d2ff1ba88d571e08f Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Sun Aug 31 16:23:06 2025 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Sun Aug 31 16:23:06 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6273bb84
mail-filter/postsrsd: Fix file creation in pkg_postinst Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> mail-filter/postsrsd/postsrsd-2.0.11-r4.ebuild | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mail-filter/postsrsd/postsrsd-2.0.11-r4.ebuild b/mail-filter/postsrsd/postsrsd-2.0.11-r4.ebuild index c09adf4e5ef9..ba1e13f7fa0f 100644 --- a/mail-filter/postsrsd/postsrsd-2.0.11-r4.ebuild +++ b/mail-filter/postsrsd/postsrsd-2.0.11-r4.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit cmake eapi9-pipestatus eapi9-ver readme.gentoo-r1 systemd +inherit cmake eapi9-ver readme.gentoo-r1 systemd DESCRIPTION="Postfix Sender Rewriting Scheme daemon" HOMEPAGE="https://github.com/roehling/postsrsd" @@ -88,14 +88,15 @@ src_install() { } pkg_postinst() { - local f="${EROOT}/etc/postsrsd.secret" ret=0 + local f="${EROOT}/etc/postsrsd.secret" - if [[ ! -e ${f} ]]; then + if [[ ! -s ${f} ]]; then ebegin "Generate the SRS signing secret and install it in ${f}" ( umask 077 - dd if=/dev/urandom bs=18 count=1 status=none | base64 > "${f}" - pipestatus + set -o pipefail + rnd="$(dd if=/dev/urandom bs=18 count=1 status=none | base64)" \ + && printf "%s\n" "${rnd}" > "${f}" ) eend $? "Installing ${f} failed" fi
