[cups/f19] Prevent feedback loop when fetching error_log over HTTP (STR #4366).
Tim Waugh
twaugh at fedoraproject.org
Tue Mar 11 15:56:59 UTC 2014
commit 896e0f167984a730fa766c2739948acc9706d370
Author: Tim Waugh <twaugh at redhat.com>
Date: Thu Mar 6 10:57:43 2014 +0000
Prevent feedback loop when fetching error_log over HTTP (STR #4366).
(cherry picked from commit 3933cbca344ede8d6ece7a6272f6754e67784de5)
Conflicts:
cups.spec
cups-str4366.patch | 30 ++++++++++++++++++++++++++++++
cups.spec | 4 ++++
2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/cups-str4366.patch b/cups-str4366.patch
new file mode 100644
index 0000000..485f959
--- /dev/null
+++ b/cups-str4366.patch
@@ -0,0 +1,30 @@
+diff -up cups-1.6.4/scheduler/client.c.str4366 cups-1.6.4/scheduler/client.c
+--- cups-1.6.4/scheduler/client.c.str4366 2014-03-11 15:36:32.702481538 +0000
++++ cups-1.6.4/scheduler/client.c 2014-03-11 15:40:08.424838223 +0000
+@@ -2777,14 +2777,24 @@ cupsdWriteClient(cupsd_client_t *con) /*
+ con->file_ready = 0;
+ }
+
++ bytes = (ssize_t)(sizeof(con->header) - (size_t)con->header_used);
++
++ if (!con->pipe_pid && bytes > con->http.data_remaining)
++ {
++ /*
++ * Limit GET bytes to original size of file (STR #3265)...
++ */
++
++ bytes = (ssize_t)con->http.data_remaining;
++ }
++
+ if (con->response && con->response->state != IPP_DATA)
+ {
+ ipp_state = ippWrite(HTTP(con), con->response);
+ bytes = ipp_state != IPP_ERROR &&
+ (con->file >= 0 || ipp_state != IPP_DATA);
+ }
+- else if ((bytes = read(con->file, con->header + con->header_used,
+- sizeof(con->header) - con->header_used)) > 0)
++ else if ((bytes = read(con->file, con->header + con->header_used, (size_t)bytes)) > 0)
+ {
+ con->header_used += bytes;
+
diff --git a/cups.spec b/cups.spec
index 06c3e61..a706a50 100644
--- a/cups.spec
+++ b/cups.spec
@@ -71,6 +71,7 @@ Patch40: cups-dbus-notifier.patch
Patch41: cups-usb-timeout.patch
Patch42: cups-avahi-browse.patch
Patch43: cups-str4380.patch
+Patch44: cups-str4366.patch
Patch100: cups-lspp.patch
@@ -273,6 +274,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
%patch42 -p1 -b .avahi-browse
# Fix for cupsEnumDest() 'removed' callbacks (bug #1054312, STR #4380).
%patch43 -p1 -b .str4380
+# Prevent feedback loop when fetching error_log over HTTP (STR #4366).
+%patch44 -p1 -b .str4366
%if %lspp
# LSPP support.
@@ -662,6 +665,7 @@ rm -f %{cups_serverbin}/backend/smb
%changelog
* Tue Mar 11 2014 Tim Waugh <twaugh at redhat.com> - 1:1.6.4-4
+- Prevent feedback loop when fetching error_log over HTTP (STR #4366).
- Fix for cupsEnumDest() 'removed' callbacks (bug #1054312, STR #4380).
- Prevent dnssd backend exiting too early (bug #1026940, STR #4365).
- Use '-f' when using rm in %%setup section.
More information about the scm-commits
mailing list