Bug 44839

GemStone/S 64 Bit

3.2.3, 3.2.2, 3.2.1, 3.2, 3.1.0.6, 3.1.0.5, 3.1.0.4, 3.1.0.3, 3.1.0.2, 3.1.0.1, 3.1, 3.0.1, 3.0

All Platforms

3.2.4

removeAndCleanup:migrateSecurityPoliciesTo: can fail on migrated repositories

The method #removeAndCleanup:migrateSecurityPoliciesTo: can fail when executed over a repository that has been migrated from a pre-3.0 version of GS/64.  The error returned is:

ERROR 2010 , a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand  #'owner' (MessageNotUnderstood)

The error occurs if nil is an element of the GsObjectSecurityPolicy list in SystemRepository.  You can check this by doing the following:

    topaz 1> level 1
    topaz 1> object SystemRepository

The following example will hit this bug because the 10th element is nil:

topaz 1> object SystemRepository

a Repository
  name                SystemRepository
  dataDictionary      nil
  #1 a GsObjectSecurityPolicy
  #2 a GsObjectSecurityPolicy
  #3 a GsObjectSecurityPolicy
  #4 a GsObjectSecurityPolicy
  #5 a GsObjectSecurityPolicy
  #6 a GsObjectSecurityPolicy
  #7 a GsObjectSecurityPolicy
  #8 a GsObjectSecurityPolicy
  #9 a GsObjectSecurityPolicy
  #10 nil
  #11 a GsObjectSecurityPolicy
  #12 a GsObjectSecurityPolicy
  #13 a GsObjectSecurityPolicy
  #14 a GsObjectSecurityPolicy
  #15 a GsObjectSecurityPolicy

Or execute the following code:

run
  1 to: SystemRepository size do: [:i |
      (SystemRepository at: i) ifNil: [ ^#WillHitBug44839 ]].
  ^ #OK
%

Workaround

File-in and commit the following code as SystemUser:

! Code to fix bug 44839
!
category: 'Private'
method: UserProfileSet
_migrateSecurityPoliciesFrom: aUserProfile to: anotherUserProfile

| sr |
anotherUserProfile _validateClass: UserProfile .
anotherUserProfile isCommitted
  ifFalse:[ anotherUserProfile _error: #rtErrObjMustBeCommitted ] .
aUserProfile == anotherUserProfile
  ifTrue:[ aUserProfile halt: 'Cannot migrate GsSecurityPolicyObjects to this Us
erProfile' ] .
sr := SystemRepository .
1 to: sr size do:[:n| 
  (sr at: n ) ifNotNil:[ :policy |
    policy owner == aUserProfile
      ifTrue:[ policy owner: anotherUserProfile ] .
  ].
].
%


Last updated: 12/4/14