fix ticket check, remove unnecessary(?) code

provided by downstream
This commit is contained in:
Arthur Schiwon 2022-01-17 16:01:29 +01:00
commit fdf1051bd6
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -76,27 +76,10 @@ class KerberosApacheAuth extends KerberosAuth implements IAuth {
//read apache kerberos ticket cache
$cacheFile = getenv("KRB5CCNAME");
if (!$cacheFile) {
if (!$this->checkTicket()) {
throw new Exception('No kerberos ticket cache environment variable (KRB5CCNAME) found.');
}
$krb5 = new \KRB5CCache();
$krb5->open($cacheFile);
if (!$krb5->isValid()) {
throw new Exception('Kerberos ticket cache is not valid.');
}
if ($this->saveTicketInMemory) {
putenv("KRB5CCNAME=" . (string)$krb5->getName());
} else {
//workaround: smbclient is not working with the original apache ticket cache.
$tmpFilename = tempnam("/tmp", "krb5cc_php_");
$tmpCacheFile = "FILE:" . $tmpFilename;
$krb5->save($tmpCacheFile);
$this->ticketPath = $tmpFilename;
putenv("KRB5CCNAME=" . $tmpCacheFile);
}
putenv("KRB5CCNAME=" . $cacheFile);
}
public function getExtraCommandLineArguments(): string {