Mailing List Archive

Fwd: Script behaving differently when run by Apache and when run from a shell by user www-data?
> Let's take a step back - why are you unmounting from a cgi script?

It's a one-time setup when a user configures a new system. Most of these
users aren't shell-literate, so they configure by ticking boxes on a web
page. The system is a VPS, so is actually a VM, which I hope isn't relevant.

Anyway, when configuration completes, all the scripts are deleted and
Apache runs 'normally'.
Re: Script behaving differently when run by Apache and when run from a shell by user www-data? [ In reply to ]
On Tue, Jan 23, 2024 at 2:12?PM EML <sa212+apache@cyconix.com> wrote:

>
> Let's take a step back - why are you unmounting from a cgi script?
>
> It's a one-time setup when a user configures a new system. Most of these
> users aren't shell-literate, so they configure by ticking boxes on a web
> page. The system is a VPS, so is actually a VM, which I hope isn't relevant.
>
> Anyway, when configuration completes, all the scripts are deleted and
> Apache runs 'normally'.
>

IMO suexec would be better suited to handle more sensitive operations such
as unmounting.

CGI is not an interactive shell, as you discovered.

Calling a separate script with the suid bit might work too.