I have a plugin that is run from the user level, but portions of it need root access to modify certain files.
Unless somebody can provide a workaround I would like to make a request to provide at least some ideas of how to workaround this.
Idea 1: All plugins be run with root/admin permissions by default. Scripts would then reduce their access level to the running users using for example, php's posix module. That would allow portions of the script to run as root as needed, however this method may not be considered safe?
Idea 2: DirectAdmin provides a gateway of sorts in which the plugin tells the gateway what needs to be run and at what access level. The "gateway" does so accordingly and returns the results.
Idea 3: One specific filename is set aside for plugins which will be run as root. For example root.php could be run as root when DirectAdmin executes it. A php script in that plugin could then issue DirectAdmin the command to execute that one script as root, however it might be hard to pass information between the two scripts.
Those are just ideas, I look forward to some feedback on how to get a script or portions of a php script to run as root when executed by DirectAdmin.
(Only other workaround is make the necassary files world readable/writable which is probably even less safe than idea 1)
Unless somebody can provide a workaround I would like to make a request to provide at least some ideas of how to workaround this.
Idea 1: All plugins be run with root/admin permissions by default. Scripts would then reduce their access level to the running users using for example, php's posix module. That would allow portions of the script to run as root as needed, however this method may not be considered safe?
Idea 2: DirectAdmin provides a gateway of sorts in which the plugin tells the gateway what needs to be run and at what access level. The "gateway" does so accordingly and returns the results.
Idea 3: One specific filename is set aside for plugins which will be run as root. For example root.php could be run as root when DirectAdmin executes it. A php script in that plugin could then issue DirectAdmin the command to execute that one script as root, however it might be hard to pass information between the two scripts.
Those are just ideas, I look forward to some feedback on how to get a script or portions of a php script to run as root when executed by DirectAdmin.
(Only other workaround is make the necassary files world readable/writable which is probably even less safe than idea 1)