From e5c8c996d5e8755553f9004c1ed813e5f43ede31 Mon Sep 17 00:00:00 2001 From: Antoine POPINEAU Date: Fri, 17 May 2024 12:46:04 +0200 Subject: [PATCH] Never unpack greetd error and display them on screen or in logs. --- src/ipc.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ipc.rs b/src/ipc.rs index ce1ec63..2741de9 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -69,7 +69,11 @@ impl Ipc { } async fn parse_response(&mut self, greeter: &mut Greeter, response: Response) -> Result<(), Box> { - tracing::info!("received greetd message: {:?}", response); + // Do not display actual message from greetd, which may contain entered information, sometimes passwords. + match response { + Response::Error { ref error_type, .. } => tracing::info!("received greetd error message: {error_type:?}"), + ref response => tracing::info!("received greetd message: {:?}", response), + } match response { Response::AuthMessage { auth_message_type, auth_message } => match auth_message_type { @@ -190,8 +194,9 @@ impl Ipc { } } - Response::Error { error_type, description } => { - tracing::info!("received an error from greetd: {error_type:?} - {description}"); + Response::Error { error_type, .. } => { + // Do not display actual message from greetd, which may contain entered information, sometimes passwords. + tracing::info!("received an error from greetd: {error_type:?}"); Ipc::cancel(greeter).await; @@ -207,7 +212,8 @@ impl Ipc { } ErrorType::Error => { - greeter.message = Some(description); + // Do not display actual message from greetd, which may contain entered information, sometimes passwords. + greeter.message = Some("An error was received from greetd".to_string()); greeter.reset(false).await; } }