source: libabac/prover.c @ 55c272b

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since 55c272b was 55c272b, checked in by Mike Ryan <mikeryan@…>, 14 years ago

remove libabac_init and libabac_deinit

  • Property mode set to 100644
File size: 909 bytes
Line 
1#include <err.h>
2#include <stdio.h>
3
4#include <abac.h>
5
6#include "options.h"
7
8int main(int argc, char **argv) {
9    int i, success;
10    abac_credential_t *cred;
11
12    options_t opts = { 0, };
13    get_options(argc, argv, &opts);
14
15    abac_context_t *ctx = abac_context_new();
16    abac_context_load_directory(ctx, opts.keystore);
17
18    abac_credential_t **credentials = abac_context_query(ctx,
19        opts.role, opts.principal,
20        &success
21    );
22
23    if (success)
24        puts("success");
25
26    if (credentials != NULL)
27        for (i = 0; credentials[i] != NULL; ++i) {
28            cred = credentials[i];
29            printf("credential %s <- %s\n",
30                    abac_role_string(abac_credential_head(cred)),
31                    abac_role_string(abac_credential_tail(cred))
32                  );
33        }
34
35    abac_context_credentials_free(credentials);
36
37    abac_context_free(ctx);
38
39    return 0;
40}
Note: See TracBrowser for help on using the repository browser.