MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cups_init_client_conf

Function cups_init_client_conf

cups/usersys.c:1316–1396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1314 */
1315
1316static void
1317cups_init_client_conf(
1318 _cups_client_conf_t *cc) /* I - client.conf values */
1319{
1320 /*
1321 * Clear all values to "not set"...
1322 */
1323
1324 memset(cc, 0, sizeof(_cups_client_conf_t));
1325
1326 cc->uatokens = _CUPS_UATOKENS_MINIMAL;
1327
1328#if defined(__APPLE__) && !TARGET_OS_OSX
1329 cups_set_user(cc, "mobile");
1330#endif /* __APPLE__ && !TARGET_OS_OSX */
1331
1332#ifdef HAVE_TLS
1333 cc->ssl_min_version = _HTTP_TLS_1_0;
1334 cc->ssl_max_version = _HTTP_TLS_MAX;
1335#endif /* HAVE_TLS */
1336 cc->encryption = (http_encryption_t)-1;
1337 cc->trust_first = -1;
1338 cc->any_root = -1;
1339 cc->expired_certs = -1;
1340 cc->validate_certs = -1;
1341
1342 /*
1343 * Load settings from the org.cups.PrintingPrefs plist (which trump
1344 * everything...)
1345 */
1346
1347#if defined(__APPLE__)
1348 char sval[1024]; /* String value */
1349# ifdef HAVE_TLS
1350 int bval; /* Boolean value */
1351
1352 if (cups_apple_get_boolean(kAllowAnyRootKey, &bval))
1353 cc->any_root = bval;
1354
1355 if (cups_apple_get_boolean(kAllowExpiredCertsKey, &bval))
1356 cc->expired_certs = bval;
1357
1358 if (cups_apple_get_string(kEncryptionKey, sval, sizeof(sval)))
1359 cups_set_encryption(cc, sval);
1360
1361 if (cups_apple_get_string(kSSLOptionsKey, sval, sizeof(sval)))
1362 {
1363 cups_set_ssl_options(cc, sval);
1364 }
1365 else
1366 {
1367 sval[0] = '\0';
1368
1369 if (cups_apple_get_boolean(kAllowRC4, &bval) && bval)
1370 strlcat(sval, " AllowRC4", sizeof(sval));
1371 if (cups_apple_get_boolean(kAllowSSL3, &bval) && bval)
1372 strlcat(sval, " AllowSSL3", sizeof(sval));
1373 if (cups_apple_get_boolean(kAllowDH, &bval) && bval)

Callers 1

_cupsSetDefaultsFunction · 0.85

Calls 7

cups_set_userFunction · 0.85
cups_apple_get_booleanFunction · 0.85
cups_apple_get_stringFunction · 0.85
cups_set_encryptionFunction · 0.85
cups_set_ssl_optionsFunction · 0.85
cups_set_digestoptionsFunction · 0.85
cups_set_uatokensFunction · 0.85

Tested by

no test coverage detected