Add fail2ban logging to PAM authentication requests

This commit is contained in:
matt335672
2022-03-01 16:02:37 +00:00
parent 1746ac2f79
commit 8e27f231fd
4 changed files with 51 additions and 22 deletions
+9 -5
View File
@@ -159,16 +159,18 @@ scp_msg_in_start(struct trans *trans)
int
scp_send_gateway_request(struct trans *trans,
const char *username,
const char *password)
const char *password,
const char *connection_description)
{
int rv;
rv = libipm_msg_out_simple_send(
trans,
(int)E_SCP_GATEWAY_REQUEST,
"ss",
"sss",
username,
password);
password,
connection_description);
/* Wipe the output buffer to remove the password */
libipm_msg_out_erase(trans);
@@ -181,12 +183,14 @@ scp_send_gateway_request(struct trans *trans,
int
scp_get_gateway_request(struct trans *trans,
const char **username,
const char **password)
const char **password,
const char **connection_description)
{
/* Make sure the buffer is cleared after processing this message */
libipm_set_flags(trans, LIBIPM_E_MSG_IN_ERASE_AFTER_USE);
return libipm_msg_in_parse(trans, "ss", username, password);
return libipm_msg_in_parse(trans, "sss", username, password,
connection_description);
}
/*****************************************************************************/
+6 -2
View File
@@ -150,6 +150,7 @@ scp_msg_in_reset(struct trans *trans);
* @param trans SCP transport
* @param username Username
* @param password Password
* @param connection_description Description of the connection
* @return != 0 for error
*
* Server replies with E_SCP_GATEWAY_RESPONSE
@@ -157,7 +158,8 @@ scp_msg_in_reset(struct trans *trans);
int
scp_send_gateway_request(struct trans *trans,
const char *username,
const char *password);
const char *password,
const char *connection_description);
/**
* Parse an incoming E_SCP_GATEWAY_REQUEST message (SCP server)
@@ -165,12 +167,14 @@ scp_send_gateway_request(struct trans *trans,
* @param trans SCP transport
* @param[out] username Username
* @param[out] password Password
* @param[out] connection_description Description of the connection
* @return != 0 for error
*/
int
scp_get_gateway_request(struct trans *trans,
const char **username,
const char **password);
const char **password,
const char **connection_description);
/**
* Send an E_SCP_GATEWAY_RESPONSE (SCP server)