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
1=== modified file 'plugin/auth_file/auth_file.cc'
2--- plugin/auth_file/auth_file.cc 2010-06-23 20:51:16 +0000
3+++ plugin/auth_file/auth_file.cc 2010-08-15 16:11:42 +0000
4@@ -28,7 +28,11 @@
5 #include "drizzled/security_context.h"
6 #include "drizzled/util/convert.h"
7 #include "drizzled/algorithm/sha1.h"
8+#include <boost/program_options.hpp>
9+#include <drizzled/module/option_map.h>
10+#include <iostream>
11
12+namespace po= boost::program_options;
13 using namespace std;
14 using namespace drizzled;
15
16@@ -208,6 +212,13 @@
17
18 static int init(module::Context &context)
19 {
20+ const module::option_map &vm= context.getOptions();
21+
22+ if (vm.count("users"))
23+ {
24+ users_file= const_cast<char *>(vm["users"].as<string>().c_str());
25+ }
26+
27 AuthFile *auth_file = new AuthFile("auth_file");
28 if (!auth_file->loadFile())
29 {
30@@ -235,6 +246,13 @@
31 NULL
32 };
33
34+static void init_options(drizzled::module::option_context &context)
35+{
36+ context("users",
37+ po::value<string>()->default_value(DEFAULT_USERS_FILE),
38+ N_("File to load for usernames and passwords"));
39+}
40+
41 } /* namespace auth_file */
42
43-DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, NULL);
44+DRIZZLE_PLUGIN(auth_file::init, auth_file::sys_variables, auth_file::init_options);
45
46=== modified file 'plugin/auth_file/tests/t/basic-master.opt'
47--- plugin/auth_file/tests/t/basic-master.opt 2010-06-19 19:28:47 +0000
48+++ plugin/auth_file/tests/t/basic-master.opt 2010-08-15 16:11:42 +0000
49@@ -1,1 +1,1 @@
50---plugin-add=auth_file --auth-file-users=$TOP_SRCDIR/plugin/auth_file/tests/t/basic.users
51+--plugin-add=auth_file --auth-file.users=$TOP_SRCDIR/plugin/auth_file/tests/t/basic.users