summaryrefslogtreecommitdiff
path: root/trust/token.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/token.c')
-rw-r--r--trust/token.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/trust/token.c b/trust/token.c
index df6f727..4cbcc77 100644
--- a/trust/token.c
+++ b/trust/token.c
@@ -817,7 +817,8 @@ p11_token_free (p11_token *token)
p11_token *
p11_token_new (CK_SLOT_ID slot,
const char *path,
- const char *label)
+ const char *label,
+ int flags)
{
p11_token *token;
@@ -859,6 +860,12 @@ p11_token_new (CK_SLOT_ID slot,
token->slot = slot;
+ if (flags & P11_TOKEN_FLAG_WRITE_PROTECTED) {
+ token->checked_path = true;
+ token->make_directory = false;
+ token->is_writable = false;
+ }
+
load_builtin_objects (token);
p11_debug ("token: %s: %s", token->label, token->path);