osaf/services/saf/immsv/immnd/ImmModel.cc |  18 ++++++++++++++++--
 osaf/services/saf/immsv/immnd/ImmModel.hh |   3 ++-
 osaf/services/saf/immsv/immnd/immnd.h     |  10 ++++++++++
 3 files changed, 28 insertions(+), 3 deletions(-)


ERR_BAD_OPERATION is returned when :
1. Enabling PBE when no PBE file has been configured
2. Enabling PBE when imm has not been built with --enable-imm-pbe

diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
b/osaf/services/saf/immsv/immnd/ImmModel.cc
--- a/osaf/services/saf/immsv/immnd/ImmModel.cc
+++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
@@ -735,9 +735,10 @@ immModel_ccbObjectModify(IMMND_CB *cb,
     bool* hasLongDns)
 {
     std::string objectName;
+    bool pbeFile = (cb->mPbeFile != NULL)?true:false;
     SaAisErrorT err = ImmModel::instance(&cb->immModel)->
         ccbObjectModify(req, implConn, implNodeId, continuationId,
-        pbeConn, pbeNodeId, objectName, hasLongDns);
+        pbeConn, pbeNodeId, objectName, hasLongDns, pbeFile);
 
     if(err == SA_AIS_OK && !objectName.empty()) {
         *objName = (char*) malloc((objectName.length() + 1) * sizeof(char));
@@ -7707,7 +7708,8 @@ ImmModel::ccbObjectModify(const ImmsvOmC
     SaUint32T* pbeConnPtr,
     unsigned int* pbeNodeIdPtr,
     std::string& objectName,
-    bool* hasLongDns)
+    bool* hasLongDns,
+    bool pbeFile)
 {
     TRACE_ENTER();
     osafassert(hasLongDns);
@@ -7955,6 +7957,18 @@ ImmModel::ccbObjectModify(const ImmsvOmC
             err = SA_AIS_ERR_BAD_OPERATION;
             break; //out of for-loop
         }
+       
+       if(modifiedRim && !ENABLE_PBE) {
+            LOG_NO("ERR_BAD_OPERATION:  imm has not been built with 
--enable-imm-pbe");
+            err = SA_AIS_ERR_BAD_OPERATION;
+            break; 
+        }
+        
+       if(modifiedRim && !pbeFile) {
+            LOG_NO("ERR_BAD_OPERATION: PBE file is not configured");
+            err = SA_AIS_ERR_BAD_OPERATION;
+            break; 
+        }
         
         i4 = classInfo->mAttrMap.find(attrName);
         if(i4==classInfo->mAttrMap.end()) {
diff --git a/osaf/services/saf/immsv/immnd/ImmModel.hh 
b/osaf/services/saf/immsv/immnd/ImmModel.hh
--- a/osaf/services/saf/immsv/immnd/ImmModel.hh
+++ b/osaf/services/saf/immsv/immnd/ImmModel.hh
@@ -244,7 +244,8 @@ public:
                                         SaUint32T* pbeConn,
                                         unsigned int* pbeNodeId,
                                         std::string& objectName,
-                                        bool* hasLongDns);
+                                        bool* hasLongDns,
+                                        bool pbeFile);
     
     SaAisErrorT         ccbObjectDelete(
                                         const ImmsvOmCcbObjectDelete* req,
diff --git a/osaf/services/saf/immsv/immnd/immnd.h 
b/osaf/services/saf/immsv/immnd/immnd.h
--- a/osaf/services/saf/immsv/immnd/immnd.h
+++ b/osaf/services/saf/immsv/immnd/immnd.h
@@ -32,4 +32,14 @@
 #include "immnd_cb.h"
 #include "immnd_init.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_IMM_PBE
+#define ENABLE_PBE 1
+#else
+#define ENABLE_PBE 0
+#endif
+
 #endif   /* IMMND_H */

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to