NAME

ssystem -- secure variant of system()


SYNOPSIS

   int ssystem(char** argv)


DESCRIPTION

ssystem forks off a new process which execs to the path found in argv[0] and passes argv as command line arguments to it. The parent process waits until the spawned off process exits.

SIGINT and SIGQUIT are ignored by the parent process during the lifetime of the subprocess. fflush is invoked to flush all output streams.

In comparison with system, ssystem avoids the involvement of a shell process which includes the possible interpretation of meta characters. This is dangerous if the list of arguments comes from untested user input.


DIAGNOSTICS

In case of errors, -1 is returned. Otherwise, the status of the terminated subprocess is returned.


BUGS

As ssystem does not know about opened pipelines and other opened files, they are shared with the forked-off process.


AUTHOR

Andreas Borchert