Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Permission denied when virtual printer prints anywhere other than /tmp/ #462

Open
abingigo opened this issue Feb 13, 2025 · 0 comments
Open

Comments

@abingigo
Copy link

I made a filter for a cups printer in /usr/lib/cups/filter like this

#!/bin/bash
cat "$6" > <myfolder>/$3

After that, I create a printer and then print with the lp command. What happens here is that the filter above is run and is supposed to print a file into the directory supplied. I know that the script is run as a lower privileged user, but ls -l on all the files that are printed by show that it is owned by root.

If <myfolder> is /tmp, this works perfectly. I get a new file created in /tmp with all the data from <filetoprint>. Unfortunately, I want it to print elsewhere, and when I do that, the filter fails, and I get this in the logs

[Job 143] /usr/lib/cups/filter/fileprinter: line 2: <myfolder>/<filename>: Permission denied

The permissions on the filter is 755, and the permissions in the target directory is 777. I have tried changing the owners and permissions multiple times to no avail. This issue occurs everywhere I tried other than in /tmp.

Sorry if this question is out of scope. I went around the cups forums and couldn't find a solution; I have tried everything other than tweaking SELinux.

OS: RHEL 9.5
Cups version: 2.3.3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant