Add a client authentication hook.
KaiGai Kohei, with minor cleanup of the comments by me.
This commit is contained in:
parent
1fea0c05eb
commit
20709f8136
@ -216,6 +216,12 @@ static int CheckRADIUSAuth(Port *port);
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* This hook allows plugins to get control following client authentication,
|
||||
* but before the user has been informed about the results. It could be used
|
||||
* to record login events, insert a delay after failed authentication, etc.
|
||||
*/
|
||||
ClientAuthentication_hook_type ClientAuthentication_hook = NULL;
|
||||
|
||||
/*
|
||||
* Tell the user the authentication failed, but not (much about) why.
|
||||
@ -577,6 +583,9 @@ ClientAuthentication(Port *port)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ClientAuthentication_hook)
|
||||
(*ClientAuthentication_hook)(port, status);
|
||||
|
||||
if (status == STATUS_OK)
|
||||
sendAuthRequest(port, AUTH_REQ_OK);
|
||||
else
|
||||
|
@ -24,4 +24,8 @@ extern char *pg_krb_realm;
|
||||
|
||||
extern void ClientAuthentication(Port *port);
|
||||
|
||||
/* Hook for plugins to get control in ClientAuthentication() */
|
||||
typedef void (*ClientAuthentication_hook_type)(Port *, int);
|
||||
extern PGDLLIMPORT ClientAuthentication_hook_type ClientAuthentication_hook;
|
||||
|
||||
#endif /* AUTH_H */
|
||||
|
Loading…
Reference in New Issue
Block a user