~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Monty Taylor
  • Date: 2010-03-02 18:33:15 UTC
  • mto: (1317.4.1) (1320.1.13 build)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: mordred@inaugust.com-20100302183315-84c30ejnvpj2q8w1
Fixed Authentication plugin interface to use SecurityContext rather than the
whole darned Session object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
671
671
 
672
672
bool Session::checkUser(const char *passwd, uint32_t passwd_len, const char *in_db)
673
673
{
674
 
  bool is_authenticated;
675
 
 
676
674
  if (passwd_len != 0 && passwd_len != SCRAMBLE_LENGTH)
677
675
  {
678
676
    my_error(ER_HANDSHAKE_ERROR, MYF(0), getSecurityContext().getIp().c_str());
679
677
    return false;
680
678
  }
681
679
 
682
 
  is_authenticated= plugin::Authentication::isAuthenticated(this, passwd);
 
680
  const string passwd_str(passwd, passwd_len);
 
681
  bool is_authenticated=
 
682
    plugin::Authentication::isAuthenticated(getSecurityContext(),
 
683
                                            passwd_str);
683
684
 
684
685
  if (is_authenticated != true)
685
686
  {
686
 
    my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
687
 
             getSecurityContext().getUser().c_str(),
688
 
             getSecurityContext().getIp().c_str(),
689
 
             passwd_len ? ER(ER_YES) : ER(ER_NO));
690
 
 
 
687
    /* isAuthenticated has pushed the error message */
691
688
    return false;
692
689
  }
693
690