Child pages
  • Scripting handwork rg. PostgreSQL bug CVE-2017-7547

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: snippet finetuning


Overall (several variants, read before execution)

No Format
# download
cd /tmp
#sudo apt-get install ca-certificates
wget \
  -O /tmp/

# make it executable, for user postgres
chmod ugo+rx /tmp/

# it's safe to call the script without any parameters ...

# think about version
ls -ld /etc/postgresql/*
dpkg -l |egrep " postgresql-9.[0-9] "

# execute for 9.6 as non root logging the output
export MYPGVER=9.6
( sudo sudo -u postgres /tmp/ 9.6${MYPGVER} ) \
  2>&1 |tee /var/tmp/pg_fix_usermappings_9.6.${MYPGVER}.log

# after success maybe document
sudo mv -v /tmp/ /var/tmp/pg_fix_usermappings*.log /var/log/postgresql/