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

Method authenticate

src/auth/AuthDbg.cpp:65–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65int DebugServer::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sb,
66 Firebird::IWriter* writerInterface)
67{
68 try
69 {
70#ifdef AUTH_VERBOSE
71 fprintf(stderr, "DebugServer::authenticate\n");
72#endif
73 unsigned int length;
74 const unsigned char* val = sb->getData(&length);
75#ifdef AUTH_VERBOSE
76 fprintf(stderr, "DebugServer::authenticate: get()=%.*s\n", length, val);
77#endif
78
79 if (str.isEmpty())
80 {
81 str.assign(val, length);
82
83 str += '_';
84#ifdef AUTH_VERBOSE
85 fprintf(stderr, "DebugServer::authenticate1: %s\n", str.c_str());
86#endif
87 sb->putData(status, str.length(), str.c_str());
88 if (status->getState() & Firebird::IStatus::STATE_ERRORS)
89 {
90 return AUTH_FAILED;
91 }
92
93 return AUTH_MORE_DATA;
94 }
95
96 str.assign(val, length);
97#ifdef AUTH_VERBOSE
98 fprintf(stderr, "DebugServer::authenticate2: %s\n", str.c_str());
99#endif
100 Firebird::LocalStatus ls;
101 Firebird::CheckStatusWrapper s(&ls);
102 writerInterface->add(&s, str.c_str());
103 check(&s);
104 str.erase();
105
106 Firebird::RefPtr<Firebird::IConfigEntry> group(Firebird::REF_NO_INCR, config->find(&s, "GROUP"));
107 check(&s);
108 if (group)
109 {
110 writerInterface->add(&s, group->getValue());
111 check(&s);
112 writerInterface->setType(&s, "GROUP");
113 check(&s);
114 }
115
116 Firebird::RefPtr<Firebird::IConfigEntry> multi(Firebird::REF_NO_INCR, config->find(&s, "MULTIGROUPS"));
117 check(&s);
118 if (multi)
119 {
120 const int limit = multi->getIntValue();
121 // list groups using writerInterface
122 const char* grName = "FillWithBigData";

Callers 1

validatePasswordFunction · 0.45

Calls 15

checkFunction · 0.50
getDataMethod · 0.45
isEmptyMethod · 0.45
assignMethod · 0.45
c_strMethod · 0.45
putDataMethod · 0.45
lengthMethod · 0.45
getStateMethod · 0.45
addMethod · 0.45
eraseMethod · 0.45
findMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected