Bug#1069835: libreoffice-kf5: documents may get lost on SMB shares

2024-05-03 Thread Rene Engelhard

# splt up the LO and kio parts properly

clone 1069835 -1

reassign -1 kio

retitle -1 kio: Don't leak existing file handles to newly spanwed KIO 
workers


block 1069835 by -1

# LOs part is done, at least for this one.

close 1069835 4:24.2.2-1

thanks


Am 03.05.24 um 10:54 schrieb Andreas B. Mundt:

On Fri, May 03, 2024 at 10:18:22AM +0200, Sune Stolborg Vuorela wrote:

On Friday, May 3, 2024 10:06:27 AM CEST you wrote:

On Thu, May 02, 2024 at 04:37:30PM +0200, Sune Stolborg Vuorela wrote:

[…]

If it works for you, I'll ask the debian kde maintainers to fix it.


It looks like it fixes the libreoffice issue (no modifications applied
to libreoffice).  With a patched kio package I was not able to
reproduce the issue.  Replacing just the kio binary package seems to
be sufficient.  We are going to test a bit more on other setups too.

Tested with libreoffice from bookworm-backports:  Fixed.

Cool. So that means we don't even need the LO part here?

The changes needed to libreoffice are already in Debian ( https://
gerrit.libreoffice.org/c/core/+/162935 ) - also by Kevin Ottens who also
authored this patch.

Great!


Yes, that is the one mentioned earlier and fixed in 24.2.2.


Cleaning those bugs up and making an own one for kio.


Regards,


Rene



Processed (with 1 error): Re: Bug#1069835: libreoffice-kf5: documents may get lost on SMB shares

2024-05-03 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> # splt up the LO and kio parts properly
> clone 1069835 -1
Bug #1069835 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
Bug 1069835 cloned as bug 1070322
> reassign -1 kio
Bug #1070322 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
Bug reassigned from package 'libreoffice-kf5' to 'kio'.
No longer marked as found in versions libreoffice/4:7.4.7-1, 
libreoffice/4:24.2.3~rc1-3, and libreoffice/4:24.2.0-1.
Ignoring request to alter fixed versions of bug #1070322 to the same values 
previously set
> retitle -1 kio: Don't leak existing file handles to newly spanwed KIO
Bug #1070322 [kio] libreoffice-kf5: documents may get lost on SMB shares
Changed Bug title to 'kio: Don't leak existing file handles to newly spanwed 
KIO' from 'libreoffice-kf5: documents may get lost on SMB shares'.
> workers
Unknown command or malformed arguments to command.
> block 1069835 by -1
Bug #1069835 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
1069835 was not blocked by any bugs.
1069835 was not blocking any bugs.
Added blocking bug(s) of 1069835: 1070322
> # LOs part is done, at least for this one.
> close 1069835 4:24.2.2-1
Bug #1069835 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
Marked as fixed in versions libreoffice/4:24.2.2-1.
Bug #1069835 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
Marked Bug as done
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
1069835: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069835
1070322: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070322
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: Re: libreoffice-kf5: documents may get lost on SMB shares

2024-05-03 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + patch
Bug #1069835 [libreoffice-kf5] libreoffice-kf5: documents may get lost on SMB 
shares
Added tag(s) patch.

-- 
1069835: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069835
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#1069835: libreoffice-kf5: documents may get lost on SMB shares

2024-05-03 Thread Andreas B. Mundt
Control: tags -1 + patch


Hi Sune!

On Fri, May 03, 2024 at 10:18:22AM +0200, Sune Stolborg Vuorela wrote:
> On Friday, May 3, 2024 10:06:27 AM CEST you wrote:
> > On Thu, May 02, 2024 at 04:37:30PM +0200, Sune Stolborg Vuorela wrote:
> > > […]
> > >
> > > If it works for you, I'll ask the debian kde maintainers to fix it.
> > >
> > It looks like it fixes the libreoffice issue (no modifications applied
> > to libreoffice).  With a patched kio package I was not able to
> > reproduce the issue.  Replacing just the kio binary package seems to
> > be sufficient.  We are going to test a bit more on other setups too.

Tested with libreoffice from bookworm-backports:  Fixed.

> The changes needed to libreoffice are already in Debian ( https://
> gerrit.libreoffice.org/c/core/+/162935 ) - also by Kevin Ottens who also
> authored this patch.

Great!

> […]
>
> For the ark issue, you need the two kio patches I referenced in the bug report
> - also patches by Kevin Ottens
> https://invent.kde.org/frameworks/kio/-/commit/3e6800b37
> https://invent.kde.org/frameworks/kio/-/commit/48322f443

Attached is the slightly modified patch (only context, to apply cleanly).

Best regards,

  Andi
>From d1a2dab1da43d613ae5a8459ddcb62c8d78c46ff Mon Sep 17 00:00:00 2001
From: Kevin Ottens 
Date: Fri, 5 Jan 2024 11:51:49 +0100
Subject: [PATCH] Don't leak file descriptors when spawning new workers

By default we inherit file descriptors from the parent in
the worker process. This is a leak of resources since the
worker won't be able to do anything with them. Also, in
the case of CIFS this causes locks which might lead to bad
surprises in the parent process.
---

Index: kio-5.103.0/src/kioslave/kioslave.cpp
===
--- kio-5.103.0.orig/src/kioslave/kioslave.cpp
+++ kio-5.103.0/src/kioslave/kioslave.cpp
@@ -18,6 +18,10 @@
 #include 
 #include 
 
+#ifdef Q_OS_UNIX
+#include 
+#endif
+
 #ifdef Q_OS_WIN
 #include 
 #include 
@@ -40,6 +44,17 @@ extern "C" KIO::AuthInfo *_kioslave_init
 
 int main(int argc, char **argv)
 {
+#ifdef Q_OS_UNIX
+int max_fd = INT_MAX;
+struct rlimit limit;
+if (getrlimit(RLIMIT_NOFILE, ) == 0) {
+max_fd = limit.rlim_cur;
+}
+for (int fd = STDERR_FILENO + 1; fd < max_fd; fd++) {
+::close(fd);
+}
+#endif
+
 if (argc < 5) {
 fprintf(stderr, "Usage: kioslave5\n\nThis program is part of KDE.\n");
 return 1;