c++ system() on linux?
Go to solution
Solved by trag1c,
Same reason as windows System() executes another executable which can be replaced by anyone. It's also fairly heavy on resources.
Consider CreateProcess() on windows and fork() and exec() on linux for starting applications. Since these create new processes they're independent from the master process and are subject to their own privileges.
E.g. main process is administrator access the secondary is only user access if configured that way. System would make both processes with admin rights which is extremely bad if another program hijacked the executable of the second process.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now