THIS DOCUMENT HAS NOT BEEN FINISHED YET This document will contain information on how the wsh works ---- How Does It Work? ----------------- You should ignore this chapter unless you are interested in the technical aspects of the WizPort. This chapter will first describe some non-technical points of tcpserv, the Port part of the WizPort, and then some more technical aspects of the wsh. This document is mostly for those that are interested in hacking the wsh code (you're in for a big surprise! *grin*), or in better understanding the security (for writing executables for the wizshell, etc..) tcpserv ------- When tcpserv is executed it starts to listen to a telnet port, so a connection can be made by telnetting to the machine at that port. When a connection is made, tcpserv sets up a pair of pseudo-ttys in order to handle the input and output. The ttys are then set to handle character-by-character transmission, as well as a number of other things. Then, tcpserv forks off two other processes. One of them executes the program given as an argument to tcpserv. It then hooks this program up to the pseudo-ttys for i/o. One of the tcpserv processes then takes on the job of feeding the i/o back and forth between the psuedo-ttys and the port. Hence, a connection is established to the program from the users telnet client. The psuedo-ttys are needed in order to handle character-by-character transfer properly, and to do terminal emulation stuff (without which, programs such as 'vi' would not be possible) There is one last process, the other tcpserv, which begins listening at the port in order to pick up new connections. So, the number of processes at any time, given 'n' connections is: tcpserv: n+1 program: n wizshell -------- (NOT COMPLETED YET) Programming ----------- Some thoughts for anyone who wants to do some programming to the wsh source: o Make sure you don't use malloc, free or calloc. See config.h (NOT COMPLETED YET)