# HG changeset patch # User etisserant # Date 1203429219 -3600 # Node ID 77f875d452507b451a6c8ce53cc5c487cbd41951 # Parent 2c90876b97518124c212fbe34698b8e8eaa43482 Fixed faulty read access checking on OD access. Added read acces s checking in SDO (was disabled) diff -r 2c90876b9751 -r 77f875d45250 src/objacces.c --- a/src/objacces.c Tue Feb 19 14:52:40 2008 +0100 +++ b/src/objacces.c Tue Feb 19 14:53:39 2008 +0100 @@ -127,7 +127,7 @@ return OD_NO_SUCH_SUBINDEX; } - if (checkAccess && !(ptrTable->pSubindex[bSubindex].bAccessType & WO)) { + if (checkAccess && (ptrTable->pSubindex[bSubindex].bAccessType & WO)) { MSG_WAR(0x2B30, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType); accessDictionaryError(wIndex, bSubindex, 0, 0, OD_WRITE_NOT_ALLOWED); return OD_READ_NOT_ALLOWED; @@ -161,17 +161,7 @@ # endif *pExpectedSize = szData; -#if 0 - /* Me laisser a, please ! (FD) */ - { - UNS8 i; - for (i = 0 ; i < 10 ; i++) { - MSG_WAR(*pExpectedSize, "dic data= ", - *(UNS8 *)(ptrTable->pSubindex[bSubindex].pObject + i)); - } - - } -#endif + return OD_SUCCESSFUL; } else { /* Error ! */ diff -r 2c90876b9751 -r 77f875d45250 src/sdo.c --- a/src/sdo.c Tue Feb 19 14:52:40 2008 +0100 +++ b/src/sdo.c Tue Feb 19 14:53:39 2008 +0100 @@ -217,22 +217,14 @@ errorCode = getODentry(d, d->transfers[line].index, d->transfers[line].subIndex, (void *)d->transfers[line].data, - &size, &dataType, 0); + &size, &dataType, 1); if (errorCode != OD_SUCCESSFUL) return errorCode; d->transfers[line].count = size; d->transfers[line].offset = 0; -#if 0 - /*Me laisser a, please ! (FD)*/ - { - UNS8 i; - for (i = 0 ; i < 10 ; i++) { - MSG_WAR(i, "data= ", d->transfers[line].data[i]); - } - } -#endif + return 0; }