meiyap1
Last change
on this file since 6e73091 was
55c272b,
checked in by Mike Ryan <mikeryan@…>, 14 years ago
|
remove libabac_init and libabac_deinit
|
-
Property mode set to
100644
|
File size:
735 bytes
|
Line | |
---|
1 | #include <err.h> |
---|
2 | #include <stdio.h> |
---|
3 | #include <vector> |
---|
4 | |
---|
5 | #include <abac.hh> |
---|
6 | |
---|
7 | #include "options.h" |
---|
8 | |
---|
9 | using namespace ABAC; |
---|
10 | using std::vector; |
---|
11 | |
---|
12 | int main(int argc, char **argv) { |
---|
13 | int i; |
---|
14 | abac_credential_t *cred; |
---|
15 | |
---|
16 | options_t opts = { 0, }; |
---|
17 | get_options(argc, argv, &opts); |
---|
18 | |
---|
19 | Context ctx; |
---|
20 | ctx.load_directory(opts.keystore); |
---|
21 | |
---|
22 | bool success; |
---|
23 | vector<Credential> credentials = ctx.query( |
---|
24 | opts.role, opts.principal, |
---|
25 | success |
---|
26 | ); |
---|
27 | |
---|
28 | if (success) |
---|
29 | puts("success"); |
---|
30 | for (vector<Credential>::iterator i = credentials.begin(); i != credentials.end(); ++i) { |
---|
31 | printf("credential %s <- %s\n", |
---|
32 | i->head().string(), |
---|
33 | i->tail().string() |
---|
34 | ); |
---|
35 | } |
---|
36 | |
---|
37 | return 0; |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.