Valid on UNIX
The authxapi_RegisterExitFunction function registers an exit function for a specific event. Registration should be handled during program startup and shutdown, although it can be performed at any stage.
If the function succeeds, it returns 0. If it fails, it sets the global variable errno and returns one of the following error codes:
Return Value |
ERRNO |
Meaning |
---|---|---|
AUTHXAPI_E_OCCUPIED |
EEXIST |
Event already registered. |
AUTHXAPI_E_NOEVENT |
EINVAL |
Invalid event code. |
int authxapi_RegisterExitFunction (int event, PFSeosExitFunc user_func);
Code of the event to which your Exits API function is registered. Password events are available only when linked to the password utility. General system events are available only when linked to the seosd daemon.
Valid event values are:
Pre‑login event
Post‑login event
Pre‑general resource event
Post‑general resource event
Pre‑TCP/IP request event
Post‑TCP/IP request event
Pre‑password quality check event
Post‑password quality check event
Pre‑password change event
Post‑password change event
Pointer to the user function that CA ControlMinder should call when the specified event occurs.
Example: Registering a User's Exit Function.
This example illustrates how you use the authxapi_RegisterExitFunction function to deny all login attempts for the user ismith.
/* Sample function to deny all login attempts of user 'jsmith' */ int MyExitFunc(void *exit_data, SEOS_EXITRES *res) { SEOS_EXITLOGIN *login_data; login_data = (SEOS_EXITLOGIN *)exit_data; if (login_data‑>szUname != NULL) { if (strcmp(login_data‑>szUname, “jsmith”)) return 0; res‑>result = SEOS_EXITR_DENY; } return 0; } /* The function Access Control looks for on initialization */ /* of extension. */ int sample_RegisterExit(void) { return authxapi_RegisterExitFunction(AUTHXAPI_EV_PRELOGIN, MyExitFunc); }
Copyright © 2013 CA Technologies.
All rights reserved.
|
|