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:
@ -10,7 +10,7 @@
|
||||
* of this software will be governed by version 2 or later of the General
|
||||
* Public License.
|
||||
*/
|
||||
#include"pam_auth.hh"
|
||||
#include "pam_auth.hh"
|
||||
|
||||
#include <string>
|
||||
#include <maxscale/authenticator.h>
|
||||
@ -35,7 +35,7 @@ const int NUM_FIELDS = 5;
|
||||
*
|
||||
* @return Authenticator instance, or NULL on error
|
||||
*/
|
||||
static void* pam_auth_init(char **options)
|
||||
static void* pam_auth_init(char** options)
|
||||
{
|
||||
return PamInstance::create(options);
|
||||
}
|
||||
@ -47,7 +47,7 @@ static void* pam_auth_init(char **options)
|
||||
*
|
||||
* @return Authenticator session
|
||||
*/
|
||||
static void* pam_auth_alloc(void *instance)
|
||||
static void* pam_auth_alloc(void* instance)
|
||||
{
|
||||
PamInstance* inst = static_cast<PamInstance*>(instance);
|
||||
return PamClientSession::create(*inst);
|
||||
@ -58,7 +58,7 @@ static void* pam_auth_alloc(void *instance)
|
||||
*
|
||||
* @param data PAM session
|
||||
*/
|
||||
static void pam_auth_free(void *data)
|
||||
static void pam_auth_free(void* data)
|
||||
{
|
||||
delete static_cast<PamClientSession*>(data);
|
||||
}
|
||||
@ -72,9 +72,9 @@ static void pam_auth_free(void *data)
|
||||
* @return True if authentication can continue, false if
|
||||
* authentication failed
|
||||
*/
|
||||
static bool pam_auth_extract(DCB *dcb, GWBUF *read_buffer)
|
||||
static bool pam_auth_extract(DCB* dcb, GWBUF* read_buffer)
|
||||
{
|
||||
PamClientSession *pses = static_cast<PamClientSession*>(dcb->authenticator_data);
|
||||
PamClientSession* pses = static_cast<PamClientSession*>(dcb->authenticator_data);
|
||||
return pses->extract(dcb, read_buffer);
|
||||
}
|
||||
|
||||
@ -85,9 +85,9 @@ static bool pam_auth_extract(DCB *dcb, GWBUF *read_buffer)
|
||||
*
|
||||
* @return True if client supports SSL
|
||||
*/
|
||||
static bool pam_auth_connectssl(DCB *dcb)
|
||||
static bool pam_auth_connectssl(DCB* dcb)
|
||||
{
|
||||
MySQLProtocol *protocol = (MySQLProtocol*)dcb->protocol;
|
||||
MySQLProtocol* protocol = (MySQLProtocol*)dcb->protocol;
|
||||
return protocol->client_capabilities & GW_MYSQL_CAPABILITIES_SSL;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ static bool pam_auth_connectssl(DCB *dcb)
|
||||
* if authentication was successfully completed. MXS_AUTH_FAILED if authentication
|
||||
* has failed.
|
||||
*/
|
||||
static int pam_auth_authenticate(DCB *dcb)
|
||||
static int pam_auth_authenticate(DCB* dcb)
|
||||
{
|
||||
PamClientSession* pses = static_cast<PamClientSession*>(dcb->authenticator_data);
|
||||
return pses->authenticate(dcb);
|
||||
@ -113,11 +113,11 @@ static int pam_auth_authenticate(DCB *dcb)
|
||||
*
|
||||
* @param dcb DCB to free data from
|
||||
*/
|
||||
static void pam_auth_free_data(DCB *dcb)
|
||||
static void pam_auth_free_data(DCB* dcb)
|
||||
{
|
||||
if (dcb->data)
|
||||
{
|
||||
MYSQL_session *ses = (MYSQL_session *)dcb->data;
|
||||
MYSQL_session* ses = (MYSQL_session*)dcb->data;
|
||||
MXS_FREE(ses->auth_token);
|
||||
MXS_FREE(ses);
|
||||
dcb->data = NULL;
|
||||
@ -134,21 +134,21 @@ static void pam_auth_free_data(DCB *dcb)
|
||||
*
|
||||
* @return MXS_AUTH_LOADUSERS_OK on success, MXS_AUTH_LOADUSERS_ERROR on error
|
||||
*/
|
||||
static int pam_auth_load_users(SERV_LISTENER *listener)
|
||||
static int pam_auth_load_users(SERV_LISTENER* listener)
|
||||
{
|
||||
PamInstance *inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
PamInstance* inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
return inst->load_users(listener->service);
|
||||
}
|
||||
|
||||
static void pam_auth_diagnostic(DCB *dcb, SERV_LISTENER *listener)
|
||||
static void pam_auth_diagnostic(DCB* dcb, SERV_LISTENER* listener)
|
||||
{
|
||||
PamInstance *inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
PamInstance* inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
inst->diagnostic(dcb);
|
||||
}
|
||||
|
||||
static json_t* pam_auth_diagnostic_json(const SERV_LISTENER *listener)
|
||||
static json_t* pam_auth_diagnostic_json(const SERV_LISTENER* listener)
|
||||
{
|
||||
PamInstance *inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
PamInstance* inst = static_cast<PamInstance*>(listener->auth_instance);
|
||||
return inst->diagnostic_json();
|
||||
}
|
||||
|
||||
@ -157,40 +157,39 @@ extern "C"
|
||||
/**
|
||||
* Module handle entry point
|
||||
*/
|
||||
MXS_MODULE* MXS_CREATE_MODULE()
|
||||
{
|
||||
static MXS_AUTHENTICATOR MyObject =
|
||||
MXS_MODULE* MXS_CREATE_MODULE()
|
||||
{
|
||||
pam_auth_init, /* Initialize authenticator */
|
||||
pam_auth_alloc, /* Allocate authenticator data */
|
||||
pam_auth_extract, /* Extract data into structure */
|
||||
pam_auth_connectssl, /* Check if client supports SSL */
|
||||
pam_auth_authenticate, /* Authenticate user credentials */
|
||||
pam_auth_free_data, /* Free the client data held in DCB */
|
||||
pam_auth_free, /* Free authenticator data */
|
||||
pam_auth_load_users, /* Load database users */
|
||||
pam_auth_diagnostic, /* Default user diagnostic */
|
||||
pam_auth_diagnostic_json, /* Default user diagnostic */
|
||||
NULL /* No user reauthentication */
|
||||
};
|
||||
static MXS_AUTHENTICATOR MyObject =
|
||||
{
|
||||
pam_auth_init, /* Initialize authenticator */
|
||||
pam_auth_alloc, /* Allocate authenticator data */
|
||||
pam_auth_extract, /* Extract data into structure */
|
||||
pam_auth_connectssl, /* Check if client supports SSL */
|
||||
pam_auth_authenticate, /* Authenticate user credentials */
|
||||
pam_auth_free_data, /* Free the client data held in DCB */
|
||||
pam_auth_free, /* Free authenticator data */
|
||||
pam_auth_load_users, /* Load database users */
|
||||
pam_auth_diagnostic, /* Default user diagnostic */
|
||||
pam_auth_diagnostic_json, /* Default user diagnostic */
|
||||
NULL /* No user reauthentication */
|
||||
};
|
||||
|
||||
static MXS_MODULE info =
|
||||
{
|
||||
MXS_MODULE_API_AUTHENTICATOR,
|
||||
MXS_MODULE_GA,
|
||||
MXS_AUTHENTICATOR_VERSION,
|
||||
"PAM authenticator",
|
||||
"V1.0.0",
|
||||
MXS_NO_MODULE_CAPABILITIES,
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{ { MXS_END_MODULE_PARAMS} }
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
static MXS_MODULE info =
|
||||
{
|
||||
MXS_MODULE_API_AUTHENTICATOR,
|
||||
MXS_MODULE_GA,
|
||||
MXS_AUTHENTICATOR_VERSION,
|
||||
"PAM authenticator",
|
||||
"V1.0.0",
|
||||
MXS_NO_MODULE_CAPABILITIES,
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{{MXS_END_MODULE_PARAMS}}
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user