From: Michael R Sweet Date: Fri, 7 May 2021 10:49:43 +0000 (-0400) Subject: Pass CONTENT_TYPE and FINAL_CONTENT_TYPE to Apple XPC service. X-Git-Tag: v2.4b1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ae90347a5d126d060b031f1b098426906bd62e6;p=thirdparty%2Fcups.git Pass CONTENT_TYPE and FINAL_CONTENT_TYPE to Apple XPC service. --- diff --git a/backend/ipp.c b/backend/ipp.c index 020ab7fd4a..3779c88fa4 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -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);