You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I made a filter for a cups printer in
/usr/lib/cups/filter
like thisAfter 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
The text was updated successfully, but these errors were encountered: