[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7a39d71d0e102bfac1e6059911597daf191f4b3b
Evergreen Git
git at git.evergreen-ils.org
Wed Aug 22 14:50:53 EDT 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 7a39d71d0e102bfac1e6059911597daf191f4b3b (commit)
via 61329042eff1ef99d5b1a0a23758b7376f4ced2c (commit)
from bf52858f4f5da72bf0ddaec6db8720a53ce99969 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7a39d71d0e102bfac1e6059911597daf191f4b3b
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date: Wed Aug 22 14:49:02 2012 -0400
2.2.1 -> 2.2.2 upgrade script
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.2.1-2.2.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.2.1-2.2.2-upgrade-db.sql
new file mode 100644
index 0000000..52696ff
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.2.1-2.2.2-upgrade-db.sql
@@ -0,0 +1,13 @@
+--Upgrade Script for 2.2.1 to 2.2.2
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.2.2', :eg_version);
+
+SELECT evergreen.upgrade_deps_block_check('0736', :eg_version);
+
+INSERT INTO permission.perm_list (id, code, description)
+ VALUES (539, 'UPDATE_ORG_UNIT_SETTING.ui.hide_copy_editor_fields', 'Allows staff to edit displayed copy editor fields');
+
+UPDATE config.org_unit_setting_type SET update_perm = 539 WHERE name = 'ui.hide_copy_editor_fields';
+
+
+COMMIT;
commit 61329042eff1ef99d5b1a0a23758b7376f4ced2c
Author: Bill Erickson <berick at esilibrary.com>
Date: Thu Aug 16 15:40:58 2012 -0400
Sanity check cstore limit/offset param values
Certain cstore calls (direct / json_query) that support limit/offset
params called with a non-string / non-numeric value
e.g. { "limit": null }
result in a cstore segfault as it tries to call atoi(NULL) under the
covers. This patch prevents this by verifying that the limit/offset
values are actual strings or numbers (i.e. return a value from
jsonObjectGetString) and not JSON_NULL, etc.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index 902a4e0..c9c1618 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -4910,12 +4910,16 @@ char* SELECT (
if( limit ){
const char* str = jsonObjectGetString( limit );
- buffer_fadd( sql_buf, " LIMIT %d", atoi( str ));
+ if (str) { // limit could be JSON_NULL, etc.
+ buffer_fadd( sql_buf, " LIMIT %d", atoi( str ));
+ }
}
if( offset ) {
const char* str = jsonObjectGetString( offset );
- buffer_fadd( sql_buf, " OFFSET %d", atoi( str ));
+ if (str) {
+ buffer_fadd( sql_buf, " OFFSET %d", atoi( str ));
+ }
}
if( !(flags & SUBSELECT) )
@@ -5453,21 +5457,25 @@ static char* buildSELECT ( const jsonObject* search_hash, jsonObject* rest_of_qu
const jsonObject* limit = jsonObjectGetKeyConst( rest_of_query, "limit" );
if( limit ) {
const char* str = jsonObjectGetString( limit );
- buffer_fadd(
- sql_buf,
- " LIMIT %d",
- atoi(str)
- );
+ if (str) {
+ buffer_fadd(
+ sql_buf,
+ " LIMIT %d",
+ atoi(str)
+ );
+ }
}
const jsonObject* offset = jsonObjectGetKeyConst( rest_of_query, "offset" );
if( offset ) {
const char* str = jsonObjectGetString( offset );
- buffer_fadd(
- sql_buf,
- " OFFSET %d",
- atoi( str )
- );
+ if (str) {
+ buffer_fadd(
+ sql_buf,
+ " OFFSET %d",
+ atoi( str )
+ );
+ }
}
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/c-apps/oils_sql.c | 32 ++++++++++++-------
.../2.2.1-2.2.2-upgrade-db.sql} | 4 ++-
2 files changed, 23 insertions(+), 13 deletions(-)
copy Open-ILS/src/sql/Pg/{upgrade/0736.data.copy_editor_perms.sql => version-upgrade/2.2.1-2.2.2-upgrade-db.sql} (75%)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list