abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change
on this file since 15200be was
15200be,
checked in by Mike Ryan <mikeryan@…>, 14 years ago
|
move libabac into its own directory
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #include <err.h> |
---|
2 | #include <stdio.h> |
---|
3 | |
---|
4 | #include "abac.h" |
---|
5 | #include "abac_util.h" |
---|
6 | |
---|
7 | int main(int argc, char **argv) { |
---|
8 | int i, success; |
---|
9 | abac_credential_t *cred; |
---|
10 | |
---|
11 | if (argc < 2) |
---|
12 | errx(1, "Usage: %s <keystore>", argv[0]); |
---|
13 | |
---|
14 | libabac_init(); |
---|
15 | |
---|
16 | abac_context_t *ctx = abac_context_new(); |
---|
17 | abac_context_load_directory(ctx, argv[1]); |
---|
18 | |
---|
19 | debug_printf("querying\n"); |
---|
20 | |
---|
21 | abac_credential_t **credentials = abac_context_query(ctx, |
---|
22 | "3f1aca4c5911b345d81c5f1a77675dce13249d0c.fed_create", |
---|
23 | "5839d714b16bbe108642c5eb586c2173420bed19", |
---|
24 | &success |
---|
25 | ); |
---|
26 | |
---|
27 | if (success) |
---|
28 | puts("success"); |
---|
29 | |
---|
30 | if (credentials != NULL) |
---|
31 | for (i = 0; credentials[i] != NULL; ++i) { |
---|
32 | cred = credentials[i]; |
---|
33 | printf("credential %s <- %s\n", |
---|
34 | abac_role_string(abac_credential_head(cred)), |
---|
35 | abac_role_string(abac_credential_tail(cred)) |
---|
36 | ); |
---|
37 | } |
---|
38 | |
---|
39 | abac_context_query_free(credentials); |
---|
40 | |
---|
41 | abac_context_free(ctx); |
---|
42 | |
---|
43 | libabac_deinit(); |
---|
44 | |
---|
45 | return 0; |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.