[gnome-remote-desktop/gnome-42] session-rdp: Do not crash, when credentials are not set



commit 8d26e1f4badf555c18520fb0981660e85867b5c8
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Aug 2 06:31:52 2022 +0200

    session-rdp: Do not crash, when credentials are not set

 src/grd-session-rdp.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index 18c069ab..6bf34db0 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -2138,13 +2138,21 @@ grd_session_rdp_new (GrdRdpServer      *rdp_server,
   username = grd_settings_get_rdp_username (settings, &error);
   if (!username)
     {
-      g_warning ("Couldn't retrieve RDP username: %s", error->message);
+      if (error)
+        g_warning ("[RDP] Couldn't retrieve RDP username: %s", error->message);
+      else
+        g_message ("[RDP] Username is not set, denying client");
+
       return NULL;
     }
   password = grd_settings_get_rdp_password (settings, &error);
   if (!password)
     {
-      g_warning ("Couldn't retrieve RDP password: %s", error->message);
+      if (error)
+        g_warning ("[RDP] Couldn't retrieve RDP password: %s", error->message);
+      else
+        g_message ("[RDP] Password is not set, denying client");
+
       g_free (username);
       return NULL;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]