Skip to content

Commit

Permalink
Merge pull request #2875 from didier-wenzek/fix/panic-on-unknown-user
Browse files Browse the repository at this point in the history
Do not panic changing ownership of device cert to unknown user
  • Loading branch information
didier-wenzek authored May 14, 2024
2 parents dfe6e0a + 1893d1f commit 7cf3830
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/core/tedge/src/cli/connect/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use tedge_config::*;
use tedge_utils::paths::create_directories;
use tedge_utils::paths::ok_if_not_found;
use tedge_utils::paths::DraftFile;
use tracing::warn;
use which::which;

use crate::bridge::AWS_CONFIG_FILENAME;
Expand Down Expand Up @@ -565,8 +566,9 @@ fn restart_mosquitto(
&bridge_config.bridge_certfile,
&bridge_config.bridge_keyfile,
] {
// TODO maybe ignore errors here
tedge_utils::file::change_user_and_group(path.as_ref(), user, group).unwrap();
if let Err(err) = tedge_utils::file::change_user_and_group(path.as_ref(), user, group) {
warn!("Failed to change ownership of {path} to {user}:{group}: {err}");
}
}

if let Err(err) = service_manager.restart_service(SystemService::Mosquitto) {
Expand Down

0 comments on commit 7cf3830

Please sign in to comment.