-
Notifications
You must be signed in to change notification settings - Fork 154
/
pull.h
42 lines (33 loc) · 1.04 KB
/
pull.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef PAM_PULL_H
#define PAM_PULL_H
#include <security/pam_appl.h>
#include <jansson.h>
// struct File represents a JSON file.
struct File {
char *name;
json_t *contents;
};
// struct EnvVar represents an environment variable.
struct EnvVar {
char *name;
char *value;
};
// struct PullResponses holds data collected from the sytem.
struct PullResponses {
int file_count;
struct File *files;
int env_var_count;
struct EnvVar *env_vars;
};
// engine_pull communicates with the policy engine to determine what to pull
// from the sytem. It performs the required operations, and stores data
// collected from the user in *pull_reponses_ptr.
//
// free_pull_responses should be called when this data is no longer required.
extern void
engine_pull(const char *url, struct PullResponses *pull_responses_ptr);
// free_pull_responses ensures that all allocated data within
// *pull_responses_ptr is freed. *pull_responses_ptr itself is not freed.
extern void
free_pull_responses(struct PullResponses *pull_responses_ptr);
#endif