MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfSetEntryAccess

Function adfSetEntryAccess

dep/adflib/src/adf_dir.c:317–343  ·  view source on GitHub ↗

* adfSetEntryAccess * */

Source from the content-addressed store, hash-verified

315 *
316 */
317RETCODE 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/*

Callers

nothing calls this directly

Calls 5

adfReadEntryBlockFunction · 0.85
adfNameToEntryBlkFunction · 0.85
adfWriteDirBlockFunction · 0.85
adfWriteFileHdrBlockFunction · 0.85
adfUpdateCacheFunction · 0.85

Tested by

no test coverage detected