diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:57:50 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:57:50 -0400 |
commit | 064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6 (patch) | |
tree | 45145c8db9a634af861cb1ed87a7378837e72763 /scheduler/client.c | |
parent | 6918883fba4942931dc455b32545d6edf18dec5c (diff) | |
download | cups-064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6.tar.gz |
Import all of the bug fixes from the OpenPrinting CUPS repository.
Import the improvements to ippeveprinter from OpenPrinting/ippsample.
Import the improvements to ippfind and ipptool from OpenPrinting/ippsample.
Diffstat (limited to 'scheduler/client.c')
-rw-r--r-- | scheduler/client.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/scheduler/client.c b/scheduler/client.c index c2ee8f12a..479b70aed 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -2109,18 +2109,13 @@ cupsdSendHeader( } else if (auth_type == CUPSD_AUTH_NEGOTIATE) { -#if defined(SO_PEERCRED) && defined(AF_LOCAL) - if (httpAddrFamily(httpGetAddress(con->http)) == AF_LOCAL) - strlcpy(auth_str, "PeerCred", sizeof(auth_str)); - else -#endif /* SO_PEERCRED && AF_LOCAL */ strlcpy(auth_str, "Negotiate", sizeof(auth_str)); } - if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE && !con->is_browser && !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost")) + if (con->best && !con->is_browser && !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost")) { /* - * Add a "trc" (try root certification) parameter for local non-Kerberos + * Add a "trc" (try root certification) parameter for local * requests when the request requires system group membership - then the * client knows the root certificate can/should be used. * @@ -2789,6 +2784,25 @@ get_file(cupsd_client_t *con, /* I - Client connection */ perm_check = 0; } + else if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) + { + strlcpy(filename, ConfigurationFile, len); + + perm_check = 0; + } + else if (!strncmp(con->uri, "/admin/log/", 11)) + { + if (!strncmp(con->uri + 11, "access_log", 10) && AccessLog[0] == '/') + strlcpy(filename, AccessLog, len); + else if (!strncmp(con->uri + 11, "error_log", 9) && ErrorLog[0] == '/') + strlcpy(filename, ErrorLog, len); + else if (!strncmp(con->uri + 11, "page_log", 8) && PageLog[0] == '/') + strlcpy(filename, PageLog, len); + else + return (NULL); + + perm_check = 0; + } else if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9)) { /* @@ -2822,25 +2836,6 @@ get_file(cupsd_client_t *con, /* I - Client connection */ perm_check = 0; } - else if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) - { - strlcpy(filename, ConfigurationFile, len); - - perm_check = 0; - } - else if (!strncmp(con->uri, "/admin/log/", 11)) - { - if (!strncmp(con->uri + 11, "access_log", 10) && AccessLog[0] == '/') - strlcpy(filename, AccessLog, len); - else if (!strncmp(con->uri + 11, "error_log", 9) && ErrorLog[0] == '/') - strlcpy(filename, ErrorLog, len); - else if (!strncmp(con->uri + 11, "page_log", 8) && PageLog[0] == '/') - strlcpy(filename, PageLog, len); - else - return (NULL); - - perm_check = 0; - } else if (con->language) { snprintf(language, sizeof(language), "/%s", con->language->language); @@ -3471,8 +3466,7 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */ } else { - sprintf(content_length, "CONTENT_LENGTH=" CUPS_LLFMT, - CUPS_LLCAST con->bytes); + snprintf(content_length, sizeof(content_length), "CONTENT_LENGTH=" CUPS_LLFMT, CUPS_LLCAST con->bytes); snprintf(content_type, sizeof(content_type), "CONTENT_TYPE=%s", httpGetField(con->http, HTTP_FIELD_CONTENT_TYPE)); |