34#define MAX_SERVICE_NAME_LENGTH 1024
68#if defined(DEBUG_ERROR_LOG) && defined(NDEBUG)
69#define ERROR_LOG(Level, Msg) \
73#define ERROR_LOG(Level, Msg) error_log_print<error_log_level::Level> Msg
79template <error_log_level::type Level>
102#define DBUG_PRINT_DO(Keyword, Msg) \
104 if (4 > get_log_level()) break; \
105 fprintf(stderr, "winauth: %s: ", Keyword); \
112 vfprintf(stderr, fmt, args);
119#define DBUG_PRINT_DO(K, M) \
124#ifndef WINAUTH_USE_DBUG_LIB
127#define DBUG_PRINT(Keyword, Msg) DBUG_PRINT_DO(Keyword, Msg)
135#define DBUG_ENTER(X) \
140#define DBUG_RETURN(X) return (X)
143#define DBUG_DUMP(A, B, C) \
180 static byte out_of_range = 0;
181 return pos <
len() ?
m_ptr[pos] : out_of_range;
224 explicit Sid(
const wchar_t *);
231 return m_type == SidTypeGroup ||
m_type == SidTypeWellKnownGroup ||
239 operator PSID()
const {
return (PSID)
m_data->User.Sid; }
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Class representing a region of memory (e.g., a string or binary buffer).
Definition: common.h:160
byte & operator[](unsigned pos) const
Definition: common.h:179
void trim(size_t l)
Definition: common.h:186
Blob()
Definition: common.h:165
bool is_null() const
Definition: common.h:184
size_t m_len
Length of the memory region.
Definition: common.h:162
byte * ptr() const
Definition: common.h:175
size_t len() const
Definition: common.h:177
byte * m_ptr
Pointer to the first byte of the memory region.
Definition: common.h:161
Blob(const byte *ptr, const size_t len)
Definition: common.h:167
Blob(const char *str)
Definition: common.h:170
Connection class.
Definition: common.h:196
int m_error
If non-zero, indicates that connection is broken.
Definition: common.h:203
Blob read()
Read data from connection.
Definition: common.cc:100
int error() const
Definition: common.h:210
MYSQL_PLUGIN_VIO * m_vio
Pointer to MYSQL_PLUGIN_VIO structure.
Definition: common.h:197
Connection(MYSQL_PLUGIN_VIO *vio)
Connection class.
Definition: common.cc:65
int write(const Blob &)
Write data to the connection.
Definition: common.cc:80
Sid class.
Definition: common.h:219
SID_NAME_USE m_type
Type of identified entity.
Definition: common.h:221
~Sid()
Definition: common.cc:230
bool is_group(void) const
Definition: common.h:230
bool is_valid(void) const
Check if Sid object is valid.
Definition: common.cc:238
bool is_user(void) const
Definition: common.h:235
bool operator==(const Sid &) const
Definition: common.cc:276
Sid(const wchar_t *)
Sid class.
Definition: common.cc:126
char * m_as_string
Cached string representation of the SID.
Definition: common.h:244
TOKEN_USER * m_data
Pointer to structure holding identifier's data.
Definition: common.h:220
const char * as_string()
Produces string representation of the SID.
Definition: common.cc:253
UPN class.
Definition: common.h:258
char * m_buf
Pointer to UPN in utf8 representation.
Definition: common.h:259
bool is_valid() const
Definition: common.h:266
const Blob as_blob() const
Definition: common.h:268
~UPN()
Definition: common.cc:327
const char * as_string() const
Definition: common.h:272
UPN()
Generating User Principal Name.
Definition: common.cc:289
size_t m_len
Length of the name.
Definition: common.h:260
const char * get_last_error_message(Error_message_buf)
Error handling.
Definition: common.cc:467
void set_log_level(unsigned int)
Definition: log_client.cc:59
unsigned char byte
Blob class.
Definition: common.h:151
void debug_msg(const char *fmt,...)
Definition: common.h:109
char * wchar_to_utf8(const wchar_t *, size_t *)
Convert a wide-char string to utf8 representation.
Definition: common.cc:347
char Error_message_buf[1024]
Definition: common.h:87
void error_log_print(const char *fmt,...)
Definition: common.h:80
unsigned int get_log_level(void)
Definition: log_client.cc:61
int opt_auth_win_log_level
Definition: common.h:51
void error_log_vprint(error_log_level::type level, const char *fmt, va_list args)
Definition: log_client.cc:31
wchar_t * utf8_to_wchar(const char *, size_t *)
Convert an utf8 string to a wide-char string.
Definition: common.cc:411
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
borrowable::binary::Blob< true > Blob
Definition: classic_protocol_binary.h:327
This file defines constants and data structures that are the same for both client- and server-side au...
Provides plugin access to communication channel.
Definition: plugin_auth_common.h:146
Debugging and error reporting infrastructure.
Definition: common.h:47
type
Definition: common.h:48
@ INFO
Definition: common.h:48
@ WARNING
Definition: common.h:48
@ ERROR
Definition: common.h:48
#define HANDLE
Definition: violite.h:159