diff options
Diffstat (limited to 'p11p-daemon/src/p11p_config.erl')
-rw-r--r-- | p11p-daemon/src/p11p_config.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/p11p-daemon/src/p11p_config.erl b/p11p-daemon/src/p11p_config.erl index 23b79bb..6c4cfb6 100644 --- a/p11p-daemon/src/p11p_config.erl +++ b/p11p-daemon/src/p11p_config.erl @@ -6,7 +6,7 @@ %%-export([config/0]). -export([nameof/1]). -export([tokens/0]). --export([modules_for_token/1, module_path/1, token_mode/1]). +-export([remotebin_path/0, modules_for_token/1, module_path/1, token_mode/1]). -export_type([token_mode_t/0]). %% Genserver callbacks. @@ -31,6 +31,7 @@ %% Genserver state. -record(state, { + remotebin_path :: string(), tokens :: #{string() => token()} }). @@ -42,6 +43,9 @@ start_link() -> %% config() -> %% gen_server:call(?MODULE, config). +remotebin_path() -> + gen_server:call(?MODULE, remotebin_path). + -spec tokens() -> [token()]. tokens() -> gen_server:call(?MODULE, tokens). @@ -73,6 +77,8 @@ init(_Args) -> %% handle_call(config, _From, State) -> %% {reply, State, State}; +handle_call(remotebin_path, _From, #state{remotebin_path = Path} = State) -> + {reply, Path, State}; handle_call(tokens, _From, #state{tokens = Tokens} = State) -> {reply, maps:values(Tokens), State}; handle_call({modules_for_token, TokName}, _, #state{tokens = Tokens} = S) -> @@ -104,6 +110,8 @@ code_change(_OldVersion, State, _Extra) -> init_state() -> #state { + remotebin_path = application:get_env(p11p, remotebin_path, + "/usr/local/libexec/p11-kit/p11-kit-remote"), tokens = conf_tokens(application:get_env(p11p, groups, [])) }. |