No write access to /tmp

Lars Kusch

New member
Joined
Feb 17, 2023
Messages
4
Hi there,
I'm running a regular Ubuntu 22.04 Server with DirectAdmin and Litespeed.
My customer is running a software which calls:
Code:
exec '/home/admin/domains/blumagine.de/rechnung/vendor/beganovich/snappdf/versions/1105642-Linux_x64/chrome-linux/chrome' '--headless' '--disable-gpu' '--disable-translate' '--disable-extensions' '--disable-sync' '--disable-background-networking' '--disable-software-rasterizer' '--disable-default-apps' '--disable-dev-shm-usage' '--safebrowsing-disable-auto-update' '--run-all-compositor-stages-before-draw' '--no-first-run' '--no-margins' '--no-sandbox' '--print-to-pdf-no-header' '--hide-scrollbars' '--ignore-certificate-errors' '--print-to-pdf=/tmp/pdf_EW2WaF.pdf' '/tmp/html_PYT0Em.html'
, which fails with no write access to /tmp and chrashes the server. As soon as the command is called without the exec statement, it's working perfectly fine.

Does anybody have an idea for this weird issue?

Kind regards,
Lars Kusch
 
Hello,

While it's not clear on why writing to /tmp fails, will it help if you change it to /home/admin/ ?
 
Then it is probably related to a security of the system. Not too sure though.

What if you run your command from CLI ? I mean add your code into a php script and run it from console? Will it work?

Create script.php and add your code into it:

PHP:
<?php
exec(.....);

and then php -f script.php?
 
Hi,
thanks for your help. When the command is executed from php is just runs fine. No issues, all is well
 
Do you run the CLI script.php as the same user or root? What if you run the same script.php from a browser?
 
When running from cli, I was admin, which is the same as the application is. From the webbrowser it fails
 
Last edited:
Back
Top