CUPS printing fix

Moderator: BarryK

Post Reply
User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

CUPS printing fix

Post by BarryK »

Testing the new EasyOS Kirkstone-series, printing was broken, and fixed it, see blog post:

https://bkhome.org/news/202212/required ... -cups.html

Well, it turns out that the Dunfell-series also has the same problem. Federico sent me an email that when printing, there is a popup requiring root login, which he found to be very annoying.

Federico found that the same fix applied to the Kirkstone-series also worked for him. This is part of his email:

Dear Barry,
we applied the patch you suggested.
- we created the file cups_spot_fix.sh inside the /root/Startup folder
- we gave it execution permissions
- we pasted the following lines inside it:

Code: Select all

FSCRYPTID="$(grep ' logon ' /proc/keys | head -n 1 | cut -f 1 -d ' ')"
if [ "$FSCRYPTID" ];then
 su -l spot -c "grep -q '_uid\.502' /proc/keys || keyctl link 0x${FSCRYPTID} @us"
fi

It worked perfectly. We are not experiencing any more problems with CUPS by now.
We are particularly thankful to you for the immediacy of the support you provided us.
We are also glad for the fact that this information may also be helpful to other people.
We wish you a happy new year.

Very interesting. I surmise that when 'cupsd' was unable to execute a filter utility as user 'spot', it then popped up a window asking for root access. It already has root access, but I suppose it asks for security reasons.

Anyway, it is good news that the fix works for the Dunfell-series also. Here is the github commit:

https://github.com/bkauler/woofq/commit ... 9761fd0dbf

workingdog
Posts: 5
Joined: Mon Jan 23, 2023 12:06 am
Has thanked: 3 times

Re: CUPS printing fix

Post by workingdog »

Trying to decide if I jump from Xenial Puppy to EasyOS.

Can someone tell me how to create the cups_spot_fix folder so CUPS works? This is all new to me. Is it simply a matter of going to the terminal and writing it in? I thought when you write code it has to be compiled into machine language? Would this code be included in a later release so new people are not chasing the solution?

ttps://github.com/bkauler/woofq/commit/9c85f20f76cac32de68231eb08d9119761fd0dbf
https://bkhome.org/news/202212/required ... -cups.html

echo "/root/Startup/cups_spot_fix:"
FSCRYPTID="$(grep ' logon ' /proc/keys | head -n 1 | cut -f 1 -d ' ')"
if [ "$FSCRYPTID" ];then
su -l spot -c "grep -q '_uid\.502' /proc/keys || keyctl link 0x${FSCRYPTID} @us"
fi

Also of interest. https://forum.puppylinux.com/viewtopic. ... 6&start=10

In that post Airdale says 'So I set permissions for both /usr/libexec/cups/backend and /usr/libexec/cups/filter to permissions 555 recursively.
Now CUPS works perfectly and I can add printers and print'...By default it looks like the permissions for these folders were 777.'

I navigated to 'backend' and 'filter' but was stumped. There was a pop up for changing permissions, but that was simply the read/write permissions. I tried opening some documents in 'backend' and 'filter' expecting I would find references to '777' that could be overwritten with '555', but nothing.

Caramel
Posts: 320
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 78 times
Been thanked: 51 times

Re: CUPS printing fix

Post by Caramel »

cups_spot_fix is a file (a script file) not a folder.
It is already installed in the last version of EasyOs (4.5.5)

workingdog wrote: Thu Jan 26, 2023 8:00 am

I tried opening some documents in 'backend' and 'filter' expecting I would find references to '777' that could be overwritten with '555', but nothing.

777 and 555 are permissions written in octal values
See for example : https://www.redhat.com/sysadmin/linux-f ... -explained

workingdog wrote: Thu Jan 26, 2023 8:00 am

In that post Airdale says 'So I set permissions for both /usr/libexec/cups/backend and /usr/libexec/cups/filter to permissions 555 recursively.
Now CUPS works perfectly and I can add printers and print'...By default it looks like the permissions for these folders were 777.'

It's a old topic on EasyOS 3.2 and it is probably no longer relevant

workingdog
Posts: 5
Joined: Mon Jan 23, 2023 12:06 am
Has thanked: 3 times

Re: CUPS printing fix

Post by workingdog »

Caramel wrote: Thu Jan 26, 2023 10:11 am

It is already installed in the last version of EasyOs (4.5.5)

Thanks Caramel.

I originally followed a link from Barry's page on building the OS, which took me to the 2022 iterations, latest being 4.5 - November 2022. https://distro.ibiblio.org/easyos/amd64 ... fell/2022/

With your knowledge I did a Google search for EasyOS 4.5.5 and got the 2023 iterations. https://distro.ibiblio.org/easyos/amd64 ... fell/2023/

Now I'll know just to change the 2 in the address field with 3 etc.

Guess I'll start all over again...sigh! The hardest thing now is not burning the program but hunting favourite applications.

Post Reply

Return to “EasyOS”