]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix access to resource files when the web interface was disabled (STR #4755)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 26 Jan 2016 21:31:33 +0000 (21:31 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 26 Jan 2016 21:31:33 +0000 (21:31 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13060 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.1.txt
scheduler/client.c
xcode/CUPS.xcodeproj/project.pbxproj

index 4eb9939287d310e12841d5ac5eb0b95b4abd3757..94614548595ef5cc11b118b9b20c325e47ed1b15 100644 (file)
@@ -17,6 +17,8 @@ CHANGES IN CUPS V2.1.3
          attribute value (STR #4752)
        - cupsEncodeOptions2 incorrectly handled escaped values
          (<rdar://problem/19736672>)
+       - The scheduler did not allow access to resource files (icons, etc.)
+         when the web interface was disabled (STR #4755)
        - Localization fix (STR #4756)
 
 
index ae998e27f0a712aa004d40c4fb6f628e60a190d4..ec5d780447107287315fde4cc0657eb32299e1ea 100644 (file)
@@ -1156,29 +1156,28 @@ cupsdReadClient(cupsd_client_t *con)    /* I - Client to read from */
                break;
              }
            }
-           else if (!WebInterface)
-           {
-            /*
-             * Web interface is disabled. Show an appropriate message...
-             */
-
-             if (!cupsdSendError(con, HTTP_STATUS_CUPS_WEBIF_DISABLED, CUPSD_AUTH_NONE))
-             {
-               cupsdCloseClient(con);
-               return;
-             }
-
-             break;
-           }
 
-           if ((!strncmp(con->uri, "/admin", 6) &&
-                 strncmp(con->uri, "/admin/conf/", 12) &&
-                 strncmp(con->uri, "/admin/log/", 11)) ||
+           if ((!strncmp(con->uri, "/admin", 6) && strcmp(con->uri, "/admin/conf/cupsd.conf") && strncmp(con->uri, "/admin/log/", 11)) ||
                 !strncmp(con->uri, "/printers", 9) ||
                 !strncmp(con->uri, "/classes", 8) ||
                 !strncmp(con->uri, "/help", 5) ||
                 !strncmp(con->uri, "/jobs", 5))
            {
+             if (!WebInterface)
+             {
+              /*
+               * Web interface is disabled. Show an appropriate message...
+               */
+
+               if (!cupsdSendError(con, HTTP_STATUS_CUPS_WEBIF_DISABLED, CUPSD_AUTH_NONE))
+               {
+                 cupsdCloseClient(con);
+                 return;
+               }
+
+               break;
+             }
+
             /*
              * Send CGI output...
              */
@@ -1245,20 +1244,14 @@ cupsdReadClient(cupsd_client_t *con)    /* I - Client to read from */
              if (httpGetVersion(con->http) <= HTTP_VERSION_1_0)
                httpSetKeepAlive(con->http, HTTP_KEEPALIVE_OFF);
            }
-            else if ((!strncmp(con->uri, "/admin/conf/", 12) &&
-                     (strchr(con->uri + 12, '/') ||
-                      strlen(con->uri) == 12)) ||
-                    (!strncmp(con->uri, "/admin/log/", 11) &&
-                     (strchr(con->uri + 11, '/') ||
-                      strlen(con->uri) == 11)))
+            else if (!strncmp(con->uri, "/admin/log/", 11) && (strchr(con->uri + 11, '/') || strlen(con->uri) == 11))
            {
             /*
              * GET can only be done to configuration files directly under
              * /admin/conf...
              */
 
-             cupsdLogClient(con, CUPSD_LOG_ERROR,
-                             "Request for subdirectory \"%s\"!", con->uri);
+             cupsdLogClient(con, CUPSD_LOG_ERROR, "Request for subdirectory \"%s\".", con->uri);
 
              if (!cupsdSendError(con, HTTP_STATUS_FORBIDDEN, CUPSD_AUTH_NONE))
              {
@@ -1396,9 +1389,7 @@ cupsdReadClient(cupsd_client_t *con)      /* I - Client to read from */
 
              break;
            }
-           else if ((!strncmp(con->uri, "/admin", 6) &&
-                     strncmp(con->uri, "/admin/conf/", 12) &&
-                     strncmp(con->uri, "/admin/log/", 11)) ||
+           else if ((!strncmp(con->uri, "/admin", 6) && strncmp(con->uri, "/admin/log/", 11)) ||
                     !strncmp(con->uri, "/printers", 9) ||
                     !strncmp(con->uri, "/classes", 8) ||
                     !strncmp(con->uri, "/help", 5) ||
@@ -1648,9 +1639,7 @@ cupsdReadClient(cupsd_client_t *con)      /* I - Client to read from */
              break;
            }
 
-           if ((!strncmp(con->uri, "/admin", 6) &&
-                strncmp(con->uri, "/admin/conf/", 12) &&
-                strncmp(con->uri, "/admin/log/", 11)) ||
+           if ((!strncmp(con->uri, "/admin", 6) && strcmp(con->uri, "/admin/conf/cupsd.conf") && strncmp(con->uri, "/admin/log/", 11)) ||
                !strncmp(con->uri, "/printers", 9) ||
                !strncmp(con->uri, "/classes", 8) ||
                !strncmp(con->uri, "/help", 5) ||
@@ -1670,12 +1659,7 @@ cupsdReadClient(cupsd_client_t *con)     /* I - Client to read from */
 
               cupsdLogRequest(con, HTTP_STATUS_OK);
            }
-            else if ((!strncmp(con->uri, "/admin/conf/", 12) &&
-                     (strchr(con->uri + 12, '/') ||
-                      strlen(con->uri) == 12)) ||
-                    (!strncmp(con->uri, "/admin/log/", 11) &&
-                     (strchr(con->uri + 11, '/') ||
-                      strlen(con->uri) == 11)))
+            else if (!strncmp(con->uri, "/admin/log/", 11) && (strchr(con->uri + 11, '/') || strlen(con->uri) == 11))
            {
             /*
              * HEAD can only be done to configuration files under
index 9b9b93322b9a05f3a1121d64308e4bed2a0d6edc..f7a0a92f394f9c325fb2667d97623c79caa3a987 100644 (file)
                                CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
                                CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
                                DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_TESTABILITY = YES;
                                GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
                                GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
                                GCC_TREAT_WARNINGS_AS_ERRORS = YES;