Look at exec and system, these
are probably the functions you would use, they both have
ways of letting you know a file was not there to be executed,
or at least, that the command failed...
if they are always going to give you full path to a command
you can use -f filename and -x filename to make sure it is
a file and that the user can execute it...
this sounds a bit like a homework assignment...
- Ant | [reply] |
I would suggest posting a snippet of the code you have written adn someone will probably be able to help with this.
(When posting your code, make sure you use the code tags)
"The social dynamics of the net are a direct consequence of the fact that nobody has yet developed a Remote Strangulation Protocol." -- Larry
Wall | [reply] |
ew ew ew.. who said anything about simple??
- are you sure your user has always good intentions??
- does your user enters the command and you just pass it along? or do you check what he is trying to access and run?
- are you using special keys for special command? or can the user run the command directly?
check for all that, and then, see if it's simple..
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.
Chady | http://chady.net/
| [reply] |