~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/authentication.cc

  • Committer: Toru Maesaka
  • Date: 2008-12-17 07:16:37 UTC
  • mto: (685.1.40 devel) (713.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 713.
  • Revision ID: dev@torum.net-20081217071637-7j9040w7lpms77r2
Removed my_time() and added error checking

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