version 1.24, 2004/11/07 09:48:08 |
version 1.25, 2006/03/16 19:32:46 |
|
|
char PNbuf[256]; /* This limits the size of a number */ |
char PNbuf[256]; /* This limits the size of a number */ |
|
|
int |
int |
main(argc, argv) |
main(int argc, char *argv[]) |
int argc; |
|
char *argv[]; |
|
{ |
{ |
char *system = NOSTR; |
char *system = NOSTR, sbuf[12], *p; |
int i; |
int i; |
char *p; |
|
char sbuf[12]; |
|
|
|
gid = getgid(); |
gid = getgid(); |
egid = getegid(); |
egid = getegid(); |
|
|
(void)uu_unlock(uucplock); |
(void)uu_unlock(uucplock); |
exit(3); |
exit(3); |
} |
} |
if ((p = connect())) { |
if ((p = con())) { |
printf("\07%s\n[EOT]\n", p); |
printf("\07%s\n[EOT]\n", p); |
daemon_uid(); |
daemon_uid(); |
(void)uu_unlock(uucplock); |
(void)uu_unlock(uucplock); |
|
|
term.c_cc[VTIME] = 0; |
term.c_cc[VTIME] = 0; |
defchars = term; |
defchars = term; |
term.c_cc[VINTR] = term.c_cc[VQUIT] = term.c_cc[VSUSP] = |
term.c_cc[VINTR] = term.c_cc[VQUIT] = term.c_cc[VSUSP] = |
term.c_cc[VDSUSP] = term.c_cc[VDISCARD] = |
term.c_cc[VDSUSP] = term.c_cc[VDISCARD] = |
term.c_cc[VLNEXT] = _POSIX_VDISABLE; |
term.c_cc[VLNEXT] = _POSIX_VDISABLE; |
raw(); |
raw(); |
|
|
pipe(fildes); pipe(repdes); |
pipe(fildes); pipe(repdes); |
|
|
static int uidswapped; |
static int uidswapped; |
|
|
void |
void |
user_uid() |
user_uid(void) |
{ |
{ |
if (uidswapped == 0) { |
if (uidswapped == 0) { |
seteuid(uid); |
seteuid(uid); |
|
|
} |
} |
|
|
void |
void |
daemon_uid() |
daemon_uid(void) |
{ |
{ |
|
|
if (uidswapped) { |
if (uidswapped) { |
|
|
} |
} |
|
|
void |
void |
shell_uid() |
shell_uid(void) |
{ |
{ |
setegid(gid); |
setegid(gid); |
seteuid(uid); |
seteuid(uid); |
|
|
* put the controlling keyboard into raw mode |
* put the controlling keyboard into raw mode |
*/ |
*/ |
void |
void |
raw() |
raw(void) |
{ |
{ |
tcsetattr(0, TCSADRAIN, &term); |
tcsetattr(0, TCSADRAIN, &term); |
} |
} |
|
|
* return keyboard to normal mode |
* return keyboard to normal mode |
*/ |
*/ |
void |
void |
unraw() |
unraw(void) |
{ |
{ |
if (gotdefterm) |
if (gotdefterm) |
tcsetattr(0, TCSADRAIN, &defterm); |
tcsetattr(0, TCSADRAIN, &defterm); |
|
|
* normal erase and kill characters. |
* normal erase and kill characters. |
*/ |
*/ |
int |
int |
prompt(s, p, sz) |
prompt(char *s, char *p, size_t sz) |
char *s; |
|
char *p; |
|
size_t sz; |
|
{ |
{ |
int c; |
int c; |
char *b = p; |
char *b = p; |
|
|
* Interrupt service routine during prompting |
* Interrupt service routine during prompting |
*/ |
*/ |
void |
void |
intprompt() |
intprompt(void) |
{ |
{ |
|
|
(void)signal(SIGINT, SIG_IGN); |
(void)signal(SIGINT, SIG_IGN); |
|
|
* ****TIPIN TIPIN**** |
* ****TIPIN TIPIN**** |
*/ |
*/ |
void |
void |
tipin() |
tipin(void) |
{ |
{ |
char bol = 1; |
char bol = 1; |
int gch; |
int gch; |
|
|
* called on recognition of ``escapec'' at the beginning of a line |
* called on recognition of ``escapec'' at the beginning of a line |
*/ |
*/ |
int |
int |
escape() |
escape(void) |
{ |
{ |
int gch; |
int gch; |
esctable_t *p; |
esctable_t *p; |
|
|
} |
} |
|
|
int |
int |
any(cc, p) |
any(int cc, char *p) |
int cc; |
|
char *p; |
|
{ |
{ |
char c = cc; |
char c = cc; |
while (p && *p) |
while (p && *p) |
|
|
} |
} |
|
|
int |
int |
size(s) |
size(char *s) |
char *s; |
|
{ |
{ |
int i = 0; |
int i = 0; |
|
|
|
|
} |
} |
|
|
char * |
char * |
interp(s) |
interp(char *s) |
char *s; |
|
{ |
{ |
static char buf[256]; |
static char buf[256]; |
char *p = buf, c, *q; |
char *p = buf, c, *q; |
|
|
} |
} |
|
|
char * |
char * |
ctrl(c) |
ctrl(char c) |
char c; |
|
{ |
{ |
static char s[3]; |
static char s[3]; |
|
|
|
|
* Help command |
* Help command |
*/ |
*/ |
void |
void |
help(c) |
help(char c) |
char c; |
|
{ |
{ |
esctable_t *p; |
esctable_t *p; |
|
|
|
|
* Set up the "remote" tty's state |
* Set up the "remote" tty's state |
*/ |
*/ |
int |
int |
ttysetup(speed) |
ttysetup(int speed) |
int speed; |
|
{ |
{ |
struct termios cntrl; |
struct termios cntrl; |
|
|
|
|
if (boolean(value(DC))) |
if (boolean(value(DC))) |
cntrl.c_cflag |= CLOCAL; |
cntrl.c_cflag |= CLOCAL; |
if (boolean(value(HARDWAREFLOW))) |
if (boolean(value(HARDWAREFLOW))) |
cntrl.c_cflag |= CRTSCTS; |
cntrl.c_cflag |= CRTSCTS; |
cntrl.c_iflag &= ~(ISTRIP|ICRNL); |
cntrl.c_iflag &= ~(ISTRIP|ICRNL); |
cntrl.c_oflag &= ~OPOST; |
cntrl.c_oflag &= ~OPOST; |
cntrl.c_lflag &= ~(ICANON|ISIG|IEXTEN|ECHO); |
cntrl.c_lflag &= ~(ICANON|ISIG|IEXTEN|ECHO); |
|
|
* with the right parity and output it. |
* with the right parity and output it. |
*/ |
*/ |
void |
void |
parwrite(fd, buf, n) |
parwrite(int fd, char *buf, int n) |
int fd; |
|
char *buf; |
|
int n; |
|
{ |
{ |
int i; |
int i; |
char *bp; |
char *bp; |
|
|
* Build a parity table with appropriate high-order bit. |
* Build a parity table with appropriate high-order bit. |
*/ |
*/ |
void |
void |
setparity(defparity) |
setparity(char *defparity) |
char *defparity; |
|
{ |
{ |
int i, flip, clr, set; |
int i, flip, clr, set; |
char *parity; |
char *parity; |