Merge lp:~vjsamuel/drizzle/rplugin-auth-file into lp:~drizzle-trunk/drizzle/development

Proposed by Vijay Samuel
Status: Merged
Approved by: Brian Aker
Approved revision: 1712
Merged at revision: 1713
Proposed branch: lp:~vjsamuel/drizzle/rplugin-auth-file
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 51 lines (+20/-2)
2 files modified
plugin/auth_file/auth_file.cc (+19/-1)
plugin/auth_file/tests/t/basic-master.opt (+1/-1)
To merge this branch: bzr merge lp:~vjsamuel/drizzle/rplugin-auth-file
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+32710@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugin/auth_file/auth_file.cc'
--- plugin/auth_file/auth_file.cc 2010-06-23 20:51:16 +0000
+++ plugin/auth_file/auth_file.cc 2010-08-15 16:11:42 +0000
@@ -28,7 +28,11 @@
28#include "drizzled/security_context.h"28#include "drizzled/security_context.h"
29#include "drizzled/util/convert.h"29#include "drizzled/util/convert.h"
30#include "drizzled/algorithm/sha1.h"30#include "drizzled/algorithm/sha1.h"
31#include <boost/program_options.hpp>
32#include <drizzled/module/option_map.h>
33#include <iostream>
3134
35namespace po= boost::program_options;
32using namespace std;36using namespace std;
33using namespace drizzled;37using namespace drizzled;
3438
@@ -208,6 +212,13 @@
208212
209static int init(module::Context &context)213static int init(module::Context &context)
210{214{
215 const module::option_map &vm= context.getOptions();
216
217 if (vm.count("users"))
218 {
219 users_file= const_cast<char *>(vm["users"].as<string>().c_str());
220 }
221
211 AuthFile *auth_file = new AuthFile("auth_file");222 AuthFile *auth_file = new AuthFile("auth_file");
212 if (!auth_file->loadFile())223 if (!auth_file->loadFile())
213 {224 {
@@ -235,6 +246,13 @@
235 NULL246 NULL
236};247};
237248
249static void init_options(drizzled::module::option_context &context)
250{
251 context("users",
252 po::value<string>()->default_value(DEFAULT_USERS_FILE),
253 N_("File to load for usernames and passwords"));
254}
255
238} /* namespace auth_file */256} /* namespace auth_file */
239257
240DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, NULL);258DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, auth_file::init_options);
241259
=== modified file 'plugin/auth_file/tests/t/basic-master.opt'
--- plugin/auth_file/tests/t/basic-master.opt 2010-06-19 19:28:47 +0000
+++ plugin/auth_file/tests/t/basic-master.opt 2010-08-15 16:11:42 +0000
@@ -1,1 +1,1 @@
1--plugin-add=auth_file --auth-file-users=$TOP_SRCDIR/plugin/auth_file/tests/t/basic.users1--plugin-add=auth_file --auth-file.users=$TOP_SRCDIR/plugin/auth_file/tests/t/basic.users