代码拉取完成,页面将自动刷新
同步操作将从 OpenCloudOS Stream/plasma-workspace 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Trnka?= <tomastrnka@gmx.com>
Date: Tue, 4 Jun 2024 09:36:34 +0200
Subject: [PATCH] Fix writing ICEAuthority file
Commit 9398f6cf8933055b31506ba155aef2fc2b3561d7 "Remove iceauth
dependency" introduced two bugs:
1) "fp" is never closed, so the generated auth data stays buffered in
memory for some indeterminate time and the file stays empty on disk.
This completely breaks authentication and thus also session restore.
2) Checking the return value of IceWriteAuthFileEntry() is inverted (the
function returns non-zero on success), so warnings are printed iff
everything goes well.
BUG: 487912
---
ksmserver/server.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index c5e0c7b372..4b0a8763c1 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -362,7 +362,7 @@ Status SetAuthentication(int count, IceListenObj *listenObjs, IceAuthDataEntry *
file_entry->auth_name = strdup("MIT-MAGIC-COOKIE-1");
file_entry->auth_data = strdup((*authDataEntries)[i].auth_data);
file_entry->auth_data_length = MAGIC_COOKIE_LEN;
- if (IceWriteAuthFileEntry(fp, file_entry) != 0) {
+ if (IceWriteAuthFileEntry(fp, file_entry) == 0) {
qWarning("Failed to write ice auth file entry");
}
IceFreeAuthFileEntry(file_entry);
@@ -386,7 +386,7 @@ Status SetAuthentication(int count, IceListenObj *listenObjs, IceAuthDataEntry *
file_entry->auth_name = strdup("MIT-MAGIC-COOKIE-1");
file_entry->auth_data = strdup((*authDataEntries)[i + 1].auth_data);
file_entry->auth_data_length = MAGIC_COOKIE_LEN;
- if (IceWriteAuthFileEntry(fp, file_entry) != 0) {
+ if (IceWriteAuthFileEntry(fp, file_entry) == 0) {
qWarning("Failed to write xsmp ice auth file entry");
}
IceFreeAuthFileEntry(file_entry);
@@ -395,6 +395,11 @@ Status SetAuthentication(int count, IceListenObj *listenObjs, IceAuthDataEntry *
IceSetPaAuthData(2, &(*authDataEntries)[i]);
}
+ if (fclose(fp) != 0) {
+ qWarning() << "Could not close ICEAuthority file";
+ return 0;
+ }
+
return (1);
}
--
GitLab
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。