- Set supplementary groups when dropping privileges - Show more descriptive error messages on missing files errors - Create /usr/libexec/keylime directory Related: rhbz#2084552 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
From e20b936fc9d92ae05406cb86471d3e6fba823b7f Mon Sep 17 00:00:00 2001
|
|
From: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
Date: Tue, 28 Jun 2022 13:47:38 +0200
|
|
Subject: [PATCH] main: Use more descriptive message for missing files error
|
|
|
|
Use more descriptive message when required paths are missing instead of
|
|
the generic message.
|
|
|
|
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
---
|
|
src/main.rs | 19 ++++++++++++++++---
|
|
1 file changed, 16 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/main.rs b/src/main.rs
|
|
index 9404284..ef29eb2 100644
|
|
--- a/src/main.rs
|
|
+++ b/src/main.rs
|
|
@@ -608,9 +608,22 @@ async fn main() -> Result<()> {
|
|
let payload = Arc::clone(&encr_payload_arc);
|
|
|
|
let revocation_cert = revocation::get_revocation_cert_path(&config)?;
|
|
- let actions_dir =
|
|
- Path::new(&config.revocation_actions_dir).canonicalize()?;
|
|
- let work_dir = Path::new(&config.work_dir).canonicalize()?;
|
|
+ let actions_dir = Path::new(&config.revocation_actions_dir)
|
|
+ .canonicalize()
|
|
+ .map_err(|e| {
|
|
+ Error::Configuration(format!(
|
|
+ "Path {} set in revocation_actions_dir not found: {}",
|
|
+ &config.revocation_actions_dir, e
|
|
+ ))
|
|
+ })?;
|
|
+
|
|
+ let work_dir =
|
|
+ Path::new(&config.work_dir).canonicalize().map_err(|e| {
|
|
+ Error::Configuration(format!(
|
|
+ "Path {} set in keylime_dir not found: {}",
|
|
+ &config.work_dir, e
|
|
+ ))
|
|
+ })?;
|
|
|
|
let quotedata = web::Data::new(QuoteData {
|
|
tpmcontext: Mutex::new(ctx),
|