Skip to content

Commit f5ec8a0

Browse files
committed
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.
1 parent 64780ad commit f5ec8a0

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

backend/ipp.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,12 @@ main(int argc, /* I - Number of command-line args */
800800
/* Trust keywords */
801801
static const char * const trust_msgs[] =
802802
{
803-
"Credentials are OK/trusted",
804-
"Credentials are invalid",
805-
"Credentials have changed",
806-
"Credentials are expired",
807-
"Credentials have been renewed",
808-
"Credentials are unknown/new"
803+
_("Credentials are OK/trusted."),
804+
_("Credentials are invalid."),
805+
_("Credentials have changed."),
806+
_("Credentials are expired."),
807+
_("Credentials have been renewed."),
808+
_("Credentials are unknown/new.")
809809
};
810810

811811
fputs("DEBUG: Connection is encrypted.\n", stderr);
@@ -820,19 +820,20 @@ main(int argc, /* I - Number of command-line args */
820820

821821
if ((lcreds = cupsCopyCredentials(NULL, hostname)) != NULL)
822822
{
823-
cupsGetCredentialsInfo(lcreds, lcredinfo, sizeof(lcredinfo));
823+
cupsGetCredentialsInfo(lcreds, lcredinfo, sizeof(lcredinfo));
824824
fprintf(stderr, "DEBUG: Stored credentials: %s\n", lcredinfo);
825825
}
826826
else
827827
{
828-
fputs("DEBUG: No stored credentials.\n", stderr);
828+
fputs("DEBUG: No stored credentials.\n", stderr);
829829
}
830830

831831
update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown");
832832
if (trusts[trust])
833833
{
834-
update_reasons(NULL, trusts[trust]);
835-
return (CUPS_BACKEND_STOP);
834+
update_reasons(NULL, trusts[trust]);
835+
_cupsLangPrintFilter(stderr, "ALERT", "%s", trust_msgs[trust]);
836+
return (CUPS_BACKEND_STOP);
836837
}
837838

838839
/*

0 commit comments

Comments
 (0)