From f5ec8a0250631e3654f8bb2d7b524cc13912d774 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 12 Mar 2025 13:19:04 +0100 Subject: [PATCH] backend/ipp.c: Raise alert if there is issue with cert Currently we show more detailed info about this error in debug logs, but since there are not many desktops to pick up our dBUS notification, it would be great to report it in CUPS log too. --- backend/ipp.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/ipp.c b/backend/ipp.c index 894f86536e..7b9f9496a1 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -800,12 +800,12 @@ main(int argc, /* I - Number of command-line args */ /* Trust keywords */ static const char * const trust_msgs[] = { - "Credentials are OK/trusted", - "Credentials are invalid", - "Credentials have changed", - "Credentials are expired", - "Credentials have been renewed", - "Credentials are unknown/new" + _("Credentials are OK/trusted."), + _("Credentials are invalid."), + _("Credentials have changed."), + _("Credentials are expired."), + _("Credentials have been renewed."), + _("Credentials are unknown/new.") }; fputs("DEBUG: Connection is encrypted.\n", stderr); @@ -820,19 +820,20 @@ main(int argc, /* I - Number of command-line args */ if ((lcreds = cupsCopyCredentials(NULL, hostname)) != NULL) { - cupsGetCredentialsInfo(lcreds, lcredinfo, sizeof(lcredinfo)); + cupsGetCredentialsInfo(lcreds, lcredinfo, sizeof(lcredinfo)); fprintf(stderr, "DEBUG: Stored credentials: %s\n", lcredinfo); } else { - fputs("DEBUG: No stored credentials.\n", stderr); + fputs("DEBUG: No stored credentials.\n", stderr); } update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown"); if (trusts[trust]) { - update_reasons(NULL, trusts[trust]); - return (CUPS_BACKEND_STOP); + update_reasons(NULL, trusts[trust]); + _cupsLangPrintFilter(stderr, "ALERT", "%s", trust_msgs[trust]); + return (CUPS_BACKEND_STOP); } /* -- 2.47.2