Check devID for owned device 33/210033/1
authorVitalii Irkha <v.irkha@samsung.com>
Mon, 1 Jul 2019 10:33:19 +0000 (13:33 +0300)
committerSudipto Bal <sudipto.bal@samsung.com>
Mon, 15 Jul 2019 06:23:57 +0000 (06:23 +0000)
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);