From c0a2fe9c974b51e7495d0598a925c07744d895de Mon Sep 17 00:00:00 2001
From: Stef Walter <stef@thewalter.net>
Date: Mon, 8 Jul 2013 18:30:16 +0200
Subject: trust: Support token directory paths in user's home directory

---
 trust/module.c | 1 +
 trust/token.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'trust')

diff --git a/trust/module.c b/trust/module.c
index d2fcba6..25a72b7 100644
--- a/trust/module.c
+++ b/trust/module.c
@@ -195,6 +195,7 @@ create_tokens_inlock (p11_array *tokens,
 		const char *prefix;
 		const char *label;
 	} labels[] = {
+		{ "~/", "User Trust" },
 		{ DATADIR, "Default Trust" },
 		{ SYSCONFDIR, "System Trust" },
 		{ NULL },
diff --git a/trust/token.c b/trust/token.c
index 77ff739..ca24762 100644
--- a/trust/token.c
+++ b/trust/token.c
@@ -643,7 +643,7 @@ p11_token_new (CK_SLOT_ID slot,
 	token->loaded = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, free);
 	return_val_if_fail (token->loaded != NULL, NULL);
 
-	token->path = strdup (path);
+	token->path = p11_path_expand (path);
 	return_val_if_fail (token->path != NULL, NULL);
 
 	token->anchors = p11_path_build (token->path, "anchors", NULL);
-- 
cgit v1.1