Check devID for owned device 27/209927/1
authorVitalii Irkha <v.irkha@samsung.com>
Mon, 1 Jul 2019 10:33:19 +0000 (13:33 +0300)
committerSudipto Bal <sudipto.bal@samsung.com>
Fri, 12 Jul 2019 06:51:09 +0000 (12:21 +0530)
devID should be the same for owned device.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/529/commits/3b966521b2c0ced20bacce722b741f998ad0391b
(cherry picked from 3b966521b2c0ced20bacce722b741f998ad0391b)

Change-Id: Icd13121c99faf0cfde92667a5d5fcaf902e0f205
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
resource/csdk/security/src/doxmresource.c

index 6d35780..e88a381 100644 (file)
@@ -1310,6 +1310,13 @@ static OCEntityHandlerResult HandleDoxmPostRequest(OCEntityHandlerRequest * ehRe
                     ehRet = OC_EH_NOT_ACCEPTABLE;
                     goto exit;
                 }
+
+                if(0 != memcmp(&gDoxm->owner.id, &newDoxm->owner.id, sizeof(gDoxm->owner.id)))
+                {
+                    OIC_LOG(ERROR, TAG, "Not acceptable request for owned property");
+                    ehRet = OC_EH_NOT_ACCEPTABLE;
+                }
+
                 //Update gDoxm based on newDoxm
                 updateWriteableProperty(newDoxm, gDoxm);