~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/authentication.cc

  • Committer: Monty Taylor
  • Date: 2008-11-07 04:45:58 UTC
  • mfrom: (574.3.4 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: monty@inaugust.com-20081107044558-2me2c70ksfr3qs9i
Merged from Lee (and from trunk by proxy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <drizzled/server_includes.h>
22
22
#include <drizzled/authentication.h>
23
 
#include <libdrizzle/gettext.h>
 
23
#include <drizzled/gettext.h>
24
24
 
25
25
static bool are_plugins_loaded= false;
26
26
 
27
 
static bool authenticate_by(THD *thd, plugin_ref plugin, void* p_data)
 
27
static bool authenticate_by(Session *session, plugin_ref plugin, void* p_data)
28
28
{
29
29
  const char *password= (const char *)p_data;
30
30
  authentication_st *auth= plugin_data(plugin, authentication_st *);
33
33
 
34
34
  if (auth && auth->authenticate)
35
35
  {
36
 
    if (auth->authenticate(thd, password))
 
36
    if (auth->authenticate(session, password))
37
37
      return true;
38
38
  }
39
39
 
40
40
  return false;
41
41
}
42
42
 
43
 
bool authenticate_user(THD *thd, const char *password)
 
43
bool authenticate_user(Session *session, const char *password)
44
44
{
45
45
  /* If we never loaded any auth plugins, just return true */
46
46
  if (are_plugins_loaded != true)
47
47
    return true;
48
48
 
49
 
  return plugin_foreach(thd, authenticate_by, DRIZZLE_AUTH_PLUGIN, (void *)password);
 
49
  return plugin_foreach(session, authenticate_by, DRIZZLE_AUTH_PLUGIN, (void *)password);
50
50
}
51
51
 
52
52