diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2018-12-23 00:59:55 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2018-12-27 23:29:30 +0100 |
commit | 773e4896521ccf29ab040f977a3faaadd805c8d8 (patch) | |
tree | 422e3eeb9ee8f5693592f56e56c382304031bccb /vcl | |
parent | 6bd1f8b75046de52eed5eea901603b090937ee71 (diff) |
tdf#122116 Only create CPDManager if D-Bus descriptions present
Since the XML files are required in the
'onNameAcquired()' method, check for their existence
before returning a CPDManager pointer in
'tryLoadCPD()', to avoid returning a CPDManager
that is unusable (and will even lead to a crash).
Change-Id: I83c493ba8bd775ea398111971cbecb9352050194
Reviewed-on: https://gerrit.libreoffice.org/65576
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 87d90b6e60659e9c976daa9692ae99ec87a6978c)
Reviewed-on: https://gerrit.libreoffice.org/65634
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/printer/cpdmgr.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx index aedcd5b42543..c9908ae27204 100644 --- a/vcl/unx/generic/printer/cpdmgr.cxx +++ b/vcl/unx/generic/printer/cpdmgr.cxx @@ -250,6 +250,12 @@ CPDManager* CPDManager::tryLoadCPD() static const char* pEnv = getenv("SAL_DISABLE_CPD"); if (!pEnv || !*pEnv) { + // interface description XML files are needed in 'onNameAcquired()' + if (!g_file_test(FRONTEND_INTERFACE, G_FILE_TEST_IS_REGULAR) || + !g_file_test(BACKEND_INTERFACE, G_FILE_TEST_IS_REGULAR)) { + return nullptr; + } + GDir *dir; const gchar *filename; dir = g_dir_open(BACKEND_DIR, 0, nullptr); |