From 1d535f79136fc855a77af17675dbf48977764ec6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 31 Aug 2016 21:16:57 +0200 Subject: phpMyAdmin: 32 chars blowfisk secret --- phpMyAdmin.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpMyAdmin.spec b/phpMyAdmin.spec index 1d39667..24f7515 100644 --- a/phpMyAdmin.spec +++ b/phpMyAdmin.spec @@ -41,6 +41,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: unzip +Requires(post): coreutils sed Requires: webserver %if %{with_nginx} Requires: nginx-filesystem @@ -198,9 +199,10 @@ if [ -d %{_datadir}/%{name}/doc/html ]; then fi %post -# generate a secret key for this install -sed -i -e "/'blowfish_secret'/s/MUSTBECHANGEDONINSTALL/$RANDOM$RANDOM$RANDOM$RANDOM/" \ - %{_sysconfdir}/%{name}/config.inc.php +# generate a 32 chars secret key for this install +SECRET=$(printf "%04x%04x%04x%04x%04x%04x%04x%04x" $RANDOM $RANDOM $RANDOM $RANDOM $RANDOM $RANDOM $RANDOM $RANDOM) +sed -e "/'blowfish_secret'/s/MUSTBECHANGEDONINSTALL/$SECRET/" \ + -i %{_sysconfdir}/%{name}/config.inc.php %files -- cgit