Skip to content

Instantly share code, notes, and snippets.

@piccaso
Created October 18, 2014 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piccaso/4b1af91661f535b3818a to your computer and use it in GitHub Desktop.
Save piccaso/4b1af91661f535b3818a to your computer and use it in GitHub Desktop.
patching Drupal 7 SA-CORE-2014-005-D7
wget -O /tmp/SA-CORE-2014-005-D7.patch https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patch && chmod 0600 /tmp/SA-CORE-2014-005-D7.patch
cd /var/www
find -path '*/includes/database/database.inc'
#make backups
for f in $( find -path '*/includes/database/database.inc' ); do cp -av $f $f.backup-$(date +"%Y-%m-%d-%H%M%S"); done
#dry run
for f in $( find -path '*/includes/database/database.inc' ); do patch --dry-run $f < /tmp/SA-CORE-2014-005-D7.patch; done
#dry run (and inspect)
for f in $( find -path '*/includes/database/database.inc' ); do patch --verbose --dry-run $f < /tmp/SA-CORE-2014-005-D7.patch; done | less
#apply patch
for f in $( find -path '*/includes/database/database.inc' ); do patch $f < /tmp/SA-CORE-2014-005-D7.patch; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment