Esempio n. 1
0
void
authenticateUserCacheRestart(void)
{
    auth_user_hash_pointer *usernamehash;
    auth_user_t *auth_user;
    char *username = NULL;
    debug(29, 3) ("authenticateUserCacheRestart: Clearing config dependent cache data.\n");
    hash_first(proxy_auth_username_cache);
    while ((usernamehash = ((auth_user_hash_pointer *) hash_next(proxy_auth_username_cache)))) {
	auth_user = usernamehash->auth_user;
	username = authenticateUserUsername(auth_user);
	debug(29, 5) ("authenticateUserCacheRestat: Clearing cache ACL results for user: %s\n", username);
	aclCacheMatchFlush(&auth_user->proxy_match_cache);
    }

}
Esempio n. 2
0
void
authenticateFreeProxyAuthUser(void *data)
{
	auth_user_t *u = data;
	auth_user_request_t *auth_user_request;
	dlink_node *link, *tmplink;
	assert(data != NULL);
	debug(29, 5) ("authenticateFreeProxyAuthUser: Freeing auth_user '%p' with refcount '%ld'.\n", u, (long int) u->references);
	assert(u->references == 0);
	/* were they linked in by username ? */
	if (u->usernamehash)
	{
		assert(u->usernamehash->auth_user == u);
		debug(29, 5) ("authenticateFreeProxyAuthUser: removing usernamehash entry '%p'\n", u->usernamehash);
		hash_remove_link(proxy_auth_username_cache,
						 (hash_link *) u->usernamehash);
		/* don't free the key as we use the same user string as the auth_user
		 * structure */
		memFree(u->usernamehash, MEM_AUTH_USER_HASH);
	}
	/* remove any outstanding requests */
	link = u->requests.head;
	while (link)
	{
		debug(29, 5) ("authenticateFreeProxyAuthUser: removing request entry '%p'\n", link->data);
		auth_user_request = link->data;
		tmplink = link;
		link = link->next;
		dlinkDelete(tmplink, &u->requests);
		dlinkNodeDelete(tmplink);
		authenticateAuthUserRequestFree(auth_user_request);
	}
	/* free cached acl results */
	aclCacheMatchFlush(&u->proxy_match_cache);
	/* free seen ip address's */
	authenticateAuthUserClearIp(u);
	if (u->scheme_data && u->auth_module > 0)
		authscheme_list[u->auth_module - 1].FreeUser(u);
	/* prevent accidental reuse */
	u->auth_type = AUTH_UNKNOWN;
	memFree(u, MEM_AUTH_USER_T);
}