]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Pass CONTENT_TYPE and FINAL_CONTENT_TYPE env vars to XPC service.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 7 May 2021 10:50:12 +0000 (06:50 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 7 May 2021 10:50:12 +0000 (06:50 -0400)
backend/ipp.c

index 020ab7fd4ae8eaf862b5c229e1822227d6e59cf9..3779c88fa45ff41c59b0dcfb76c072979b25f3a9 100644 (file)
@@ -3245,7 +3245,8 @@ run_as_user(char       *argv[],           /* I - Command-line arguments */
            const char *device_uri,     /* I - Device URI */
            int        fd)              /* I - File to print */
 {
-  const char           *auth_negotiate;/* AUTH_NEGOTIATE env var */
+  const char           *auth_negotiate,/* AUTH_NEGOTIATE env var */
+                       *content_type;  /* [FINAL_]CONTENT_TYPE env vars */
   xpc_connection_t     conn;           /* Connection to XPC service */
   xpc_object_t         request;        /* Request message dictionary */
   __block xpc_object_t response;       /* Response message dictionary */
@@ -3308,6 +3309,10 @@ run_as_user(char       *argv[],          /* I - Command-line arguments */
                             getenv("AUTH_INFO_REQUIRED"));
   if ((auth_negotiate = getenv("AUTH_NEGOTIATE")) != NULL)
     xpc_dictionary_set_string(request, "auth-negotiate", auth_negotiate);
+  if ((content_type = getenv("CONTENT_TYPE")) != NULL)
+    xpc_dictionary_set_string(request, "content-type", content_type);
+  if ((content_type = getenv("FINAL_CONTENT_TYPE")) != NULL)
+    xpc_dictionary_set_string(request, "final-content-type", content_type);
   xpc_dictionary_set_fd(request, "stdin", fd);
   xpc_dictionary_set_fd(request, "stderr", 2);
   xpc_dictionary_set_fd(request, "side-channel", CUPS_SC_FD);