Skip to content

Instantly share code, notes, and snippets.

@thewilkybarkid
Created September 17, 2013 15:11
Show Gist options
  • Save thewilkybarkid/6595676 to your computer and use it in GitHub Desktop.
Save thewilkybarkid/6595676 to your computer and use it in GitHub Desktop.
Patch for the Drupal Varnish module (7.x-1.0-beta2) to fix authentication.
diff --git a/varnish.module b/varnish.module
index 80e7af2..248a564 100644
--- a/varnish.module
+++ b/varnish.module
@@ -260,7 +260,7 @@ function _varnish_terminal_run($commands) {
if ($status['code'] == 107) { // Require authentication
$secret = variable_get('varnish_control_key', '');
$challenge = substr($status['msg'], 0, 32);
- $pack = $challenge . "\x0A" . $secret . "\x0A" . $challenge . "\x0A";
+ $pack = $challenge . "\x0A" . $secret . $challenge . "\x0A";
$key = hash('sha256', $pack);
socket_write($client, "auth $key\n");
$status = _varnish_read_socket($client);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment