Koozali.org: home of the SME Server

root permission in php code like server-manager

luisl

root permission in php code like server-manager
« on: December 16, 2005, 04:02:05 PM »
Hi!

I need make and execute a php script that require root permission like

/sbin/e-smith/signal-event ....

The script have to be run from a single php script from a url like

http://mysmeserver/myscript.php

I change with chown and chmod to run script with user(root) permission but with out any good result.


I need the same execute permission of server-manager interfases..

Any body can help me with this ??

exist a howto to implement ssh2_connect funcion in PHP on sme 8-) ??

THANK IN ADVANCE and sorry by my english..

Luis

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: root permission in php code like server-manager
« Reply #1 on: December 16, 2005, 06:09:55 PM »
Quote from: "luisl"

I need make and execute a php script that require root permission like

/sbin/e-smith/signal-event ....


It's not possible, because PHP code runs within the web server process, not as an external program the way that perl scripts do. The perl scripts can be setuid, to change id when they are executed - PHP scripts cannot be.

Perl also has a very important "taint detection" feature which helps to prevent you from making security mistakes in the code. PHP doesn't have such a feature.