See the implementation of system in section 277 for an


Write a client and a server that permit the client to execute arbitrary shell commands on the server host. (If you don't implement any security mechanism in this application, you should ensure that the server is operating under a user account where it can do no damage if invoked by malicious users.) The client should be executed with two command-line argument
After connecting to the server, the client sends the given command to the server, and then closes its writing half of the socket using shutdown(), so that the server sees end-of-file. The server should handle each incoming connection in a separate child process (i.e., a concurrent design). For each incoming connection, the server should read the command from the socket (until end-of-file), and then exec a shell to perform the command. Here are a couple hints:

See the implementation of system() in Section 27.7 for an example of how to execute a shell command.
By using dup2() to duplicate the socket on standard output and standard error, the execed command will automatically write to the socket.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: See the implementation of system in section 277 for an
Reference No:- TGS01402738

Expected delivery within 24 Hours