diff options
author | Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2021-05-06 16:22:34 +0300 |
---|---|---|
committer | Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2021-05-06 17:18:07 +0300 |
commit | cf73c528b695ffff93523722b2ec9f40e81bd98b (patch) | |
tree | 03e12392cb88f49d0d1f5297d41baac8aa8fc1a1 /src/state | |
parent | c78bf93d62126d1e777f4f72322290b40f0121f4 (diff) | |
download | virtual-media-cf73c528b695ffff93523722b2ec9f40e81bd98b.tar.xz |
Change log level to Info
Due to security reasons "user/username" has to be removed from the
information that is logged by application.
Sensitive data has been moved to "Debug"" level (lowest one) and default
one has moved one level up to "Info".
Also some important information allowing to catch basic errors has been
upgraded to "Info".
Tested:
Manually, mounting both Legacy mode remote types (HTTPs and CIFS) and
checking if journal for VirtualMedia service does not contain sensitive
information.
Change-Id: Ie6c3a79c94637e3632af76daf957e986b2dd3b6d
Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
Diffstat (limited to 'src/state')
-rw-r--r-- | src/state/activating_state.cpp | 10 | ||||
-rw-r--r-- | src/state/deactivating_state.hpp | 8 | ||||
-rw-r--r-- | src/state/initial_state.hpp | 5 |
3 files changed, 12 insertions, 11 deletions
diff --git a/src/state/activating_state.cpp b/src/state/activating_state.cpp index 15d7214..8101df9 100644 --- a/src/state/activating_state.cpp +++ b/src/state/activating_state.cpp @@ -79,14 +79,14 @@ std::unique_ptr<BasicState> ActivatingState::activateProxyMode() std::unique_ptr<BasicState> ActivatingState::activateLegacyMode() { - LogMsg(Logger::Debug, machine.getName(), + LogMsg(Logger::Info, machine.getName(), " Mount requested on address: ", machine.getTarget()->imgUrl, " ; RW: ", machine.getTarget()->rw); std::filesystem::path socketPath(machine.getConfig().unixSocket); if (!std::filesystem::exists(socketPath.parent_path())) { - LogMsg(Logger::Debug, machine.getName(), + LogMsg(Logger::Info, machine.getName(), " Parent path for the socket does not exist, ", socketPath.parent_path()); @@ -94,7 +94,7 @@ std::unique_ptr<BasicState> ActivatingState::activateLegacyMode() std::filesystem::create_directories(socketPath.parent_path(), errc); if (errc) { - LogMsg(Logger::Debug, machine.getName(), + LogMsg(Logger::Error, machine.getName(), " Failed to create parent directory for socket", errc); return std::make_unique<ReadyState>( machine, static_cast<std::errc>(errc.value()), @@ -104,7 +104,7 @@ std::unique_ptr<BasicState> ActivatingState::activateLegacyMode() std::filesystem::perms::owner_all, errc); if (errc) { - LogMsg(Logger::Debug, machine.getName(), + LogMsg(Logger::Info, machine.getName(), " Failed to set parent directory permissions for socket", errc); return std::make_unique<ReadyState>( @@ -138,7 +138,7 @@ std::unique_ptr<BasicState> ActivatingState::mountSmbShare() auto remoteParent = "/" + remote.parent_path().string(); auto localFile = mountDir->getPath() / remote.filename(); - LogMsg(Logger::Debug, machine.getName(), " Remote name: ", remote, + LogMsg(Logger::Info, machine.getName(), " Remote name: ", remote, "\n Remote parent: ", remoteParent, "\n Local file: ", localFile); diff --git a/src/state/deactivating_state.hpp b/src/state/deactivating_state.hpp index 0ad6f5b..57f1072 100644 --- a/src/state/deactivating_state.hpp +++ b/src/state/deactivating_state.hpp @@ -49,18 +49,20 @@ struct DeactivatingState : public BasicStateT<DeactivatingState> } template <class AnyEvent> - [[noreturn]] std::unique_ptr<BasicState> handleEvent(AnyEvent event) { + [[noreturn]] std::unique_ptr<BasicState> handleEvent(AnyEvent event) + { LogMsg(Logger::Error, "Invalid event: ", event.eventName); throw sdbusplus::exception::SdBusError(EBUSY, "Resource is busy"); } - private : std::unique_ptr<BasicState> evaluate() + private: + std::unique_ptr<BasicState> evaluate() { if (udevStateChangeEvent && subprocessStoppedEvent) { if (udevStateChangeEvent->devState == StateChange::removed) { - LogMsg(Logger::Debug, machine.getName(), + LogMsg(Logger::Info, machine.getName(), " udev StateChange::removed"); } else diff --git a/src/state/initial_state.hpp b/src/state/initial_state.hpp index 24a95d8..7fcc10b 100644 --- a/src/state/initial_state.hpp +++ b/src/state/initial_state.hpp @@ -198,7 +198,6 @@ struct InitialState : public BasicStateT<InitialState> { if (s->error) { - LogMsg(Logger::Error, s->error->message.c_str()); throw sdbusplus::exception::SdBusError( static_cast<int>(s->error->code), s->error->message.c_str()); @@ -208,7 +207,7 @@ struct InitialState : public BasicStateT<InitialState> } if (machine.getState().get_if<ActiveState>()) { - LogMsg(Logger::Debug, "[App] Mount ok"); + LogMsg(Logger::Info, "[App] Mount ok"); return true; } boost::system::error_code ignored_ec; @@ -284,7 +283,7 @@ struct InitialState : public BasicStateT<InitialState> { machine.getTarget()->credentials.reset(); } - LogMsg(Logger::Debug, "[App]: mount completed ", ret); + LogMsg(Logger::Info, "[App]: mount completed ", ret); return ret; } catch (const std::exception& e) |