Skip to content

Commit eea9373

Browse files
committed
Add debug logging of user defaults.
1 parent f103fc5 commit eea9373

1 file changed

Lines changed: 48 additions & 10 deletions

File tree

cups/usersys.c

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,33 @@ static void cups_set_uatokens(_cups_client_conf_t *cc, const char *value);
101101
static void cups_set_user(_cups_client_conf_t *cc, const char *value);
102102

103103

104+
//
105+
// Local globals...
106+
//
107+
108+
static const char * const uatokens[] =// UserAgentTokens values
109+
{
110+
"None",
111+
"ProductOnly",
112+
"Major",
113+
"Minor",
114+
"Minimal",
115+
"OS",
116+
"Full"
117+
};
118+
#ifdef DEBUG
119+
static const char * const tls_versions[] =
120+
{ // TLS/SSL version numbers
121+
"SSL3.0",
122+
"TLS1.0",
123+
"TLS1.1",
124+
"TLS1.2",
125+
"TLS1.3",
126+
"TLS1.3"
127+
};
128+
#endif // DEBUG
129+
130+
104131
//
105132
// 'cupsGetEncryption()' - Get the current encryption settings.
106133
//
@@ -825,6 +852,15 @@ _cupsSetDefaults(void)
825852
char filename[1024]; // Filename
826853
_cups_client_conf_t cc; // client.conf values
827854
_cups_globals_t *cg = _cupsGlobals(); // Pointer to library globals
855+
#ifdef DEBUG
856+
static const char * const encryptions[] =
857+
{ // Encryption values
858+
"IfRequested",
859+
"Never",
860+
"Required",
861+
"Always"
862+
};
863+
#endif // DEBUG
828864

829865

830866
DEBUG_puts("_cupsSetDefaults()");
@@ -881,6 +917,17 @@ _cupsSetDefaults(void)
881917
if (cg->validate_certs < 0)
882918
cg->validate_certs = cc.validate_certs;
883919

920+
DEBUG_printf("1_cupsSetDefaults: AllowAnyRoot %s", cg->any_root ? "Yes" : "No");
921+
DEBUG_printf("1_cupsSetDefaults: AllowExpiredCerts %s", cg->expired_certs ? "Yes" : "No");
922+
DEBUG_printf("1_cupsSetDefaults: DigestOptions %s", cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5 ? "DenyMD5" : "None");
923+
DEBUG_printf("1_cupsSetDefaults: Encryption %s", encryptions[cg->encryption]);
924+
DEBUG_printf("1_cupsSetDefaults: ServerName %s", cg->servername);
925+
DEBUG_printf("1_cupsSetDefaults: SSLOptions%s%s%s%s Min%s Max%s", cc.ssl_options == _HTTP_TLS_NONE ? " none" : "", (cc.ssl_options & _HTTP_TLS_ALLOW_RC4) ? " AllowRC4" : "", (cc.ssl_options & _HTTP_TLS_ALLOW_DH) ? " AllowDH" : "", (cc.ssl_options & _HTTP_TLS_DENY_CBC) ? " DenyCBC" : "", tls_versions[cc.ssl_min_version], tls_versions[cc.ssl_max_version]);
926+
DEBUG_printf("1_cupsSetDefaults: TrustOnFirstUse %s", cg->trust_first ? "Yes" : "No");
927+
DEBUG_printf("1_cupsSetDefaults: User %s", cg->user);
928+
DEBUG_printf("1_cupsSetDefaults: UserAgentTokens %s", uatokens[cg->uatokens]);
929+
DEBUG_printf("1_cupsSetDefaults: ValidateCerts %s", cg->validate_certs ? "Yes" : "No");
930+
884931
_httpTLSSetOptions(cc.ssl_options | _HTTP_TLS_SET_DEFAULT, cc.ssl_min_version, cc.ssl_max_version);
885932
}
886933

@@ -1388,16 +1435,7 @@ cups_set_uatokens(
13881435
const char *value) // I - Value
13891436
{
13901437
int i; // Looping var
1391-
static const char * const uatokens[] =// UserAgentTokens values
1392-
{
1393-
"NONE",
1394-
"PRODUCTONLY",
1395-
"MAJOR",
1396-
"MINOR",
1397-
"MINIMAL",
1398-
"OS",
1399-
"FULL"
1400-
};
1438+
14011439

14021440
for (i = 0; i < (int)(sizeof(uatokens) / sizeof(uatokens[0])); i ++)
14031441
{

0 commit comments

Comments
 (0)