Run external commands. More...
#include <process.h>


Public Member Functions | |
| systemprocess (const string &mcommand, bool withStdErr=false, const string &asUser="") | |
| systemprocess (const value &args, bool withStdErr=false, const string &asUser="") | |
| systemprocess (const value &args, const value &env, bool withStdErr=false) | |
| virtual | ~systemprocess (void) |
| void | settargetuid (uid_t ruid) |
| void | settargetgid (gid_t rgid) |
| void | initargs (void) |
| virtual int | main (void) |
Protected Member Functions | |
| bool | settargetuser (const string &uname) |
Protected Attributes | |
| value | _argv |
| value | _env |
| uid_t | tuid |
| uid_t | teuid |
| gid_t | tgid |
| gid_t | tegid |
| argptr * | envp |
| argptr * | argp |
| string | cpath |
Run external commands.
Accepts a unix path/command with command line arguments and executes the command as a child process.
| systemprocess::systemprocess | ( | const string & | mcommand, | |
| bool | withStdErr = false, |
|||
| const string & | asUser = "" | |||
| ) | [inline] |
Constructor.
| mcommand | The command string | |
| withStdErr | True if the stderr channel should be caught. | |
| asUser | The user to switch to in the child process. |
References _argv, process::init(), strutil::splitquoted(), tegid, teuid, tgid, and tuid.

| virtual int systemprocess::main | ( | void | ) | [inline, virtual] |
Child process.
Creates an argument list, resolves the path to the file and uses plain old execv() to do the dirty work.
Reimplemented from process.
References argp, cpath, envp, process::fout, file::printf(), string::str(), tegid, teuid, tgid, and tuid.

1.6.1