From c7f3b70b859338b8ec9dca7104cba00e36923750 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 4 Apr 2018 15:23:56 +0200 Subject: [PATCH] Increase cred_password field size in DB to be able to get fit large smime pkey. --- api/setup/setup.inc.php | 2 +- api/setup/tables_current.inc.php | 2 +- api/setup/tables_update.inc.php | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index 610c8d820b..008bcc1e24 100644 --- a/api/setup/setup.inc.php +++ b/api/setup/setup.inc.php @@ -11,7 +11,7 @@ /* Basic information about this app */ $setup_info['api']['name'] = 'api'; $setup_info['api']['title'] = 'EGroupware API'; -$setup_info['api']['version'] = '17.1'; +$setup_info['api']['version'] = '17.1.001'; $setup_info['api']['versions']['current_header'] = '1.29'; // maintenance release in sync with changelog in doc/rpm-build/debian.changes $setup_info['api']['versions']['maintenance_release'] = '17.1.20180413'; diff --git a/api/setup/tables_current.inc.php b/api/setup/tables_current.inc.php index 5849f2d85d..62788f5757 100644 --- a/api/setup/tables_current.inc.php +++ b/api/setup/tables_current.inc.php @@ -464,7 +464,7 @@ $phpgw_baseline = array( 'cred_type' => array('type' => 'int','precision' => '1','nullable' => False,'comment' => '&1=imap, &2=smtp, &4=admin'), 'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account_id or 0=all'), 'cred_username' => array('type' => 'varchar','precision' => '80','nullable' => False,'comment' => 'username'), - 'cred_password' => array('type' => 'varchar','precision' => '9600','comment' => 'password encrypted'), + 'cred_password' => array('type' => 'varchar','precision' => '16384','comment' => 'password encrypted'), 'cred_pw_enc' => array('type' => 'int','precision' => '1','default' => '0','comment' => '0=not, 1=user pw, 2=system') ), 'pk' => array('cred_id'), diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index 897c67dc7f..bbac100e98 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -407,3 +407,19 @@ function api_upgrade16_9_004() { return $GLOBALS['setup_info']['api']['currentver'] = '17.1'; } + +/** + * Give egw_ea_credentials.cred_password size 16k to accommodate bigger private s/mime keys + * + * @return string + */ +function api_upgrade17_1() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_ea_credentials','cred_password',array( + 'type' => 'varchar', + 'precision' => '16384', + 'comment' => 'password encrypted' + )); + + return $GLOBALS['setup_info']['api']['currentver'] = '17.1.001'; +} \ No newline at end of file