~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_pam/auth_pam.cc

  • Committer: Brian Aker
  • Date: 2010-10-28 17:12:01 UTC
  • mfrom: (1887.1.3 merge)
  • Revision ID: brian@tangent.org-20101028171201-baj6l1bnntn1s4ad
Merge in POTFILES changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
29
29
#include <security/pam_misc.h>
30
30
#endif
31
31
 
32
 
#include "drizzled/identifier.h"
 
32
#include "drizzled/security_context.h"
33
33
#include "drizzled/plugin/authentication.h"
34
34
 
35
35
using namespace drizzled;
106
106
public:
107
107
  Auth_pam(std::string name_arg)
108
108
    : drizzled::plugin::Authentication(name_arg) {}
109
 
  virtual bool authenticate(const identifier::User &sctx,
 
109
  virtual bool authenticate(const SecurityContext &sctx,
110
110
                            const std::string &password)
111
111
  {
112
112
    int retval;
114
114
    struct pam_conv conv_info= { &auth_pam_talker, (void*)&userinfo };
115
115
    pam_handle_t *pamh= NULL;
116
116
 
117
 
    userinfo.name= sctx.username().c_str();
 
117
    userinfo.name= sctx.getUser().c_str();
118
118
    userinfo.password= password.c_str();
119
119
 
120
120
    retval= pam_start("drizzle", userinfo.name, &conv_info, &pamh);
150
150
  "PAM based authenication.",
151
151
  PLUGIN_LICENSE_GPL,
152
152
  initialize, /* Plugin Init */
153
 
  NULL,   /* depends */
 
153
  NULL,   /* system variables */
154
154
  NULL    /* config options */
155
155
}
156
156
DRIZZLE_DECLARE_PLUGIN_END;