RHEL-15308 cupsd fails to open cups-files.conf and the resulting error message is lost

Resolves: RHEL-15308
This commit is contained in:
Zdenek Dohnal 2023-11-02 15:26:17 +01:00
parent bb06a744a8
commit a61678a79e
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From db9cecdd932e58c51d2d659f63415ad47d151717 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Fri, 1 Sep 2023 17:11:54 +0200
Subject: [PATCH] scheduler/conf.c: Print to stderr if we don't open
cups-files.conf
In case cupsd can't open the cups-files.conf, the error message is lost
if journal and syslog don't exist or work on system (usually in
containers).
Log the error into stderr at this place to get the error message if
needed.
---
scheduler/conf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/scheduler/conf.c b/scheduler/conf.c
index b18535162..4fa7eb1df 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -811,11 +811,7 @@ cupsdReadConfiguration(void)
cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile);
else
{
-#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
- sd_journal_print(LOG_ERR, "Unable to open \"%s\" - %s", CupsFilesFile, strerror(errno));
-#else
- syslog(LOG_LPR, "Unable to open \"%s\" - %s", CupsFilesFile, strerror(errno));
-#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
+ fprintf(stderr, "Unable to read \"%s\" - %s\n", CupsFilesFile, strerror(errno));
return (0);
}
--
2.41.0

View File

@ -128,6 +128,8 @@ Patch35: 0001-cups-strlcpy-handle-zero-size.patch
Patch36: 0001-Require-authentication-for-CUPS-Get-Document.patch Patch36: 0001-Require-authentication-for-CUPS-Get-Document.patch
# RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off" # RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off"
Patch37: cups-preservejobfiles-leak.patch Patch37: cups-preservejobfiles-leak.patch
# RHEL-15308 cupsd fails to open cups-files.conf and the resulting error message is lost
Patch38: 0001-scheduler-conf.c-Print-to-stderr-if-we-don-t-open-cu.patch
##### Patches removed because IMHO they aren't no longer needed ##### Patches removed because IMHO they aren't no longer needed
@ -385,6 +387,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in
%patch36 -p1 -b .get-document-auth %patch36 -p1 -b .get-document-auth
# RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off" # RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off"
%patch37 -p1 -b .preservejobfiles-leak %patch37 -p1 -b .preservejobfiles-leak
# RHEL-15308 cupsd fails to open cups-files.conf and the resulting error message is lost
%patch38 -p1 -b .log-stderr
%if %{lspp} %if %{lspp}
# LSPP support. # LSPP support.
@ -821,6 +825,7 @@ rm -f %{cups_serverbin}/backend/smb
%changelog %changelog
* Thu Nov 02 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-22 * Thu Nov 02 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-22
- RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off" - RHEL-14931 cupsd memory leak in cupsdDeleteJob() with "PreserveJobHistory Off"
- RHEL-15308 cupsd fails to open cups-files.conf and the resulting error message is lost
* Tue Aug 29 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-21 * Tue Aug 29 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-21
- bump the spec because the previous build was made with buildroot 9.2 - bump the spec because the previous build was made with buildroot 9.2