Skip to content
Snippets Groups Projects
Commit 1681c295 authored by Romanos Dodopoulos's avatar Romanos Dodopoulos
Browse files

Increase the _authSource VARCHAR size to 255

The _authSource column stores FQDNs. Increase the VARCHAR size from 30
to 255 since this is the maximum allowed length of a FQDN (RFC1035).

Also, increase the TableVersion to 2 and MODIFY the column size of
existing version 1 tables.

Fixes #579
parent 88652a21
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,24 @@ class sspmod_saml_SP_LogoutStore {
*/
private static function createLogoutTable(\SimpleSAML\Store\SQL $store) {
if ($store->getTableVersion('saml_LogoutStore') === 1) {
$tableVer = $store->getTableVersion('saml_LogoutStore');
if ($tableVer === 2) {
return;
} elseif ($tableVer === 1) {
/* TableVersion 2 increased the column size to 255 which is the maximum length of a FQDN. */
$query = 'ALTER TABLE ' . $store->prefix . '_saml_LogoutStore MODIFY _authSource VARCHAR(255) NOT NULL';
try {
$ret = $store->pdo->exec($query);
} catch (Exception $e) {
SimpleSAML\Logger::warning($store->pdo->errorInfo());
return;
}
$store->setTableVersion('saml_LogoutStore', 2);
return;
}
$query = 'CREATE TABLE ' . $store->prefix . '_saml_LogoutStore (
_authSource VARCHAR(30) NOT NULL,
_authSource VARCHAR(255) NOT NULL,
_nameId VARCHAR(40) NOT NULL,
_sessionIndex VARCHAR(50) NOT NULL,
_expire TIMESTAMP NOT NULL,
......@@ -34,7 +46,7 @@ class sspmod_saml_SP_LogoutStore {
$query = 'CREATE INDEX ' . $store->prefix . '_saml_LogoutStore_nameId ON ' . $store->prefix . '_saml_LogoutStore (_authSource, _nameId)';
$store->pdo->exec($query);
$store->setTableVersion('saml_LogoutStore', 1);
$store->setTableVersion('saml_LogoutStore', 2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment