source: libabac/prover.c @ 0eb4a8e

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

load intersection edges into the graph

  • does not derive links
  • leaks memory
  • Property mode set to 100644
File size: 1017 bytes
RevLine 
[7f25a67f]1#include <err.h>
2#include <stdio.h>
3
[6ede88c]4#include <abac.h>
[7f25a67f]5
[7af34ed]6#include "options.h"
7
[7f25a67f]8int main(int argc, char **argv) {
[4e426c9]9    int i, success;
[401a054]10    abac_credential_t *cred;
[dc62c68]11
[7af34ed]12    options_t opts = { 0, };
13    get_options(argc, argv, &opts);
[7f25a67f]14
[7dd5f2e]15    libabac_init();
[7f25a67f]16
[390f749]17    abac_context_t *ctx = abac_context_new();
[7af34ed]18    abac_context_load_directory(ctx, opts.keystore);
[186cb75]19
[401a054]20    abac_credential_t **credentials = abac_context_query(ctx,
[7af34ed]21        opts.role, opts.principal,
[4e426c9]22        &success
[dc62c68]23    );
24
[4e426c9]25    if (success)
26        puts("success");
27
28    if (credentials != NULL)
29        for (i = 0; credentials[i] != NULL; ++i) {
30            cred = credentials[i];
[0eb4a8e]31            abac_role_t *tail = abac_credential_tail(cred);
[4e426c9]32            printf("credential %s <- %s\n",
33                    abac_role_string(abac_credential_head(cred)),
[0eb4a8e]34                    tail != NULL ? abac_role_string(tail) : "(null)"
[4e426c9]35                  );
36        }
37
[3c4fd68]38    abac_context_credentials_free(credentials);
[902d079]39
[390f749]40    abac_context_free(ctx);
[ea401bc]41
[7dd5f2e]42    libabac_deinit();
[186cb75]43
[7f25a67f]44    return 0;
45}
Note: See TracBrowser for help on using the repository browser.