Skip to content

Commit bd747ee

Browse files
authored
Work around a bug in the krb5-extension
1 parent 630dfb1 commit bd747ee

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/Auth/Source/Negotiate.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,19 @@ public function authenticate(array &$state): void
174174
}
175175

176176
Assert::true(is_string($this->spn) || (is_int($this->spn) && ($this->spn === 0)) || is_null($this->spn));
177-
$auth = new \KRB5NegotiateAuth($this->keytab, $this->spn);
177+
178+
if (version_compare(phpversion('krb5'), '1.1.3', '<')) {
179+
$auth = new \KRB5NegotiateAuth($this->keytab);
180+
} elseif (version_compare(phpversion('krb5'), '1.1.3', 'eq') && is_null($this->spn)) {
181+
/**
182+
* This is a workaround for a bug in krb5 v1.1.3 that has been fixed in SVN, just not yet released.
183+
* Once v1.1.4 is released, get rid of the elseif-clause and then make sure to mark the
184+
* v.1.1.3 version of the extension as a conflict in the composer.json file.
185+
*/
186+
$auth = new \KRB5NegotiateAuth($this->keytab);
187+
} else {
188+
$auth = new \KRB5NegotiateAuth($this->keytab, $this->spn);
189+
}
178190

179191
// attempt Kerberos authentication
180192
try {

0 commit comments

Comments
 (0)