Skip to content

Commit 9dfb597

Browse files
committed
config: Align config locations with the python components
The python components expect the configuration files to be in /etc/keylime/*.conf and the configuration snippets to be in /etc/keylime/*.conf.d This patch modifies the paths where the configuration files are searched to align with the python components. In the case, the agent configuration will be installed in /etc/keylime/agent.conf and the snippets are searched in /etc/keylime/agent.conf.d/ Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
1 parent c0a2231 commit 9dfb597

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

GNUmakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ $(programs):
2727

2828
.PHONY: install
2929
install: all
30-
cp ${CONFFILE} /etc/${CONFFILE}
30+
mkdir -p /etc/keylime/
31+
mkdir -p /etc/keylime/agent.conf.d
32+
cp ${CONFFILE} /etc/keylime/agent.conf
3133
for f in $(programs); do \
3234
install -D -t ${DESTDIR}/usr/bin "$$f"; \
3335
done

src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ pub static DEFAULT_TPM_SIGNING_ALG: &str = "rsassa";
5858
pub static DEFAULT_EK_HANDLE: &str = "generate";
5959
pub static DEFAULT_RUN_AS: &str = "keylime:tss";
6060
pub static DEFAULT_AGENT_DATA_PATH: &str = "agent_data.json";
61-
pub static DEFAULT_CONFIG: &str = "/etc/keylime-agent.conf";
62-
pub static DEFAULT_CONFIG_SYS: &str = "/usr/etc/keylime-agent.conf";
61+
pub static DEFAULT_CONFIG: &str = "/etc/keylime/agent.conf";
62+
pub static DEFAULT_CONFIG_SYS: &str = "/usr/etc/keylime/agent.conf";
6363

6464
impl Source for KeylimeConfig {
6565
fn collect(&self) -> Result<Map<String, Value>, ConfigError> {
@@ -382,7 +382,7 @@ fn config_get_file_setting() -> Result<ConfigBuilder<DefaultState>, Error> {
382382
)
383383
// Add system configuration snippets
384384
.add_source(
385-
glob("/usr/etc/keylime-agent.conf.d/*")
385+
glob("/usr/etc/keylime/agent.conf.d/*")
386386
.map_err(Error::GlobPattern)?
387387
.filter_map(|entry| entry.ok())
388388
.map(|path| {
@@ -396,7 +396,7 @@ fn config_get_file_setting() -> Result<ConfigBuilder<DefaultState>, Error> {
396396
)
397397
// Add user configuration snippets
398398
.add_source(
399-
glob("/etc/keylime-agent.conf.d/*")
399+
glob("/etc/keylime/agent.conf.d/*")
400400
.map_err(Error::GlobPattern)?
401401
.filter_map(|entry| entry.ok())
402402
.map(|path| {

0 commit comments

Comments
 (0)