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

Function cups_finalize_client_conf

cups/usersys.c:1184–1309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1182 */
1183
1184static void
1185cups_finalize_client_conf(
1186 _cups_client_conf_t *cc) /* I - client.conf values */
1187{
1188 const char *value; /* Environment variable */
1189
1190
1191 if ((value = getenv("CUPS_TRUSTFIRST")) != NULL)
1192 cc->trust_first = cups_boolean_value(value);
1193
1194 if ((value = getenv("CUPS_ANYROOT")) != NULL)
1195 cc->any_root = cups_boolean_value(value);
1196
1197 if ((value = getenv("CUPS_ENCRYPTION")) != NULL)
1198 cups_set_encryption(cc, value);
1199
1200 if ((value = getenv("CUPS_EXPIREDCERTS")) != NULL)
1201 cc->expired_certs = cups_boolean_value(value);
1202
1203#ifdef HAVE_GSSAPI
1204 if ((value = getenv("CUPS_GSSSERVICENAME")) != NULL)
1205 cups_set_gss_service_name(cc, value);
1206#endif /* HAVE_GSSAPI */
1207
1208 if ((value = getenv("CUPS_SERVER")) != NULL)
1209 cups_set_server_name(cc, value);
1210
1211 if ((value = getenv("CUPS_USER")) != NULL)
1212 cups_set_user(cc, value);
1213
1214 if ((value = getenv("CUPS_VALIDATECERTS")) != NULL)
1215 cc->validate_certs = cups_boolean_value(value);
1216
1217 /*
1218 * Then apply defaults for those values that haven't been set...
1219 */
1220
1221 if (cc->trust_first < 0)
1222 cc->trust_first = 1;
1223
1224 if (cc->any_root < 0)
1225 cc->any_root = 1;
1226
1227 if (cc->encryption == (http_encryption_t)-1)
1228 cc->encryption = HTTP_ENCRYPTION_IF_REQUESTED;
1229
1230 if (cc->expired_certs < 0)
1231 cc->expired_certs = 0;
1232
1233#ifdef HAVE_GSSAPI
1234 if (!cc->gss_service_name[0])
1235 cups_set_gss_service_name(cc, CUPS_DEFAULT_GSSSERVICENAME);
1236#endif /* HAVE_GSSAPI */
1237
1238 if (!cc->server_name[0])
1239 {
1240 /*
1241 * If we are compiled with domain socket support, only use the

Callers 1

_cupsSetDefaultsFunction · 0.85

Calls 6

cups_boolean_valueFunction · 0.85
cups_set_encryptionFunction · 0.85
cups_set_server_nameFunction · 0.85
cups_set_userFunction · 0.85
_cupsGlobalsFunction · 0.85

Tested by

no test coverage detected