Blob Blame History Raw
From 42dc9dc5865d26ba37ca3c07d3a97d4de03b7909 Mon Sep 17 00:00:00 2001
From: sinirajapan <87935975+sinirajapan@users.noreply.github.com>
Date: Thu, 29 Jul 2021 21:58:41 +0900
Subject: [PATCH] Update x-authority.c

No O_TRUNC causes the xauthority file corruption.
In case the address of XDMCP DISPLAY length differs.
---
 src/x-authority.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/x-authority.c b/src/x-authority.c
index baaf4bea4..a04f76a6d 100644
--- a/src/x-authority.c
+++ b/src/x-authority.c
@@ -320,7 +320,7 @@ x_authority_write (XAuthority *auth, XAuthWriteMode mode, const gchar *filename,
 
     /* Write records back */
     errno = 0;
-    int output_fd = g_open (filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
+    int output_fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC , S_IRUSR | S_IWUSR);
     if (output_fd < 0)
     {
         g_set_error (error,