rlogind.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include <utmp.h>
#include <net/hton.h>
#include "rlogind.h"

Include dependency graph for rlogind.c:

Go to the source code of this file.

Defines

#define EXTERN
#define ENVSIZE   (sizeof("TERM=")-1)

Functions

static void do_child (int tty_fd, char *tty_str)
static void dealloc_term (int slot, char *tty_str, int pid)
static void wtmp (char *user, char *id, char *line, int pid, int type, int slot)
static void setup_term (int fd)
static speed_t num2speed (int num)
static int do_control (char *buf, int cnt)
static void readall (char *buf, int cnt)
int main (int argc, char *argv[])
void fatal (int fd, char *msg, int err)

Variables

char pty_str [] = "/dev/ptyXX"
char tty_str [] = "/dev/ttyXX"
char hex_str [16] = "0123456789abcdef"
char PATH_UTMP [] = "/etc/utmp"
char PATH_WTMP [] = "/usr/adm/wtmp"
char term [64] = "TERM="
int confirmed = 0
char * env [2]
char * args [10]


Define Documentation

#define ENVSIZE   (sizeof("TERM=")-1)
 

Definition at line 34 of file rlogind.c.

#define EXTERN
 

Definition at line 23 of file rlogind.c.


Function Documentation

static void dealloc_term int  slot,
char *  tty_str,
int  pid
[static]
 

Definition at line 265 of file rlogind.c.

References chmod, chown, DEAD_PROCESS, and wtmp().

static void do_child int  tty_fd,
char *  tty_str
[static]
 

Definition at line 198 of file rlogind.c.

References _exit, args, authenticated, close, dup2, ENOENT, errno, execve, exit(), fdopen(), fflush(), fprintf(), hostname, lusername, O_RDWR, open, printf, prog_name, setsid, setup_term(), stderr, and strerror().

Referenced by main().

static int do_control char *  buf,
int  cnt
[static]
 

Definition at line 404 of file rlogind.c.

References fprintf(), ioctl, memcpy(), ntohs, readall(), stderr, TIOCSWINSZ, and winsize.

void fatal int  fd,
char *  msg,
int  err
 

Definition at line 333 of file rlogind.c.

int main int  argc,
char *  argv[]
 

Definition at line 47 of file rlogind.c.

References authenticate(), bytes, confirmed, count, cp, error, hex_str, i, j, lp, O_RDWR, open, prog_name, pty_str, stat, tcp_urg(), write, and write_pid().

static speed_t num2speed int  num  )  [static]
 

Definition at line 379 of file rlogind.c.

References B0, B110, B1200, B134, B150, B1800, B19200, B200, B2400, B300, B38400, B4800, B50, B600, B75, B9600, and i.

Referenced by setup_term().

static void readall char *  buf,
int  cnt
[static]
 

Definition at line 443 of file rlogind.c.

References read.

Referenced by do_control().

static void setup_term int  fd  )  [static]
 

Definition at line 349 of file rlogind.c.

References B0, cfsetispeed, cfsetospeed, check, cp, num(), num2speed(), strchr, strtol(), tcgetattr, TCSANOW, tcsetattr, and term.

Referenced by do_child().

static void wtmp char *  user,
char *  id,
char *  line,
int  pid,
int  type,
int  slot
[static]
 

Definition at line 274 of file rlogind.c.

References close, DEAD_PROCESS, hostname, INIT_PROCESS, log(), LOGIN_PROCESS, lseek, memset(), O_APPEND, O_RDONLY, O_WRONLY, open, p, PATH_UTMP, PATH_WTMP, read, SEEK_SET, strncpy(), strrchr(), time, time_t, USER_PROCESS, and write.

Referenced by dealloc_term(), main(), startup(), and write_log().


Variable Documentation

char* args[10]
 

Definition at line 37 of file rlogind.c.

int confirmed = 0
 

Definition at line 35 of file rlogind.c.

Referenced by fatal(), and main().

char* env[2]
 

Definition at line 36 of file rlogind.c.

char hex_str[16] = "0123456789abcdef"
 

Definition at line 28 of file rlogind.c.

Referenced by main().

char PATH_UTMP[] = "/etc/utmp"
 

Definition at line 30 of file rlogind.c.

Referenced by main(), and wtmp().

char PATH_WTMP[] = "/usr/adm/wtmp"
 

Definition at line 31 of file rlogind.c.

Referenced by wtmp().

char pty_str[] = "/dev/ptyXX"
 

Definition at line 26 of file rlogind.c.

Referenced by main().

char term[64] = "TERM="
 

Definition at line 33 of file rlogind.c.

Referenced by authenticate(), init(), Init_Termcap(), init_tty(), initscr(), main(), primary(), Set_Term(), setup_term(), tgetent(), and TTYinfo().

char tty_str[] = "/dev/ttyXX"
 

Definition at line 27 of file rlogind.c.


Generated on Fri Apr 14 23:06:01 2006 for minix by  doxygen 1.4.6