Fix for systemd socket activation: relax permissions check for

domain socket in libcups.
This commit is contained in:
Tim Waugh 2011-10-04 12:03:00 +01:00
parent 4c3d853b67
commit 3bce791019
2 changed files with 39 additions and 23 deletions

View File

@ -1,6 +1,6 @@
diff -up cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.0/config-scripts/cups-systemd.m4 diff -up cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.0/config-scripts/cups-systemd.m4
--- cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket 2011-09-22 13:01:02.909065794 +0100 --- cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket 2011-10-04 11:58:42.554997916 +0100
+++ cups-1.5.0/config-scripts/cups-systemd.m4 2011-09-22 13:01:02.909065794 +0100 +++ cups-1.5.0/config-scripts/cups-systemd.m4 2011-10-04 11:58:42.554997916 +0100
@@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
+dnl +dnl
+dnl "$Id$" +dnl "$Id$"
@ -29,7 +29,7 @@ diff -up cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.0/con
+dnl +dnl
diff -up cups-1.5.0/configure.in.systemd-socket cups-1.5.0/configure.in diff -up cups-1.5.0/configure.in.systemd-socket cups-1.5.0/configure.in
--- cups-1.5.0/configure.in.systemd-socket 2010-11-20 01:03:46.000000000 +0000 --- cups-1.5.0/configure.in.systemd-socket 2010-11-20 01:03:46.000000000 +0000
+++ cups-1.5.0/configure.in 2011-09-22 13:01:02.910065775 +0100 +++ cups-1.5.0/configure.in 2011-10-04 11:58:42.555997897 +0100
@@ -37,6 +37,7 @@ sinclude(config-scripts/cups-pam.m4) @@ -37,6 +37,7 @@ sinclude(config-scripts/cups-pam.m4)
sinclude(config-scripts/cups-largefile.m4) sinclude(config-scripts/cups-largefile.m4)
sinclude(config-scripts/cups-dnssd.m4) sinclude(config-scripts/cups-dnssd.m4)
@ -48,9 +48,21 @@ diff -up cups-1.5.0/configure.in.systemd-socket cups-1.5.0/configure.in
desktop/cups.desktop desktop/cups.desktop
doc/help/ref-cupsd-conf.html doc/help/ref-cupsd-conf.html
doc/help/standard.html doc/help/standard.html
diff -up cups-1.5.0/cups/usersys.c.systemd-socket cups-1.5.0/cups/usersys.c
--- cups-1.5.0/cups/usersys.c.systemd-socket 2011-10-04 11:59:16.310382444 +0100
+++ cups-1.5.0/cups/usersys.c 2011-10-04 12:01:28.849965809 +0100
@@ -770,7 +770,7 @@ cups_read_client_conf(
struct stat sockinfo; /* Domain socket information */
if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
- (sockinfo.st_mode & S_IRWXO) == S_IRWXO)
+ (sockinfo.st_mode & (S_IROTH | S_IWOTH)) == (S_IROTH | S_IWOTH))
cups_server = CUPS_DEFAULT_DOMAINSOCKET;
else
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
diff -up cups-1.5.0/data/cups.path.in.systemd-socket cups-1.5.0/data/cups.path.in diff -up cups-1.5.0/data/cups.path.in.systemd-socket cups-1.5.0/data/cups.path.in
--- cups-1.5.0/data/cups.path.in.systemd-socket 2011-09-22 13:01:02.911065757 +0100 --- cups-1.5.0/data/cups.path.in.systemd-socket 2011-10-04 11:58:42.555997897 +0100
+++ cups-1.5.0/data/cups.path.in 2011-09-22 13:01:02.911065757 +0100 +++ cups-1.5.0/data/cups.path.in 2011-10-04 11:58:42.555997897 +0100
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
+[Unit] +[Unit]
+Description=CUPS Printer Service Spool +Description=CUPS Printer Service Spool
@ -61,8 +73,8 @@ diff -up cups-1.5.0/data/cups.path.in.systemd-socket cups-1.5.0/data/cups.path.i
+[Install] +[Install]
+WantedBy=multi-user.target +WantedBy=multi-user.target
diff -up cups-1.5.0/data/cups.service.in.systemd-socket cups-1.5.0/data/cups.service.in diff -up cups-1.5.0/data/cups.service.in.systemd-socket cups-1.5.0/data/cups.service.in
--- cups-1.5.0/data/cups.service.in.systemd-socket 2011-09-22 13:01:02.911065757 +0100 --- cups-1.5.0/data/cups.service.in.systemd-socket 2011-10-04 11:58:42.556997879 +0100
+++ cups-1.5.0/data/cups.service.in 2011-09-22 13:01:02.911065757 +0100 +++ cups-1.5.0/data/cups.service.in 2011-10-04 11:58:42.556997879 +0100
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
+[Unit] +[Unit]
+Description=CUPS Printing Service +Description=CUPS Printing Service
@ -74,8 +86,8 @@ diff -up cups-1.5.0/data/cups.service.in.systemd-socket cups-1.5.0/data/cups.ser
+Also=cups.socket cups.path +Also=cups.socket cups.path
+WantedBy=printer.target +WantedBy=printer.target
diff -up cups-1.5.0/data/cups.socket.in.systemd-socket cups-1.5.0/data/cups.socket.in diff -up cups-1.5.0/data/cups.socket.in.systemd-socket cups-1.5.0/data/cups.socket.in
--- cups-1.5.0/data/cups.socket.in.systemd-socket 2011-09-22 13:01:02.911065757 +0100 --- cups-1.5.0/data/cups.socket.in.systemd-socket 2011-10-04 11:58:42.556997879 +0100
+++ cups-1.5.0/data/cups.socket.in 2011-09-22 13:01:02.911065757 +0100 +++ cups-1.5.0/data/cups.socket.in 2011-10-04 11:58:42.556997879 +0100
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
+[Unit] +[Unit]
+Description=CUPS Printing Service Sockets +Description=CUPS Printing Service Sockets
@ -88,7 +100,7 @@ diff -up cups-1.5.0/data/cups.socket.in.systemd-socket cups-1.5.0/data/cups.sock
+WantedBy=sockets.target +WantedBy=sockets.target
diff -up cups-1.5.0/data/Makefile.systemd-socket cups-1.5.0/data/Makefile diff -up cups-1.5.0/data/Makefile.systemd-socket cups-1.5.0/data/Makefile
--- cups-1.5.0/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100 --- cups-1.5.0/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100
+++ cups-1.5.0/data/Makefile 2011-09-22 13:01:02.912065740 +0100 +++ cups-1.5.0/data/Makefile 2011-10-04 11:58:42.557997861 +0100
@@ -112,6 +112,12 @@ install-data: @@ -112,6 +112,12 @@ install-data:
$(INSTALL_DATA) $$file $(DATADIR)/ppdc; \ $(INSTALL_DATA) $$file $(DATADIR)/ppdc; \
done done
@ -113,8 +125,8 @@ diff -up cups-1.5.0/data/Makefile.systemd-socket cups-1.5.0/data/Makefile
# #
diff -up cups-1.5.0/Makedefs.in.systemd-socket cups-1.5.0/Makedefs.in diff -up cups-1.5.0/Makedefs.in.systemd-socket cups-1.5.0/Makedefs.in
--- cups-1.5.0/Makedefs.in.systemd-socket 2011-09-22 13:01:02.732069025 +0100 --- cups-1.5.0/Makedefs.in.systemd-socket 2011-10-04 11:58:42.334001946 +0100
+++ cups-1.5.0/Makedefs.in 2011-09-22 13:01:02.912065740 +0100 +++ cups-1.5.0/Makedefs.in 2011-10-04 11:58:42.558997843 +0100
@@ -143,6 +143,7 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @@ -143,6 +143,7 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
CXXLIBS = @CXXLIBS@ CXXLIBS = @CXXLIBS@
DBUS_NOTIFIER = @DBUS_NOTIFIER@ DBUS_NOTIFIER = @DBUS_NOTIFIER@
@ -133,7 +145,7 @@ diff -up cups-1.5.0/Makedefs.in.systemd-socket cups-1.5.0/Makedefs.in
# #
diff -up cups-1.5.0/scheduler/client.h.systemd-socket cups-1.5.0/scheduler/client.h diff -up cups-1.5.0/scheduler/client.h.systemd-socket cups-1.5.0/scheduler/client.h
--- cups-1.5.0/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000 --- cups-1.5.0/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000
+++ cups-1.5.0/scheduler/client.h 2011-09-22 13:09:10.016177338 +0100 +++ cups-1.5.0/scheduler/client.h 2011-10-04 11:58:42.559997825 +0100
@@ -75,6 +75,7 @@ typedef struct @@ -75,6 +75,7 @@ typedef struct
int fd; /* File descriptor for this server */ int fd; /* File descriptor for this server */
http_addr_t address; /* Bind address of socket */ http_addr_t address; /* Bind address of socket */
@ -144,7 +156,7 @@ diff -up cups-1.5.0/scheduler/client.h.systemd-socket cups-1.5.0/scheduler/clien
diff -up cups-1.5.0/scheduler/listen.c.systemd-socket cups-1.5.0/scheduler/listen.c diff -up cups-1.5.0/scheduler/listen.c.systemd-socket cups-1.5.0/scheduler/listen.c
--- cups-1.5.0/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100 --- cups-1.5.0/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100
+++ cups-1.5.0/scheduler/listen.c 2011-09-22 13:14:20.173517762 +0100 +++ cups-1.5.0/scheduler/listen.c 2011-10-04 11:58:42.559997825 +0100
@@ -401,7 +401,7 @@ cupsdStopListening(void) @@ -401,7 +401,7 @@ cupsdStopListening(void)
lis; lis;
lis = (cupsd_listener_t *)cupsArrayNext(Listeners)) lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
@ -155,8 +167,8 @@ diff -up cups-1.5.0/scheduler/listen.c.systemd-socket cups-1.5.0/scheduler/liste
#ifdef WIN32 #ifdef WIN32
closesocket(lis->fd); closesocket(lis->fd);
diff -up cups-1.5.0/scheduler/main.c.systemd-socket cups-1.5.0/scheduler/main.c diff -up cups-1.5.0/scheduler/main.c.systemd-socket cups-1.5.0/scheduler/main.c
--- cups-1.5.0/scheduler/main.c.systemd-socket 2011-09-22 13:01:02.871066488 +0100 --- cups-1.5.0/scheduler/main.c.systemd-socket 2011-10-04 11:58:42.507998773 +0100
+++ cups-1.5.0/scheduler/main.c 2011-09-22 13:09:42.409586242 +0100 +++ cups-1.5.0/scheduler/main.c 2011-10-04 11:58:42.561997789 +0100
@@ -26,6 +26,8 @@ @@ -26,6 +26,8 @@
* launchd_checkin() - Check-in with launchd and collect the listening * launchd_checkin() - Check-in with launchd and collect the listening
* fds. * fds.
@ -308,8 +320,8 @@ diff -up cups-1.5.0/scheduler/main.c.systemd-socket cups-1.5.0/scheduler/main.c
/* /*
* 'parent_handler()' - Catch USR1/CHLD signals... * 'parent_handler()' - Catch USR1/CHLD signals...
diff -up cups-1.5.0/scheduler/Makefile.systemd-socket cups-1.5.0/scheduler/Makefile diff -up cups-1.5.0/scheduler/Makefile.systemd-socket cups-1.5.0/scheduler/Makefile
--- cups-1.5.0/scheduler/Makefile.systemd-socket 2011-09-22 13:01:02.884066251 +0100 --- cups-1.5.0/scheduler/Makefile.systemd-socket 2011-10-04 11:58:42.518998573 +0100
+++ cups-1.5.0/scheduler/Makefile 2011-09-22 13:01:02.915065685 +0100 +++ cups-1.5.0/scheduler/Makefile 2011-10-04 11:58:42.562997771 +0100
@@ -41,6 +41,7 @@ CUPSDOBJS = \ @@ -41,6 +41,7 @@ CUPSDOBJS = \
server.o \ server.o \
statbuf.o \ statbuf.o \
@ -334,8 +346,8 @@ diff -up cups-1.5.0/scheduler/Makefile.systemd-socket cups-1.5.0/scheduler/Makef
# #
diff -up cups-1.5.0/scheduler/sd-daemon.c.systemd-socket cups-1.5.0/scheduler/sd-daemon.c diff -up cups-1.5.0/scheduler/sd-daemon.c.systemd-socket cups-1.5.0/scheduler/sd-daemon.c
--- cups-1.5.0/scheduler/sd-daemon.c.systemd-socket 2011-09-22 13:01:02.916065667 +0100 --- cups-1.5.0/scheduler/sd-daemon.c.systemd-socket 2011-10-04 11:58:42.563997752 +0100
+++ cups-1.5.0/scheduler/sd-daemon.c 2011-09-22 13:01:02.917065649 +0100 +++ cups-1.5.0/scheduler/sd-daemon.c 2011-10-04 11:58:42.563997752 +0100
@@ -0,0 +1,520 @@ @@ -0,0 +1,520 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+ +
@ -858,8 +870,8 @@ diff -up cups-1.5.0/scheduler/sd-daemon.c.systemd-socket cups-1.5.0/scheduler/sd
+#endif +#endif
+} +}
diff -up cups-1.5.0/scheduler/sd-daemon.h.systemd-socket cups-1.5.0/scheduler/sd-daemon.h diff -up cups-1.5.0/scheduler/sd-daemon.h.systemd-socket cups-1.5.0/scheduler/sd-daemon.h
--- cups-1.5.0/scheduler/sd-daemon.h.systemd-socket 2011-09-22 13:01:02.917065649 +0100 --- cups-1.5.0/scheduler/sd-daemon.h.systemd-socket 2011-10-04 11:58:42.564997733 +0100
+++ cups-1.5.0/scheduler/sd-daemon.h 2011-09-22 13:01:02.917065649 +0100 +++ cups-1.5.0/scheduler/sd-daemon.h 2011-10-04 11:58:42.564997733 +0100
@@ -0,0 +1,277 @@ @@ -0,0 +1,277 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+ +

View File

@ -13,7 +13,7 @@
Summary: Common Unix Printing System Summary: Common Unix Printing System
Name: cups Name: cups
Version: 1.5.0 Version: 1.5.0
Release: 11%{?dist} Release: 12%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Daemons Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@ -642,6 +642,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/ipptool.1.gz %{_mandir}/man1/ipptool.1.gz
%changelog %changelog
* Tue Oct 4 2011 Tim Waugh <twaugh@redhat.com> 1:1.5.0-12
- Fix for systemd socket activation: relax permissions check for
domain socket in libcups.
* Mon Oct 03 2011 Richard Hughes <rhughes@redhat.com> 1:1.5.0-11 * Mon Oct 03 2011 Richard Hughes <rhughes@redhat.com> 1:1.5.0-11
- Updated colord patch with fixes to DeleteDevice. - Updated colord patch with fixes to DeleteDevice.
- Resolves https://bugzilla.redhat.com/show_bug.cgi?id=741697 - Resolves https://bugzilla.redhat.com/show_bug.cgi?id=741697