| 63 | } |
| 64 | |
| 65 | int 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"; |
no test coverage detected