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

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: ca-certificates and ./ before pg_fix_usermappings.sh

...

No Format
# download
cd /tmp
#sudo apt-get install ca-certificates
wget https://download.clazzes.org/pg_fix_usermappings/pg_fix_usermappings.sh \
  -O /tmp/pg_fix_usermappings.sh


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

# it's safe to call the script without any parameters ...
/tmp/pg_fix_usermappings.sh

# execute for 9.6 as root
sudo -u postgres pg_fix_usermappings.sh 9.6

# or execute for 9.6 as non-root
sudo sudo -u postgres pg_fix_usermappings.sh 9.6

# or execute for 9.6 for the bold skipping do-you-really-want-it backcheck
sudo sudo -u postgres pg_fix_usermappings.sh --yes 9.6

# or execute non root logging the output
( sudo sudo -u postgres /tmp/pg_fix_usermappings.sh 9.6 ) 2>&1 |tee /var/tmp/pg_fix_usermappings_9.6.log

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

...