--- libptytty/README 2006/01/23 12:37:09 1.4 +++ libptytty/README 2006/09/11 14:11:26 1.6 @@ -35,6 +35,9 @@ // we are done with it ptytty_delete (pty); + See also the eg/ directory, which currently contains the c-sample.c file + that spawns a loginshell from C using libptytty. + DESCRIPTION Libptytty is a small library that offers pseudo-tty management in an OS-independent way. It was created out of frustration over the many @@ -70,7 +73,7 @@ // initialise, parse arguments, etc. } - This checks wether the program runs setuid or setgid. If yes then it + This checks whether the program runs setuid or setgid. If yes then it will fork a helper process and drop privileges. Some programs need finer control over if and when this helper process is @@ -85,9 +88,9 @@ as the first thing in the "main" function, or earlier e.g. during static construction time. The earlier, the better. - This method checks wether the program runs with setuid/setgid + This method checks whether the program runs with setuid/setgid permissions and, if yes, spawns a helper process for pty/tty - management. IT then drops the privileges completely, so the actual + management. It then drops the privileges completely, so the actual program runs without setuid/setgid privileges. ptytty::use_helper () @@ -100,12 +103,12 @@ daemon). This method will try not to start more than one helper process. The - same helper process cna usually be used form the process starting it - an all its fork'ed (not exec'ed) children + same helper process can usually be used both from the process + starting it and all its fork'ed (not exec'ed) children. ptytty::drop_privileges () Drops privileges completely, i.e. sets real, effective and saved - user id to the real user id. Also aborts if this cnanot be achieved. + user id to the real user id. Also aborts if this cannot be achieved. Useful to make sure that the process doesn't run with special privileges. @@ -142,8 +145,8 @@ pty->login (int cmd_pid, bool login_shell, const char *hostname) Creates an entry in the systems session database(s) (utmp, wtmp, lastlog). "cmd_pid" must be the pid of the process representing the - session (such as the login shell), "login_shell" defines wether the - session is associated with a login, which influences wether wtmp and + session (such as the login shell), "login_shell" defines whether the + session is associated with a login, which influences whether wtmp and lastlog entries are created, and "hostname" should identify the "hostname" the user logs in from, which often is the value of the "DISPLAY" variable or tty line in case of local logins. @@ -160,8 +163,8 @@ pty->set_utf8_mode (bool on) On systems supporting special UTF-8 line disciplines (e.g. Linux), - tries to enable it for the given pty. Can be called at any time to - change the mode. + this tries to enable this discipline for the given pty. Can be + called at any time to change the mode. C INTERFACE: THE ptytty FAMILY OF FUNCTIONS ptytty_init () @@ -169,7 +172,7 @@ PTYTTY ptytty_create () Creates a new opaque PTYTTY object and returns it. Do not try to - access it in any way excecp by testing it for truthness (e.g. "if + access it in any way except by testing it for truthness (e.g. "if (pty) ...."). See "ptytty::create ()". int ptytty_pty (PTYTTY ptytty)