Write a client and a server that permit client to execute

Assignment Help Basic Computer Science
Reference no: EM131056900

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.

Reference no: EM131056900

Questions Cloud

What is the ph of the new solution : A solution is made up by combining 50 mL of a 0.58 M acetic acid solution and 50 mL of a 2.18 M sodium acetate solution. What is the pH of the new solution?
Range of frequencies and wavelengths : Brookhaven National Laboratory (BNL) recently constructed the National SynchrotronLight Source II (NSLS-II), which provides the world's brightest coherent x-rays for studying materials and biological systems. Beamline 17-ID-2, the Macromolecular C..
Write a paper in which you identify the health care setting : To complete this Application Assignment, write a 3-page paper in which you identify the health care setting (or context) in which each of the four specific systems you selected is used.
How should companies address the problem of public fear : What are the moral issues in this case? What ideals. obligations, and consequences must Carla Lombard consider? What rights. if any are at stake? Will it make a difference whether Carla adopts a Kantian approath or a utilitarian approach to this s..
Write a client and a server that permit client to execute : 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.
The electromagnetic spectrum : Watch the video titled "What Are Gamma Rays?" (1 min 39 sec) under the Gamma Rays terms section of the Science Corner.
Innovative business concept and want to start a new business : Description: With members of your group you are to develop an innovative business concept and want to start a new business venture and you are looking for funding. In order to secure funding you are required to present your innovation and develop ..
Question regarding the molecules location : Two molecules, one polar the other anionic, walk into a bar and have seats equidistance away from you on your right and left. If you are a polar molecule, which of the two molecules are you more attracted to and why? Also, explain why the molec..
Describe marxs theory of the falling rate of profit : Describe Marx's theory of the falling rate of profit and explain its relation to his value theory. Additional RequirementsMin Pages: 2Other Requirements: 1000 words, mla citation.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Compare and contrast the data communication technologies

Compare and contrast the data communication technologies of guided media and unguided media. This should include transmission media, data link control protocols, and multiplexing. Compare digital transmission to analog transmission to determine the a..

  Identify tactical

Conduct research to find examples of the differences between I.T. security controls and countermeasure gap analysis, and identify tactical, strategic, risk mitigation, threats, and vulnerability dimensions and gaps associated with compliance recom..

  Interfaces using code fragment or a complete program

Pick one of the most useful interfaces defined by the .NET framework (e.g. IComparable, IComparer, etc), and describe a real world scenario that you would use one of these interfaces using code fragment or a complete program.

  Display the sum of the numbers entered

Design the logic (pseudocode and diagram) for a program that allows a user to continuously enter numbers until the user enters 0. Display the sum of the numbers entered.

  Write a class that encapsulates the evolution

Write a class (and a client class to test it) that encapsulates the evolution of the sales tax rates in the 50 U.S states over the last 10 years. Your only instance variable should be a two-dimensional array of values representing the sales tax ra..

  Write a java for file processing according to rules

The file is read into memory, all of it in one buffer, and the buffer is reversed, then the file is overwritten. For simplicity, we may assume that the maximum size of the file is 200000 bytes. If no file was selected an error message is displayed..

  What are the advantages of a web server

What are the advantages of a Web server?

  The dom with javascript and traversing the dom with jquery

The DOM with JavaScript and traversing the DOM with jQuery

  A development lifecycle for an ids system

Write a 1-2 page paper on a development lifecycle for an IDS system, including the following: Inception Configuration Deployment

  Topic selection and research paper requirements

Prior to writing your paper, you may choose to submit a short research topic proposal in the form of a short paragraph, to your instructor. If you choose to do so, please email a copy of your paragraph description of your Research Paper topic p..

  Stockiest has to supply 400 units of a product

Stockiest has to supply 400 units of a product every Monday to his customers. He gets the product at Rs. 50/- per unit from the manufacturer. The cost of ordering and transportation from the manufacturer is Rs. 75 per order. The cost of carrying inve..

  What is the probability of net loss of the whole packet

Suppose an IP packet is fragmented into 10 fragments, each with 1% (independent) probability of loss. To a reasonable approximation, this means there is a 10% chance of losing the whole packet due to loss of a fragment. What is the probability of net..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd