* adfSetEntryAccess * */
| 315 | * |
| 316 | */ |
| 317 | RETCODE adfSetEntryAccess(struct Volume* vol, SECTNUM parSect, char* name, |
| 318 | int32_t newAcc) |
| 319 | { |
| 320 | struct bEntryBlock parent, entry; |
| 321 | SECTNUM nSect; |
| 322 | |
| 323 | if (adfReadEntryBlock( vol, parSect, &parent )!=RC_OK) |
| 324 | return RC_ERROR; |
| 325 | nSect = adfNameToEntryBlk(vol, parent.hashTable, name, &entry, NULL); |
| 326 | if (nSect==-1) { |
| 327 | (*adfEnv.wFct)("adfSetEntryAccess : entry not found"); |
| 328 | return RC_ERROR; |
| 329 | } |
| 330 | |
| 331 | entry.access = newAcc; |
| 332 | if (entry.secType==ST_DIR) |
| 333 | adfWriteDirBlock(vol, nSect, (struct bDirBlock*)&entry); |
| 334 | else if (entry.secType==ST_FILE) |
| 335 | adfWriteFileHdrBlock(vol, nSect, (struct bFileHeaderBlock*)&entry); |
| 336 | else |
| 337 | (*adfEnv.wFct)("adfSetEntryAccess : entry secType incorrect"); |
| 338 | |
| 339 | if (isDIRCACHE(vol->dosType)) |
| 340 | adfUpdateCache(vol, &parent, (struct bEntryBlock*)&entry, FALSE); |
| 341 | |
| 342 | return RC_OK; |
| 343 | } |
| 344 | |
| 345 | |
| 346 | /* |
nothing calls this directly
no test coverage detected