Menu

#2771 imm: pbe restarted when creating reserved IMM class names

5.18.04
fixed
nobody
None
defect
imm
lib
major
False
2018-03-07
2018-01-25
No

When creating an IMM object class with PBE enable, PBE will create a sqlite table, same name as the IMM object class name. Besides, PBE has several internal tables. PBE will be restarted and NEVER come up if user requests to create same class name with one of these reserved ones.

For example: creating a class with following model.

    <class name="objects">
                <category>SA_CONFIG</category>
                <rdn>
                        <name>testClass</name>
                        <type>SA_STRING_T</type>
                        <category>SA_CONFIG</category>
                        <flag>SA_INITIALIZED</flag>
                </rdn>
      </class>
root@SC-1:~# immcfg -f test.xml
FAILED to create class 'objects', rc = SA_AIS_ERR_TIMEOUT (5)

We will observe PBE restarted. Here is the syslog:

2018-01-25 04:11:34.204 SC-1 osafimmpbed: ER SQL statement ('CREATE TABLE "objects" (obj_id integer primary key, "testClass" text, "SaImmAttrImplementerName" text, "SaImmAttrClassName" text, "SaImmAttrAdminOwnerName" text)') failed because:#012 table "objects" already exists
2018-01-25 04:11:34.204 SC-1 osafimmpbed: ER Exiting (line:1447)

I propose to have a check at IMM agent, and return SA_AIS_ERR_INVALID_PARAM to user.

Related

Wiki: ChangeLog-5.18.04

Discussion

  • Vu Minh Nguyen

    Vu Minh Nguyen - 2018-01-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -I) When creating an  IMM object class with PBE enable, PBE will create a sqlite table, same name as the IMM object class name. Besides, PBE has several internal tables. PBE will be restarted if user requests to create same class name with one of these reserved ones.
    +When creating an  IMM object class with PBE enable, PBE will create a sqlite table, same name as the IMM object class name. Besides, PBE has several internal tables. PBE will be restarted and NEVER come up if user requests to create same class name with one of these reserved ones.
    
     For example: creating a class with following model.
    
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2018-01-25
    • status: assigned --> review
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2018-01-30

    Update according to Zoran's recommendation. Re-using table name check which exists in ImmModel.

    https://sourceforge.net/p/opensaf/mailman/message/36209969/

     
  • Anders Widell

    Anders Widell - 2018-02-02
    • Milestone: 5.18.01 --> 5.18.04
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2018-03-07
    • status: review --> fixed
    • assigned_to: Vu Minh Nguyen --> nobody
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2018-03-07

    commit 819a9e4438edfb7fc75a4b06bb7a5aad09891038 (HEAD, origin/develop, ticket-2771, develop)
    Author: Vu Minh Nguyen vu.m.nguyen@dektech.com.au
    Date: Wed Mar 7 11:34:51 2018 +0700

    imm: not allow creating reserved IMM class names [#2771]
    
    PBE will be restarted and will not be able to come up if user requests
    creating IMM object class with same name of reserved ones.
    
    This patch adds code to reject such request with SA_AIS_ERR_INVALID_PARAM.
    
     

Log in to post a comment.