summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-03-22 17:19:49 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-03-24 13:49:39 +0000
commit4107bb21a3e9734f4c12832d1fd465075bec16cb (patch)
treef0a49a3f62de9f00f7d1856b6ecfd9f0706326de
parent35a46563b9cfe87a76ad5e637d77c37e4286bb62 (diff)
rhbz#2171265 Filter out all non *.rdb files
In that rhbz issue ("Libreoffice cannot start"), it looks like some junk file named /usr/lib64/libreoffice/program/services/services.rdb;63ddcd86 caused soffice.bin to crash early, without any information (cf. a1faf14f74a62ea76141115538d7d30d90c9eeb6 "rhbz#2171265 Report fatal InitApplicationServiceManager failures more reliably"). So, following up on b8c7548527f5fc14fe8fcbe74a749c7e3c10d385 "ignore backup files in services/ directory to avoid debugging grief", extend the set of ignored files to anything starting with "." or not ending in ".rdb" (in any case). Change-Id: I154750465d2128b3ff6493f4ab606072dda61503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149328 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit feb8b04a0ee86b0146a17393da220ae188babda8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149436 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149499
-rw-r--r--cppuhelper/source/paths.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx
index ece7650ded4c..dd8fe56df2bf 100644
--- a/cppuhelper/source/paths.cxx
+++ b/cppuhelper/source/paths.cxx
@@ -99,9 +99,11 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, OUString * url) {
"Cannot stat in directory");
}
if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
- // Ignore backup files:
+ // Ignore backup and spurious junk files:
OUString name(stat.getFileName());
- if (!(name.match(".") || name.endsWith("~"))) {
+ if (name.match(".") || !name.endsWithIgnoreAsciiCase(u".rdb")) {
+ SAL_WARN("cppuhelper", "ignoring <" << stat.getFileURL() << ">");
+ } else {
*url = stat.getFileURL();
return true;
}