Uncrustify maxscale

See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
This commit is contained in:
Niclas Antti
2018-09-09 22:26:19 +03:00
parent fa7ec95069
commit c447e5cf15
849 changed files with 35002 additions and 27238 deletions

View File

@ -17,14 +17,14 @@
namespace
{
/**
* Check that the AuthSwitchRequest packet is as expected. Inverse of
* create_auth_change_packet() in pam_auth.cc.
*
* @param dcb Backend DCB
* @param buffer Buffer containing an AuthSwitchRequest packet
* @return True on success, false on error
*/
bool check_auth_switch_request(DCB *dcb, GWBUF *buffer)
* Check that the AuthSwitchRequest packet is as expected. Inverse of
* create_auth_change_packet() in pam_auth.cc.
*
* @param dcb Backend DCB
* @param buffer Buffer containing an AuthSwitchRequest packet
* @return True on success, false on error
*/
bool check_auth_switch_request(DCB* dcb, GWBUF* buffer)
{
/**
* The AuthSwitchRequest packet:
@ -45,19 +45,22 @@ bool check_auth_switch_request(DCB *dcb, GWBUF *buffer)
/** Server responded with something we did not expect. If it's an OK packet,
* it's possible that the server authenticated us as the anonymous user. This
* means that the server is not secure. */
bool was_ok_packet = copied > MYSQL_HEADER_LEN &&
data[MYSQL_HEADER_LEN + 1] == MYSQL_REPLY_OK;
bool was_ok_packet = copied > MYSQL_HEADER_LEN
&& data[MYSQL_HEADER_LEN + 1] == MYSQL_REPLY_OK;
MXS_ERROR("Server '%s' returned an unexpected authentication response.%s",
dcb->server->name, was_ok_packet ?
" Authentication was complete before it even started, "
"anonymous users might not be disabled." : "");
dcb->server->name,
was_ok_packet
? " Authentication was complete before it even started, "
"anonymous users might not be disabled." : "");
return false;
}
unsigned int buflen = gwbuf_length(buffer);
if (buflen != expected_buflen)
{
MXS_ERROR("Length of server AuthSwitchRequest packet was '%u', expected '%u'. %s",
buflen, expected_buflen, GENERAL_ERRMSG);
buflen,
expected_buflen,
GENERAL_ERRMSG);
return false;
}
@ -68,9 +71,9 @@ bool check_auth_switch_request(DCB *dcb, GWBUF *buffer)
uint8_t* msg_loc = msg_type_loc + 1;
bool rval = false;
if ((DIALOG == (char*)plugin_name_loc) &&
(msg_type == DIALOG_ECHO_ENABLED || msg_type == DIALOG_ECHO_DISABLED) &&
PASSWORD.compare(0, PASSWORD.length(), (char*)msg_loc, PASSWORD.length()) == 0)
if ((DIALOG == (char*)plugin_name_loc)
&& (msg_type == DIALOG_ECHO_ENABLED || msg_type == DIALOG_ECHO_DISABLED)
&& PASSWORD.compare(0, PASSWORD.length(), (char*)msg_loc, PASSWORD.length()) == 0)
{
rval = true;
}
@ -93,10 +96,10 @@ PamBackendSession::PamBackendSession()
* @param dcb Backend DCB
* @return True on success, false on error
*/
bool PamBackendSession::send_client_password(DCB *dcb)
bool PamBackendSession::send_client_password(DCB* dcb)
{
bool rval = false;
MYSQL_session *ses = (MYSQL_session*)dcb->session->client_dcb->data;
MYSQL_session* ses = (MYSQL_session*)dcb->session->client_dcb->data;
size_t buflen = MYSQL_HEADER_LEN + ses->auth_token_len;
uint8_t bufferdata[buflen];
gw_mysql_set_byte3(bufferdata, ses->auth_token_len);
@ -105,7 +108,7 @@ bool PamBackendSession::send_client_password(DCB *dcb)
return dcb_write(dcb, gwbuf_alloc_and_load(buflen, bufferdata));
}
bool PamBackendSession::extract(DCB *dcb, GWBUF *buffer)
bool PamBackendSession::extract(DCB* dcb, GWBUF* buffer)
{
gwbuf_copy_data(buffer, MYSQL_SEQ_OFFSET, 1, &m_sequence);
m_sequence++;
@ -135,12 +138,13 @@ bool PamBackendSession::extract(DCB *dcb, GWBUF *buffer)
if (!rval)
{
MXS_DEBUG("pam_backend_auth_extract to backend '%s' failed for user '%s'.",
dcb->server->name, dcb->user);
dcb->server->name,
dcb->user);
}
return rval;
}
int PamBackendSession::authenticate(DCB *dcb)
int PamBackendSession::authenticate(DCB* dcb)
{
int rval = MXS_AUTH_FAILED;