~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/plugin/authentication.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "config.h"
22
22
#include "drizzled/plugin/authentication.h"
23
23
#include "drizzled/error.h"
24
 
#include "drizzled/plugin/registry.h"
25
24
#include "drizzled/gettext.h"
26
25
#include "drizzled/security_context.h"
27
26
 
77
76
    find_if(all_authentication.begin(), all_authentication.end(),
78
77
            AuthenticateBy(sctx, password));
79
78
 
80
 
  /* If iter is == end() here, that means that all of the plugins returned
81
 
   * false, which in this case means they all succeeded. Since we want to 
82
 
   * return false on success, we return the value of the two being != 
 
79
  /* We only require one plugin to return success in order to authenticate.
 
80
   * If iter is == end() here, that means that all of the plugins returned
 
81
   * false, which means they all failed.
83
82
   */
84
 
  if (iter != all_authentication.end())
 
83
  if (iter == all_authentication.end())
85
84
  {
86
85
    my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
87
86
             sctx.getUser().c_str(),
88
87
             sctx.getIp().c_str(),
89
88
             password.empty() ? ER(ER_NO) : ER(ER_YES));
90
 
    return true;
 
89
    return false;
91
90
  }
92
 
  return false;
 
91
  return true;
93
92
}
94
93
 
95
94
} /* namespace drizzled */