Spring Security
  1. Spring Security
  2. SEC-1199

JdbcMutableAclService can't create acl_object_identity entry in PostgreSQL

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.5
    • Fix Version/s: 3.0.0 RC1
    • Component/s: ACLs
    • Labels:
      None
    • Environment:
      PostgreSQL 8.3 + driver postgresql-8.4-701.jdbc3.jar
      Windows XP

      Description

      The JdbcMutableAclService fails to create acl_object_identity entry in Postgresql, because it passes string as the object_id_identity where an integer (long) type is expected (in method JdbcMutableAclService.createObjectIdentity() ).
      The result is:

      org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [insert into acl_object_identity (object_id_class, object_id_identity, owner_sid, entries_inheriting) values (?, ?, ?, ?)]; nested exception is org.postgresql.util.PSQLException: ERROR: column "object_id_identity" is of type bigint but expression is of type character varying
      Hint: You will need to rewrite or cast the expression.
      Position: 51
      at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
      at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:850)
      at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:858)
      at org.springframework.security.acls.jdbc.JdbcMutableAclService.createObjectIdentity(JdbcMutableAclService.java:157)
      at org.springframework.security.acls.jdbc.JdbcMutableAclService.createAcl(JdbcMutableAclService.java:108)

        Issue Links

          Activity

          Hide
          Luke Taylor added a comment -

          Looks like a duplicate of SEC-1038.

          Show
          Luke Taylor added a comment - Looks like a duplicate of SEC-1038 .
          Hide
          Adam Dyga added a comment -

          True. However it's a pity that it's only fixed in 3.x branch...

          Show
          Adam Dyga added a comment - True. However it's a pity that it's only fixed in 3.x branch...
          Hide
          Luke Taylor added a comment -

          Closing as duplicate.

          Show
          Luke Taylor added a comment - Closing as duplicate.

            People

            • Assignee:
              Luke Taylor
              Reporter:
              Adam Dyga
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: