0

I'm trying to troubleshoot a printing issue, but first I need to describe my environment (it's a bit non-standard).

I have a HP 1102 USB printer, connected to a Ubuntu 20.04 system which runs CUPS and shares the printer to other systems in the LAN. Printing from other systems (Ubuntu 18.04, Ubuntu 20.04, Windows 10) works fine via IPP.

I have a client which runs Android 10, and on top of it it runs Linux Deploy with Linux 18.04 in a chroot in the same LAN. The linux system has XFCE and CUPS, and I've configured the printer the same way as for other systems.

When I try to print (with local cups set to debug), this is what I get for my job:

D [25/Nov/2020:10:12:01 +0200] [Job 8] Connecting to 192.168.1.13:631
D [25/Nov/2020:10:12:01 +0200] [Job 8] Connecting to printer.
D [25/Nov/2020:10:12:01 +0200] [Job 8] Connection error: Permission denied
E [25/Nov/2020:10:12:01 +0200] [Job 8] The printer is not responding.
D [25/Nov/2020:10:12:31 +0200] [Job 8] Connecting to 192.168.1.13:631
D [25/Nov/2020:10:12:31 +0200] [Job 8] Connecting to printer.
D [25/Nov/2020:10:12:31 +0200] [Job 8] Connection error: Permission denied
E [25/Nov/2020:10:12:31 +0200] [Job 8] The printer is not responding.

I'm doing a packet capture on the cups server side and there are no packets when it says it's trying to connect to the printer. Connecting manually (telnet 192.168.1.13 631 opens a socket and TCP communication works).

Something must be wrong inside the CUPS running on the Android linux chroot, but I can't figure out what. The local print job looks fine, file permissions for the /var/spool/cups directory look fine, cups is running as root.

I'm not sure where to look further for troubleshooting...

I'm watching android logcat trying to see if there is a problem at the same time, and it's this:

11-25 10:28:29.179  2980  3091 W Netd    : No subsystem found in netlink event
11-25 10:28:31.012 20789 20789 I printers.cgi: type=1400 audit(0.0:785): avc: denied { ioctl } for path="socket:[151451]" dev="sockfs" ino=151451 ioctlcmd=0x8933 scontext=u:r:magisk:s0 tcontext=u:r:magisk:s0 tclass=unix_dgram_socket permissive=1

So - I'm thinking cups is trying to create a socket and android is denying it? Any ideas if it's a file-based socket, what it's name would be and where it would be located in the filesystem?

Any suggestions?

Mad_Ady
  • 455
  • 1
  • 6
  • 13
  • I've checked selinux status on the Android side, and it's set to permissive, so that audit warning should be just a warning, it shouldn't impact the running processes. I'd like to attach to it to run a strace next, though I'm not sure which process I need to attach to... ```root@odroidn2:/ # getenforce Permissive ``` – Mad_Ady Nov 26 '20 at 07:47

1 Answers1

0

I managed to find a work-around for my problem. I managed to bypass CUPS on linux (running on top of android) and have the system connect to a remote cups server (which hosts the printer on my LAN). I had to add a /etc/cups/client.conf file with this contents:

AllowAnyRoot Yes
AllowExpiredCerts Yes
Encryption IfRequested
ServerName 192.168.1.13:631

192.168.1.13 is running my actual CUPS server. Now printing works from the Linux chroot under Android!

Mad_Ady
  • 455
  • 1
  • 6
  • 13