diff -Nru cups-pk-helper-0.2.6/debian/changelog cups-pk-helper-0.2.6/debian/changelog --- cups-pk-helper-0.2.6/debian/changelog 2016-08-11 00:05:05.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/changelog 2017-12-19 19:50:31.000000000 +0800 @@ -1,3 +1,29 @@ +cups-pk-helper (0.2.6-1ubuntu4~artful1) artful; urgency=medium + + * debian/patches/Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch + - Use lpadmin in org.opensuse.CupsPkHelper.Mechanis.conf + instead of root + + -- Shem Pasamba Tue, 19 Dec 2017 19:50:31 +0800 + +cups-pk-helper (0.2.6-1ubuntu3~artful1) artful; urgency=medium + + * Recompile for artful + + -- Shem Pasamba Thu, 14 Dec 2017 11:00:48 +0800 + +cups-pk-helper (0.2.6-1ubuntu2) zesty; urgency=medium + + * debian/patches/run_as_lpadmin.patch + - Make the cups-pk-helper run as lpadmin passing lpadmin as user too. + * debian/cups-pk-helper.postinst: + - Add lpadmin group and user. + * debian/cups-pk-helper.postrm: + - Remove lpadmin user and group. + * Added --with-daemon-user + + -- Shem Pasamba Tue, 11 Jul 2017 23:00:57 +0800 + cups-pk-helper (0.2.6-1ubuntu1) yakkety; urgency=medium * Resynchronize on Debiann remaining changes diff -Nru cups-pk-helper-0.2.6/debian/cups-pk-helper.postinst cups-pk-helper-0.2.6/debian/cups-pk-helper.postinst --- cups-pk-helper-0.2.6/debian/cups-pk-helper.postinst 1970-01-01 08:00:00.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/cups-pk-helper.postinst 2017-12-19 19:50:31.000000000 +0800 @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + if ! getent group lpadmin > /dev/null; then + addgroup --quiet --system lpadmin + fi + + adduser --system --no-create-home --quiet --gecos "user for cups-pk-helper service" \ + --ingroup lpadmin lpadmin + ;; +esac + +#DEBHELPER# + +exit 0 diff -Nru cups-pk-helper-0.2.6/debian/cups-pk-helper.postrm cups-pk-helper-0.2.6/debian/cups-pk-helper.postrm --- cups-pk-helper-0.2.6/debian/cups-pk-helper.postrm 1970-01-01 08:00:00.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/cups-pk-helper.postrm 2017-12-19 19:50:31.000000000 +0800 @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in + purge) + deluser lpadmin + ;; +esac + +#DEBHELPER# + +exit 0 diff -Nru cups-pk-helper-0.2.6/debian/patches/run_as_lpadmin.patch cups-pk-helper-0.2.6/debian/patches/run_as_lpadmin.patch --- cups-pk-helper-0.2.6/debian/patches/run_as_lpadmin.patch 1970-01-01 08:00:00.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/patches/run_as_lpadmin.patch 2017-12-19 19:50:31.000000000 +0800 @@ -0,0 +1,223 @@ +Description: Enable running of cups-pk-helper as lpadmin + Enable running of cups-pk-helper as lpadmin by adding annotations + to the policy fie and adding --with-daemon-user to configure.ac + to make the cups-pk-helper dbus service run as lpadmin. + . + cups-pk-helper (0.2.6-1ubuntu2) zesty; urgency=medium + . + * debian/patches/run_as_lpadmin.patch + - Make the cups-pk-helper run as lpadmin passing lpadmin as user too. + * debian/cups-pk-helper.postinst: + - Add lpadmin group and user. + * debian/cups-pk-helper.postrm: + - Remove lpadmin user and group. + * Added --with-daemon-user +Author: Shem Pasamba + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2017-07-12 + +--- cups-pk-helper-0.2.6.orig/configure.ac ++++ cups-pk-helper-0.2.6/configure.ac +@@ -54,6 +54,17 @@ AC_SUBST(CUPS_LIBS) + + AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen]) + ++# custom daemon user ++AC_ARG_WITH( ++ [daemon_user], ++ AC_HELP_STRING([--with-daemon-user], ++ [User for running the cups-pk-helper dbus service (default: root)]), ++ [daemon_user=$withval], ++ [daemon_user=root] ++) ++AC_SUBST(daemon_user) ++AC_DEFINE_UNQUOTED([DAEMON_USER], ["$daemon_user"], [Daemon user]) ++ + AC_OUTPUT([ + Makefile + src/Makefile +--- cups-pk-helper-0.2.6.orig/po/POTFILES.in ++++ cups-pk-helper-0.2.6/po/POTFILES.in +@@ -2,3 +2,4 @@ + # Please keep this file sorted alphabetically. + [encoding: UTF-8] + src/org.opensuse.cupspkhelper.mechanism.policy.in ++src/org.opensuse.cupspkhelper.mechanism.policy.in.in +--- cups-pk-helper-0.2.6.orig/src/Makefile.am ++++ cups-pk-helper-0.2.6/src/Makefile.am +@@ -67,7 +67,14 @@ dbus_services_in_files = org.opensuse.Cu + dbus_services_DATA = $(dbus_services_in_files:.service.in=.service) + + $(dbus_services_DATA): $(dbus_services_in_files) +- $(AM_V_GEN)sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@ ++ $(AM_V_GEN)sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@DAEMON_USER\@|$(daemon_user)|" $< > $@ ++ ++org.opensuse.cupspkhelper.mechanism.policy.in: org.opensuse.cupspkhelper.mechanism.policy.in.in Makefile ++ $(AM_V_GEN)if test "x$(daemon_user)" != "xroot"; then \ ++ sed -e "s||unix-user:$(daemon_user)|g" $< > $@ ; \ ++ else \ ++ sed -e "/^\s*\s*$$/d;s|||g" $< > $@ ; \ ++ fi + + polkitdir = $(datadir)/polkit-1/actions + polkit_in_files = org.opensuse.cupspkhelper.mechanism.policy.in +--- cups-pk-helper-0.2.6.orig/src/org.opensuse.CupsPkHelper.Mechanism.service.in ++++ cups-pk-helper-0.2.6/src/org.opensuse.CupsPkHelper.Mechanism.service.in +@@ -1,4 +1,4 @@ + [D-BUS Service] + Name=org.opensuse.CupsPkHelper.Mechanism + Exec=@LIBEXECDIR@/cups-pk-helper-mechanism +-User=root ++User=@DAEMON_USER@ +--- /dev/null ++++ cups-pk-helper-0.2.6/src/org.opensuse.cupspkhelper.mechanism.policy.in.in +@@ -0,0 +1,138 @@ ++ ++ ++ ++ ++ The openSUSE Project ++ http://www.opensuse.org/ ++ printer ++ ++ ++ <_description>Get/Set server settings ++ <_message>Privileges are required to get/set server settings. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Get list of available devices ++ <_message>Privileges are required to get list of available devices. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ ++ <_description>Set a printer as default printer ++ <_message>Privileges are required to set a printer, or a class, as default printer. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ ++ <_description>Enable/Disable a printer ++ <_message>Privileges are required to enable/disable a printer, or a class. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Add/Remove/Edit a local printer ++ <_message>Privileges are required to add/remove/edit a local printer. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Add/Remove/Edit a remote printer ++ <_message>Privileges are required to add/remove/edit a remote printer. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Add/Remove/Edit a class ++ <_message>Privileges are required to add/remove/edit a class. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Restart/Cancel/Edit a job ++ <_message>Privileges are required to restart/cancel/edit a job. ++ ++ auth_admin ++ auth_admin ++ yes ++ ++ ++ ++ ++ ++ <_description>Restart/Cancel/Edit a job owned by another user ++ <_message>Privileges are required to restart/cancel/edit a job owned by another user. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ <_description>Change printer settings ++ <_message>Privileges are required to change printer settings. This should only be needed from the Printers system settings panel. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ ++ ++ ++ <_description>Add/Remove/Edit a printer ++ <_message>Privileges are required to add/remove/edit a printer. ++ ++ auth_admin ++ auth_admin ++ auth_admin_keep ++ ++ ++ ++ diff -Nru cups-pk-helper-0.2.6/debian/patches/series cups-pk-helper-0.2.6/debian/patches/series --- cups-pk-helper-0.2.6/debian/patches/series 2016-07-21 17:49:51.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/patches/series 2017-12-19 19:50:31.000000000 +0800 @@ -4,3 +4,5 @@ Don-t-compare-signed-and-unsigned-int.patch Add-default-statements-to-silence-compiler-warnings.patch Don-t-use-g_type_init-on-recent-glib.patch +run_as_lpadmin.patch +Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch diff -Nru cups-pk-helper-0.2.6/debian/patches/Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch cups-pk-helper-0.2.6/debian/patches/Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch --- cups-pk-helper-0.2.6/debian/patches/Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch 1970-01-01 08:00:00.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/patches/Use_lpadmin_in_org.opensuse.CupsPkHelper.Mechanism.conf.patch 2017-12-19 19:50:31.000000000 +0800 @@ -0,0 +1,31 @@ +Description: Use lpadmin in *Mechanism.conf + . + cups-pk-helper (0.2.6-1ubuntu4~artful1) artful; urgency=medium + . + * Try: prevent delete of other's jobs +Author: Shem Pasamba + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2017-12-20 + +--- cups-pk-helper-0.2.6.orig/src/org.opensuse.CupsPkHelper.Mechanism.conf ++++ cups-pk-helper-0.2.6/src/org.opensuse.CupsPkHelper.Mechanism.conf +@@ -6,7 +6,7 @@ + + + +- ++ + + + diff -Nru cups-pk-helper-0.2.6/debian/rules cups-pk-helper-0.2.6/debian/rules --- cups-pk-helper-0.2.6/debian/rules 2016-08-11 00:04:36.000000000 +0800 +++ cups-pk-helper-0.2.6/debian/rules 2017-12-19 19:50:31.000000000 +0800 @@ -14,5 +14,5 @@ dh $@ --with autoreconf override_dh_auto_configure: - dh_auto_configure -- --enable-compile-warnings=yes + dh_auto_configure -- --enable-compile-warnings=yes --with-daemon-user=lpadmin