MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / search

Method search

src/jrd/Mapping.cpp:433–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433void Mapping::Cache::search(ExtInfo& info, const Map& from, AuthWriter& newBlock,
434 const NoCaseString& originalUserName)
435{
436 MAP_DEBUG(fprintf(stderr, "Key = %s\n", from.makeHashKey().c_str()));
437 if (!dataFlag)
438 return;
439
440 for (Map* to = lookup(from); to; to = to->next(from))
441 {
442 MAP_DEBUG(fprintf(stderr, "Match!!\n"));
443 unsigned flagRolUsr = to->toRole ? FLAG_ROLE : FLAG_USER;
444 if (info.found & flagRolUsr)
445 continue;
446
447 const NoCaseString& newName(to->to == "*" ? originalUserName : to->to);
448 NoCaseString& infoName(to->toRole ? info.currentRole : info.currentUser);
449 if (info.current & flagRolUsr)
450 {
451 if (infoName == newName)
452 continue;
453 (Arg::Gds(isc_map_multi) << originalUserName).raise();
454 }
455
456 info.current |= flagRolUsr;
457 infoName = newName;
458
459 AuthReader::Info newInfo;
460 newInfo.type = to->toRole ? NM_ROLE : NM_USER;
461 newInfo.name = newName;
462 newInfo.secDb = this->name;
463 newInfo.origPlug = info.origPlug.hasData() ? info.origPlug : info.plugin;
464 newBlock.add(newInfo);
465 }
466}
467
468void Mapping::Cache::varPlugin(ExtInfo& info, Map from, AuthWriter& newBlock)
469{

Callers

nothing calls this directly

Calls 8

GdsClass · 0.85
makeHashKeyMethod · 0.80
lookupFunction · 0.50
c_strMethod · 0.45
nextMethod · 0.45
raiseMethod · 0.45
hasDataMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected