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

« back to all changes in this revision

Viewing changes to plugin/auth_pam/auth_pam.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-11-12 12:26:01 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101112122601-myppfj3tfmlkccuq
Tags: upstream-2010.11.03
ImportĀ upstreamĀ versionĀ 2010.11.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
    userinfo.name= sctx.getUser().c_str();
118
118
    userinfo.password= password.c_str();
119
119
 
120
 
    retval= pam_start("check_user", userinfo.name, &conv_info, &pamh);
 
120
    retval= pam_start("drizzle", userinfo.name, &conv_info, &pamh);
121
121
 
122
122
    if (retval == PAM_SUCCESS)
123
123
      retval= pam_authenticate(pamh, PAM_DISALLOW_NULL_AUTHTOK);
134
134
 
135
135
static Auth_pam *auth= NULL;
136
136
 
137
 
static int initialize(drizzled::plugin::Registry &registry)
 
137
static int initialize(drizzled::module::Context &context)
138
138
{
139
139
  auth= new Auth_pam("auth_pam");
140
 
  registry.add(auth);
141
 
  return 0;
142
 
}
143
 
 
144
 
static int finalize(drizzled::plugin::Registry &registry)
145
 
{
146
 
 
147
 
  if (auth)
148
 
  {
149
 
    registry.remove(auth);
150
 
    delete auth;
151
 
  }
152
 
 
 
140
  context.add(auth);
153
141
  return 0;
154
142
}
155
143
 
162
150
  "PAM based authenication.",
163
151
  PLUGIN_LICENSE_GPL,
164
152
  initialize, /* Plugin Init */
165
 
  finalize, /* Plugin Deinit */
166
153
  NULL,   /* system variables */
167
154
  NULL    /* config options */
168
155
}