I have continued the development of the Snap and did some further commits to the GitHub. Then I have installed in restricted mode:
sudo snap install --dangerous printing-stack-snap_0.1.0_amd64.snap
(using --dangerous
instead of --devmode
). Then I have tried out the checking of admin tasks again and ran
printing-stack-snap.lpadmin -p snap-label -E -v ipp://Label%20Printer._ipp._tcp.local/ -m driverless:ipp://Label%20Printer._ipp._tcp.local/
Note that the URI must exist in your network. To find suitable URIs, run the command
driverless
The print queue is created (it should even if all is working correctly), but in the error_log
, the file
/var/snap/printing-stack-snap/current/var/log/error_log
I saw that it is not working correctly:
D [14/May/2020:19:28:38 +0200] cupsdIsAuthorized: username="till"
D [14/May/2020:19:28:38 +0200] cupsdCheckAdminTask: Administrative task
D [14/May/2020:19:28:38 +0200] cupsdCheckAdminTask: Clent connecting via domain
socket, examining client process 1291963 ...
D [14/May/2020:19:28:38 +0200] cupsdCheckAdminTask: Checking whether client proc
ess is from a Snap ...
D [14/May/2020:19:28:38 +0200] cupsdCheckAdminTask: No AppArmor in use
D [14/May/2020:19:28:38 +0200] cupsdCheckAdminTask: Access granted
D [14/May/2020:19:28:38 +0200] snap-label device-uri: OK
I [14/May/2020:19:28:38 +0200] Setting snap-label device-uri to "ipp://Label%20P
rinter._ipp._tcp.local/" (was "file:///dev/null".)
You see the line with “No AppArmor in use
”. This is wrong, as Snaps use AppArmor to make up the sandboxes. The line comes from the following piece of code in my patch (patches/cupsd-extra-check-for-admin-tasks-snap-cups-control.patch
):
/* If AppArmor is not enabled, then we can't identify the client */
if (!aa_is_enabled())
{
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdCheckAdminTask: No AppArmor in use");
goto snap_check_done;
}
meaning that the function aa_is_enabled()
does not see AppArmor.
@jdstrand, @jamesh, @ijohnson, how does PulseAudio handle this? Do I need to plug another interface? Or do I need access to certain system files.