plasma5 session saving is broken
Andriy Gapon
avg at FreeBSD.org
Wed Nov 13 10:52:29 GMT 2024
On 06/11/2024 09:24, Andriy Gapon wrote:
>
> Session restore options "On last logout" and "When session was manually saved"
> do not work at the moment for Plasma 5.
> They got broken some months ago and still don't work.
> Plasma always starts with an empty session (plus auto-start).
>
> The problem seems to be related to writing iceauth file.
>
> It seems that there is a fix (committed after 5.27.11.1 ), but there hasn't been
> a release since then.
> The fix is quite small and trivial.
> Maybe it would be good to add it as a patch to x11/plasma5-plasma-workspace.
>
> References:
> - https://bugs.kde.org/show_bug.cgi?id=487912
> - https://bugs.kde.org/show_bug.cgi?id=488520
> - https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4405/diffs?
> commit_id=e109503c8ee12866ecfbd3aaf89170a753f2ea84
> - https://invent.kde.org/plasma/plasma-workspace/-/
> commit/1181acfe30557d6646511df8d98d82589878a570
> - https://kde.org/info/security/advisory-20240531-1.txt
The patch at the end of this email is created from the above changes and it
fixes the problem for me.
Would this email be enough to add the patch to the port?
Or would it be better to open a PR?
> Just in case, timeline for 5.27:
> - May 31, 2024, the bug is introduced in 10a7ddd0
> - 5.27.11.1 is released as a security fix for CVE-2024-36041
> - Jun 04, 2024, the bug fix is committed in 1181acfe
======= x11/plasma5-plasma-workspace/files/patch-ksmserver-ice-auth =======
--- ksmserver/server.cpp
+++ ksmserver/server.cpp
@@ -333,7 +333,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);
@@ -357,7 +357,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);
@@ -366,6 +366,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);
}
--
Andriy Gapon
More information about the kde-freebsd
mailing list