v0.0.25 - Add --allow-all flag and short aliases for CLI options
This commit is contained in:
@@ -229,7 +229,7 @@ const char *enforce_strerror(int err);
|
||||
#define POLICY_MAX_ROLES 16
|
||||
#define POLICY_MAX_PURPOSES 8
|
||||
#define POLICY_VERB_MAX_LEN 32
|
||||
#define POLICY_CALLER_MAX_LEN 80
|
||||
#define POLICY_CALLER_MAX_LEN 160
|
||||
|
||||
/* Prompt behavior */
|
||||
typedef enum {
|
||||
@@ -390,7 +390,7 @@ typedef struct {
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
pid_t pid;
|
||||
char caller_id[80]; /* "uid:<n>" */
|
||||
char caller_id[POLICY_CALLER_MAX_LEN]; /* "uid:<n>" */
|
||||
} caller_identity_t;
|
||||
|
||||
/* Server context */
|
||||
@@ -527,6 +527,14 @@ int main(void) {
|
||||
check_condition("parse_preapprove_spec maps nonzero nostr_index role", strcmp(parsed.roles[0], "nostr_idx_2") == 0);
|
||||
check_condition("parse_preapprove_spec stores nonzero nostr_index", parsed_nostr_index == 2);
|
||||
|
||||
rc = parse_preapprove_spec("caller=qubes:personal+pubkey:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef,role=main",
|
||||
&parsed,
|
||||
&parsed_nostr_index);
|
||||
check_condition("parse_preapprove_spec accepts composite qubes+pubkey caller", rc == 0);
|
||||
check_condition("parse_preapprove_spec stores composite caller",
|
||||
strcmp(parsed.caller,
|
||||
"qubes:personal+pubkey:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef") == 0);
|
||||
|
||||
rc = parse_preapprove_spec("role=main", &parsed, &parsed_nostr_index);
|
||||
check_condition("parse_preapprove_spec rejects missing caller", rc == -1);
|
||||
rc = parse_preapprove_spec("caller=uid:1000", &parsed, &parsed_nostr_index);
|
||||
|
||||
Reference in New Issue
Block a user