Accepting request 223231 from home:jsmeix:branches:Printing

In any case cups.socket and cups.path are stopped and disabled now because cautious clean up would leave a messsed up systemd setup for cupsd when YaST was used before (bnc#857372) plus CUPS upstream fix for STR #4351 cups-lpd hugh jobs (>2G) fail (bnc#864782)

OBS-URL: https://build.opensuse.org/request/show/223231
OBS-URL: https://build.opensuse.org/package/show/Printing/cups?expand=0&rev=279
This commit is contained in:
Johannes Meixner 2014-02-20 13:44:57 +00:00 committed by Git OBS Bridge
parent 57b52dd315
commit bb6bef5a63
3 changed files with 70 additions and 13 deletions

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Thu Feb 20 13:57:24 CET 2014 - jsmeix@suse.de
- Cautious clean up of systemd units via RPM scriptlets
(see the entry below dated "Wed Feb 19 15:05:44 CET 2014")
does not work reliable because it would leave a messsed up
systemd setup for cupsd when YaST was used before
to start/stop/enable/disable the cupsd, see
https://bugzilla.novell.com/show_bug.cgi?id=857372#c115
so that now cups.socket and cups.path are stopped and disabled
in any case to ensure starting/stopping/enabling/disabling
of the cupsd also works with YaST, see
https://bugzilla.novell.com/show_bug.cgi?id=857372#c120
(bnc#857372).
- str4351.patch from CUPS upstream fixes
https://www.cups.org/str.php?L4351
"STR #4351 cups-lpd hugh jobs (>2G) fail"
(bnc#864782).
-------------------------------------------------------------------
Wed Feb 19 15:05:44 CET 2014 - jsmeix@suse.de

View File

@ -15,7 +15,6 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: cups
BuildRequires: dbus-1-devel
BuildRequires: fdupes
@ -217,6 +216,8 @@ Patch112: cups-0003-systemd-secure-cups.service-unit-file.patch
# who have been allowed by root to do CUPS configuration changes
# (CUPS STR#4223 CVE-2012-5519 Novell/Suse Bugzilla bnc#789566):
Patch113: cups-1.5.4-CVE-2012-5519.patch
# Patch114 fixes STR #4351: cups-lpd hugh jobs (>2G) fail
Patch114: str4351.patch
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -377,6 +378,8 @@ printer drivers for CUPS.
# who have been allowed by root to do CUPS configuration changes
# (CUPS STR#4223 CVE-2012-5519 Novell/Suse Bugzilla bnc#789566):
%patch113
# Patch114 fixes STR #4351: cups-lpd hugh jobs (>2G) fail
%patch114
%build
# Disable SILENT run of make so that make runs verbose as usual:
@ -581,17 +584,16 @@ sed -i -e 's|/var/lock|/run/lock|g' %{buildroot}/etc/init.d/cups
%if 0%{?suse_version} <= 1310
# Begin clean up obsolete systemd units cups.path and cups.socket
# Stop and disable systemd units that have been provided by a previous package version but are no longer provided by this package.
# Instead of relying on RPM package upgrade (i.e. when "$1" = "2") the actual files are tested:
# Do this in any case because YaST only supprts cups.service but not cups.socket or cups.path
# see https://bugzilla.novell.com/show_bug.cgi?id=857372#c120
# and if cups.socket or cups.path would be actuve YaST would mess up the systemd setup for CUPS
# see https://bugzilla.novell.com/show_bug.cgi?id=857372#c115
# which is one more reason that cups.socket and cups.path are completely disabled and removed
# see https://bugzilla.novell.com/show_bug.cgi?id=857372#c61
for u in cups.path cups.socket
do for f in $( readlink /etc/systemd/system/*/$u )
do if test "$f" = "%{_unitdir}/$u"
then # When /etc/systemd/system/*/$u points into %{_unitdir}/ it means what the distributor (SUSE) provided was used
# (see https://bugzilla.novell.com/show_bug.cgi?id=857372#c26) and then the distributor can clean up his stuff:
echo "stopping and disabling systemd unit $u because %{_unitdir}/$u is longer provided by this cups package"
systemctl --quiet stop $u
systemctl --quiet disable $u
fi
done
do # (without "|| :" build fails with "Failed to get D-Bus connection: No connection to service manager. preinstall script ... failed"):
systemctl --quiet stop $u || :
systemctl --quiet disable $u || :
done
# End clean up obsolete systemd units cups.path and cups.socket
%endif
@ -618,8 +620,8 @@ exit 0
# Be on the safe side and enforce systemd to use the cups.service file in this package
# ("reenable" does not implicitly stop a running cupsd which is exactly correct here):
if systemctl --quiet is-enabled cups.service
then echo "refreshing (reenabling) systemd unit cups.service"
systemctl --quiet reenable cups.service
then # (without "|| :" build fails with "Failed to get D-Bus connection: No connection to service manager. postinstall script ... failed"):
systemctl --quiet reenable cups.service || :
fi
# End refresh systemd unit cups.service
%else

36
str4351.patch Normal file
View File

@ -0,0 +1,36 @@
Index: scheduler/cups-lpd.c
===================================================================
--- scheduler/cups-lpd.c (revision 11557)
+++ scheduler/cups-lpd.c (revision 11558)
@@ -781,7 +770,8 @@
int fd; /* Temporary file */
FILE *fp; /* File pointer */
char filename[1024]; /* Temporary filename */
- int bytes; /* Bytes received */
+ ssize_t bytes; /* Bytes received */
+ size_t total; /* Total bytes */
char line[256], /* Line from file/stdin */
command, /* Command from line */
*count, /* Number of bytes */
@@ -965,15 +955,15 @@
* Copy the data or control file from the client...
*/
- for (i = atoi(count); i > 0; i -= bytes)
+ for (total = (size_t)strtoll(count, NULL, 10); total > 0; total -= (size_t)bytes)
{
- if (i > sizeof(line))
- bytes = sizeof(line);
+ if (total > sizeof(line))
+ bytes = (ssize_t)sizeof(line);
else
- bytes = i;
+ bytes = (ssize_t)total;
- if ((bytes = fread(line, 1, bytes, stdin)) > 0)
- bytes = write(fd, line, bytes);
+ if ((bytes = (ssize_t)fread(line, 1, (size_t)bytes, stdin)) > 0)
+ bytes = write(fd, line, (size_t)bytes);
if (bytes < 1)
{