Bug 146869 - LibreOffice connects to the print server (CUPS) when opening a document with PrinterName config-item
Summary: LibreOffice connects to the print server (CUPS) when opening a document with ...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.3.0.2 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-20 03:05 UTC by Vincent Lefevre
Modified: 2025-11-28 03:41 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
testcase (15.02 KB, application/vnd.oasis.opendocument.text)
2022-01-20 03:05 UTC, Vincent Lefevre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lefevre 2022-01-20 03:05:50 UTC
Created attachment 177663 [details]
testcase

When I open some document such as the one attached, LibreOffice tries to connect to the print server, while I don't intend to print the document. This can yield a timeout of 20 - 30 seconds if the print server isn't available or request a password. There are also potential privacy/security issues.

This issue seems to come from

<config:config-item config:name="PrinterName" config:type="string">Generic Printer</config:config-item>

in settings.xml.

The Debian bugs I had reported:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=428064 (2007, OpenOffice.Org)
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708533 (2013, LibreOffice)
Comment 1 Vincent Lefevre 2022-01-20 03:17:15 UTC
I forgot: to reproduce the timeout, create a /etc/cups/client.conf file with a line like

ServerName 192.168.0.2:443

(check with telnet that the connection hangs, or choose another IP address).
Comment 2 QA Administrators 2025-11-27 11:28:39 UTC Comment hidden (obsolete)
Comment 3 Vincent Lefevre 2025-11-27 13:26:21 UTC
The bug is still present under Debian/unstable:

Version: 25.8.3.2 (X86_64) / LibreOffice Community
Build ID: 580(Build:2)
CPU threads: 12; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: en-US (C.UTF-8); UI: en-US
Debian package version: 4:25.8.3-1+b1
Calc: threaded

To reproduce:

1. Execute "mv ~/.cups ~/cups.bak" (in case there is an existing user CUPS configuration).
2. Create a /etc/cups/client.conf or ~/.cups/client.conf file with the line "ServerName 192.168.0.2:443" (or another address, which should no belong to the local network).
3. Check that "lpq" hangs.
4. Run "libreoffice printername-bug.odt", where printername-bug.odt is the testcase I had attached in 2022.

Result: LibreOffice hangs.

With "strace -f", I can see:

197212 connect(19, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("192.168.0.2")}, 16 <unfinished ...>