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

Method changeFlags

src/jrd/trace/TraceService.cpp:197–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197bool TraceSvcJrd::changeFlags(ULONG id, int setFlags, int clearFlags)
198{
199 ConfigStorage* storage = TraceManager::getStorage();
200 StorageGuard guard(storage);
201
202 TraceSession session(*getDefaultMemoryPool());
203 session.ses_id = id;
204 if (storage->getSession(session, ConfigStorage::AUTH))
205 {
206 if (checkPrivileges(session))
207 {
208 const int saveFlags = session.ses_flags;
209
210 session.ses_flags |= setFlags;
211 session.ses_flags &= ~clearFlags;
212
213 if (saveFlags != session.ses_flags)
214 storage->updateFlags(session);
215
216 return true;
217 }
218
219 m_svc.printf(false, "No permissions to change other user trace session\n");
220 return false;
221 }
222
223 m_svc.printf(false, "Trace session ID %d not found\n", id);
224 return false;
225}
226
227void TraceSvcJrd::listSessions()
228{

Callers

nothing calls this directly

Calls 4

getDefaultMemoryPoolFunction · 0.85
getSessionMethod · 0.80
updateFlagsMethod · 0.80
printfMethod · 0.45

Tested by

no test coverage detected