mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
fix ticket check, remove unnecessary(?) code
provided by downstream
This commit is contained in:
parent
ab262dd706
commit
fdf1051bd6
1 changed files with 2 additions and 19 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue