diff options
author | stanleyk <stanleyk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-01-15 01:35:45 +0000 |
---|---|---|
committer | stanleyk <stanleyk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2013-01-15 01:35:45 +0000 |
commit | b40e34d74826b532788e052c8ce740397f6c63ac (patch) | |
tree | e8e422e5dc5fc0dad66d91603a39ff7829b68720 | |
parent | bd604a5e5db99bc3e2be3008572b14662f634cf4 (diff) | |
download | ATCD-b40e34d74826b532788e052c8ce740397f6c63ac.tar.gz |
Added checks for invalid inputs to add_member_to_iogr. Added tests to
expose issue with adding an inactive member to object group.
-rw-r--r-- | TAO/OCI_RE_ChangeLog | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp | 14 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp | 7 | ||||
-rwxr-xr-x | TAO/utils/nsgroup/run_test.pl | 36 |
4 files changed, 70 insertions, 2 deletions
diff --git a/TAO/OCI_RE_ChangeLog b/TAO/OCI_RE_ChangeLog index b458ac240c6..11e648a8d7e 100644 --- a/TAO/OCI_RE_ChangeLog +++ b/TAO/OCI_RE_ChangeLog @@ -1,3 +1,18 @@ +Tue Jan 15 01:28:10 UTC 2013 Kevin Stanley <stanleyk@ociweb.com> + + * orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp: + + Added check for invalid nil object reference being passed in to + add_member_to_iogr. + + * orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp: + + Added check for user passing in a null object reference as a member. + + * utils/nsgroup/run_test.pl: + + Added test steps to expose Bug #468. + Mon Jan 14 21:49:20 UTC 2013 Phillip LaBanca <labancap@ociweb.com> * orbsvcs/tests/FT_Naming/Federation/Hello.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp index 09efe248059..4617755347d 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_PG_Object_Group_Storable.cpp @@ -143,6 +143,15 @@ TAO::FT_PG_Object_Group_Storable::add_member_to_iogr (CORBA::Object_ptr member) // type id as the first member. We will need to replace the object // reference with an empty reference of the specified type id. + if (CORBA::is_nil (member)) + {// A null object reference is not an acceptable member of the group. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) ERROR: Unable to add null member ") + ACE_TEXT ("to object group with id: %s\n"), + this->tagged_component_.object_group_id)); + return CORBA::Object::_nil (); + } + const char* member_type_id = member->_stubobj ()->type_id.in (); if ((this->members_.current_size () == 0) && @@ -158,8 +167,9 @@ TAO::FT_PG_Object_Group_Storable::add_member_to_iogr (CORBA::Object_ptr member) catch (const CORBA::Exception&) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR: Unable to create object group ") - ACE_TEXT ("with id: %s for object of type: %s\n"), + ACE_TEXT ("(%P|%t) ERROR: Unable to add member ") + ACE_TEXT ("to object group with id: %s for object ") + ACE_TEXT ("of type: %s\n"), this->tagged_component_.object_group_id, member_type_id)); return CORBA::Object::_nil (); diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp index f116f839630..10b648a632d 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/nsgroup_svc.cpp @@ -504,6 +504,13 @@ NS_group_svc::member_add ( CORBA::Object_var ior_var = this->orb_->string_to_object(ACE_TEXT_ALWAYS_CHAR (ior)); + if (CORBA::is_nil (ior_var.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("\nInvalid member IOR provided.\n")), + -1); + } + this->naming_manager_->add_member ( group_var.in(), location_name, diff --git a/TAO/utils/nsgroup/run_test.pl b/TAO/utils/nsgroup/run_test.pl index f4e4a33d966..252e144091f 100755 --- a/TAO/utils/nsgroup/run_test.pl +++ b/TAO/utils/nsgroup/run_test.pl @@ -261,6 +261,38 @@ sub run_clients () "group_list", $POSITIVE_TEST_RESULT); +# Test BAE issue #468 + run_client ( + "group_create -group another_group -policy round", + $POSITIVE_TEST_RESULT); + + run_client ( + "group_list", + $POSITIVE_TEST_RESULT); + + run_client ( + "member_list -group another_group", + $POSITIVE_TEST_RESULT); + +# Add an inactive object IOR - will never exist during test. + run_client ( + "member_add -group another_group -location explicit -ior IOR:010000002f00000049444c3a44415441424153454143434553532f45784461746162617365416363657373536572766963653a312e3000000100000000000000c600000001010000130000006d636b6e65726e65792d6c6e78362d6465760069b036642ea200000014010f004e5550000000750000000001000000526f6f74504f41006261652e756e636c6173735f757374696c2e636f72652d66756c6c2e51756572794461746162617365416363657373536572766963652e6d636b6e65726e65792d6c6e78362d6465762f51756572794461746162617365416363657373536572766963650000000000010000005175657279446174616261736541636365737353657276696365", + $POSITIVE_TEST_RESULT); + + run_client ( + "member_list -group another_group", + $POSITIVE_TEST_RESULT); + + run_client ( + "group_remove -group another_group", + $POSITIVE_TEST_RESULT); + +#end test of BAE #468 + + run_client ( + "group_list", + $POSITIVE_TEST_RESULT); + run_client ( "group_create -group ieee -policy round", $POSITIVE_TEST_RESULT); @@ -285,6 +317,10 @@ sub run_clients () "member_add -group ieee -location $server_hostname -ior file://$naming_mgr_client_iorfile", $POSITIVE_TEST_RESULT); + run_client ( + "member_list -group ieee", + $POSITIVE_TEST_RESULT); + run_nsadd("$DEF_REF"." --name iso --ctx"); run_nslist("$NS_REF"); |