CGI scripts

  • Creator
    Topic
  • #50019
    David Barr
    Participant

      I was just trying to call hcienginerun from a CGI script.  The problem is that the web server runs under a special user-id (www).  I tried writing a setuid wrapper program that would call hcienginerun, but hcienginerun is a Perl script, and it is smart enough to know that it is being called setuid, and it runs with a bunch of security restrictions that prevent it from working.  For example, the library search path reverts to the one that is compiled into Perl, and it can’t find even the default Perl libraries.

      I could try running the web server as Hci, but that’s kind of insecure.  I could try using the suexec module to get it to run as HCI.

      Does anyone have any examples of CGI scripts to start and stop Cloverleaf threads and processes?

    Viewing 0 reply threads
    • Author
      Replies
      • #64541
        Kevan Riley
        Participant

          Threads are easier that processes (from a file owner/user perspective.  Thread start/stops talks to the process over a socket, so the web server user only has to have permissions to run the hcicmd script.  Processes are harder.  I have not yet figured out how to manage processes as another user with still having the process started and owned by hci.  I am probably going to have to resort to sudo.

          Kevan Riley

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.