There's a script from Gutenprint (/usr/lib/cups/backend/gutenprint53+usb) which, to be used, needs to set an environment variable i.e:
sudo BACKEND=printerModel /usr/lib/cups/backend/gutenprint53+usb -sin
On my root account and with sudo, i'm able to use it without any problem, on the other hand, i'm trying to run this from my web server and i get the following error:
sudo: sorry, you are not allowed to set the following environment variables: BACKEND
gutenprint53+usb needs to be run with sudo, so i already added the following with sudo visudo:
www-data ALL = NOPASSWD: /usr/lib/cups/backend/gutenprint53+usb
My question is: is there a way for www-data to set the needed environment variable?
Important: the value of BACKEND will vary, so it's not something i can set beforehand with my root account and share it with www-data.
OS: Raspbian GNU/Linux 10 (buster)