Cmd_api_exec

Djunity

Verified User
Joined
Mar 9, 2008
Messages
243
Location
Holland
Hi,

I came across the following option CMD_API_EXEC http://www.directadmin.com/features.php?id=657 this can come in handy in what i was planning to do.
The problem im running in to is that the script that i want to be executed can only run as root user so CM_API_EXEC will return error about privileges.
Is there a way so solve this ?
 
I believe that what you're writing is that you want to have CMD_API_EXEC run a script with root privileges even though the script that's calling it isn't root.

You can run your script as root, which means that CMD_API_EXEC will run with root privileges, but you should make sure it's not an insecurity in your environment.

Information here (devshed.com).

Jeff
 
Hi Jeff,

The script that i want to call can only be run with superuser privileges.

What i want to to is this:
We run csf on all or servers but it does not have an api for example to remove an ip from the firewall, so i want to use CMD_API_EXEC to call csf and do it like this way, but csf can only be run as superuser as been posted on csf form to.
 
@Djunity,

Find or write a simple C wrapper. You might want to search the forums for "wrapper". It will help you to switch from an user to root.
 
Back
Top