From 187f61b4837427f5391bb11d9d40b652d9c5070b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 2 Mar 2015 20:03:44 -0800 Subject: [PATCH] GUAC-1103: Explicitly cast strings to integers. --- .../auth/jdbc/connection/ConnectionMapper.xml | 18 +++++++++--------- .../jdbc/connection/ConnectionRecordMapper.xml | 4 ++-- .../auth/jdbc/connection/ParameterMapper.xml | 6 +++--- .../connectiongroup/ConnectionGroupMapper.xml | 16 ++++++++-------- .../ConnectionGroupPermissionMapper.xml | 6 +++--- .../permission/ConnectionPermissionMapper.xml | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionMapper.xml index 249ca6e78..11d18a9b4 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionMapper.xml @@ -54,7 +54,7 @@ SELECT connection_id FROM guacamole_connection WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL @@ -64,7 +64,7 @@ FROM guacamole_connection JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL AND user_id = #{user.objectID,jdbcType=INTEGER} AND permission = 'READ' @@ -82,7 +82,7 @@ WHERE connection_id IN - #{identifier,jdbcType=INTEGER} + #{identifier,jdbcType=INTEGER}::integer @@ -100,7 +100,7 @@ WHERE guacamole_connection.connection_id IN - #{identifier,jdbcType=INTEGER} + #{identifier,jdbcType=INTEGER}::integer AND user_id = #{user.objectID,jdbcType=INTEGER} AND permission = 'READ' @@ -117,7 +117,7 @@ protocol FROM guacamole_connection WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL AND connection_name = #{name,jdbcType=VARCHAR} @@ -126,7 +126,7 @@ DELETE FROM guacamole_connection - WHERE connection_id = #{identifier,jdbcType=INTEGER} + WHERE connection_id = #{identifier,jdbcType=INTEGER}::integer @@ -140,7 +140,7 @@ ) VALUES ( #{object.name,jdbcType=VARCHAR}, - #{object.parentIdentifier,jdbcType=INTEGER}, + #{object.parentIdentifier,jdbcType=INTEGER}::integer, #{object.protocol,jdbcType=VARCHAR} ) @@ -150,9 +150,9 @@ UPDATE guacamole_connection SET connection_name = #{object.name,jdbcType=VARCHAR}, - parent_id = #{object.parentIdentifier,jdbcType=INTEGER}, + parent_id = #{object.parentIdentifier,jdbcType=INTEGER}::integer, protocol = #{object.protocol,jdbcType=VARCHAR} - WHERE connection_id = #{object.objectID,jdbcType=INTEGER} + WHERE connection_id = #{object.objectID,jdbcType=INTEGER}::integer \ No newline at end of file diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml index 41601b731..de5f53076 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionRecordMapper.xml @@ -47,7 +47,7 @@ FROM guacamole_connection_history JOIN guacamole_user ON guacamole_connection_history.user_id = guacamole_user.user_id WHERE - connection_id = #{identifier,jdbcType=INTEGER} + connection_id = #{identifier,jdbcType=INTEGER}::integer ORDER BY start_date DESC, end_date DESC @@ -64,7 +64,7 @@ end_date ) VALUES ( - #{record.connectionIdentifier,jdbcType=INTEGER}, + #{record.connectionIdentifier,jdbcType=INTEGER}::integer, #{record.userID,jdbcType=INTEGER}, #{record.startDate,jdbcType=TIMESTAMP}, #{record.endDate,jdbcType=TIMESTAMP} diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ParameterMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ParameterMapper.xml index 55212d026..e3fe5d8e9 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ParameterMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connection/ParameterMapper.xml @@ -41,13 +41,13 @@ parameter_value FROM guacamole_connection_parameter WHERE - connection_id = #{identifier,jdbcType=INTEGER} + connection_id = #{identifier,jdbcType=INTEGER}::integer DELETE FROM guacamole_connection_parameter - WHERE connection_id = #{identifier,jdbcType=INTEGER} + WHERE connection_id = #{identifier,jdbcType=INTEGER}::integer @@ -60,7 +60,7 @@ ) VALUES - (#{parameter.connectionIdentifier,jdbcType=INTEGER}, + (#{parameter.connectionIdentifier,jdbcType=INTEGER}::integer, #{parameter.name,jdbcType=VARCHAR}, #{parameter.value,jdbcType=VARCHAR}) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connectiongroup/ConnectionGroupMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connectiongroup/ConnectionGroupMapper.xml index 63bd1abae..0c5195990 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connectiongroup/ConnectionGroupMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/connectiongroup/ConnectionGroupMapper.xml @@ -55,7 +55,7 @@ SELECT connection_group_id FROM guacamole_connection_group WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL @@ -65,7 +65,7 @@ FROM guacamole_connection_group JOIN guacamole_connection_group_permission ON guacamole_connection_group_permission.connection_group_id = guacamole_connection_group.connection_group_id WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL AND user_id = #{user.objectID,jdbcType=INTEGER} AND permission = 'READ' @@ -101,7 +101,7 @@ WHERE guacamole_connection_group.connection_group_id IN - #{identifier,jdbcType=INTEGER} + #{identifier,jdbcType=INTEGER}::integer AND user_id = #{user.objectID,jdbcType=INTEGER} AND permission = 'READ' @@ -118,7 +118,7 @@ type FROM guacamole_connection_group WHERE - parent_id = #{parentIdentifier,jdbcType=INTEGER} + parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer parent_id IS NULL AND connection_group_name = #{name,jdbcType=VARCHAR} @@ -127,7 +127,7 @@ DELETE FROM guacamole_connection_group - WHERE connection_group_id = #{identifier,jdbcType=INTEGER} + WHERE connection_group_id = #{identifier,jdbcType=INTEGER}::integer @@ -141,7 +141,7 @@ ) VALUES ( #{object.name,jdbcType=VARCHAR}, - #{object.parentIdentifier,jdbcType=INTEGER}, + #{object.parentIdentifier,jdbcType=INTEGER}::integer, #{object.type,jdbcType=VARCHAR} ) @@ -151,9 +151,9 @@ UPDATE guacamole_connection_group SET connection_group_name = #{object.name,jdbcType=VARCHAR}, - parent_id = #{object.parentIdentifier,jdbcType=INTEGER}, + parent_id = #{object.parentIdentifier,jdbcType=INTEGER}::integer, type = #{object.type,jdbcType=VARCHAR} - WHERE connection_group_id = #{object.objectID,jdbcType=INTEGER} + WHERE connection_group_id = #{object.objectID,jdbcType=INTEGER}::integer \ No newline at end of file diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionGroupPermissionMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionGroupPermissionMapper.xml index 0d9f25bec..33b3562ed 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionGroupPermissionMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionGroupPermissionMapper.xml @@ -62,7 +62,7 @@ WHERE guacamole_connection_group_permission.user_id = #{user.objectID,jdbcType=INTEGER} AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type - AND connection_group_id = #{identifier,jdbcType=INTEGER} + AND connection_group_id = #{identifier,jdbcType=INTEGER}::integer @@ -76,7 +76,7 @@ AND connection_group_id IN - #{identifier,jdbcType=INTEGER} + #{identifier,jdbcType=INTEGER}::integer AND permission IN (#{permission.userID,jdbcType=INTEGER}, #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, - #{permission.objectIdentifier,jdbcType=INTEGER}) + #{permission.objectIdentifier,jdbcType=INTEGER}::integer) diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionPermissionMapper.xml index 79e99e18d..4ed1ad7e9 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/resources/org/glyptodon/guacamole/auth/jdbc/permission/ConnectionPermissionMapper.xml @@ -62,7 +62,7 @@ WHERE guacamole_connection_permission.user_id = #{user.objectID,jdbcType=INTEGER} AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type - AND connection_id = #{identifier,jdbcType=INTEGER} + AND connection_id = #{identifier,jdbcType=INTEGER}::integer @@ -76,7 +76,7 @@ AND connection_id IN - #{identifier,jdbcType=INTEGER} + #{identifier,jdbcType=INTEGER}::integer AND permission IN (#{permission.userID,jdbcType=INTEGER}, #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, - #{permission.objectIdentifier,jdbcType=INTEGER}) + #{permission.objectIdentifier,jdbcType=INTEGER}::integer) @@ -112,7 +112,7 @@ (#{permission.userID,jdbcType=INTEGER}, #{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type, - #{permission.objectIdentifier,jdbcType=INTEGER}) + #{permission.objectIdentifier,jdbcType=INTEGER}::integer)