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

  Writing java program which can develop anagrams

An anagram is a rearrangement of the letters of a word or phrase into a new word or phrase. Some of them can be quite amusing or apt. For example:

  Develop your understanding of the kinds of bizarre problems

Develop your understanding of the kinds of bizarre problems a system administrator will have to handle. The first part depicts an organization in a bad state. Your job is to devise a scheme to fix it.

  Compare b-mac, z-mac and s-mac for wireless sensor networks

Compare B-MAC, Z-MAC and S-MAC for wireless sensor networks.

  The strike predicate need not work

Define a predicate strike(X,Y,Z) that succeeds if and only if the list Z would be obtained if one were to remove all occurrences of element X from list Y. The strike predicate need not work well when Y is an unbound variable.

  Is this papers account of benefits of xbrl similar

The deliverable is a two to three page paper that includes a brief summary of this material, and consideration of the following idea. Is this paper's account of benefits of XBRL similar to the book's.

  Create a data dictionary for the database you just created

Build a simple database based on the following instructions and the information covered in module 5. The database should include at least 3 tables that are related, and each of which must have at least 8 attributes

  Show how you will go about normalizing it

Show how you will go about normalizing it.

  Benefit from implementing locking methods

Describe how locks could be used in order to qualify data transactions and enhance concurrency control. Suggest at least two business scenarios that would benefit from implementing locking methods.

  What is the difference between a combination

Assume that the probability of a server failing over night is p = 0.1. If you have 1000 servers, what is the probability that 100 servers will have failed over night?

  Build the design using a data modeling tool

build the design using a data modeling tool

  Write a class name circle

Circle Class. Write a class name Circle, with the class declaration in a file called Circle.h and the implementation in a file called Circle.cpp. The class will have two data members, a double that holds the radius of the circle and a double called p..

  Advantages to physical servers

Are there any advantages to physical servers that would preclude someone from usingvirtual machines? At what point do you think the inherent cost savings and manageabilityadvantages that virtual machines provide would outweigh the physical ser..

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