zssh-1.5c.debian.1.orig/0000700000175000017500000000000010363023753013462 5ustar bartbartzssh-1.5c.debian.1.orig/FAQ0000600000175000017500000000623507356432613014033 0ustar bartbart zssh FAQ ------------------------ 1) It doesn't even compile ! What should i do ? Chances are your OS has not been tested yet. First delete config.h.in and remake it using autoheader (you need autoconf installed). The configure script can be regenerated using autoconf ... 2) It doesn't seem to work ! pressing ^@ (C-space) is ineffective. You are maybe using a console/terminal emulator that does not allow you to generate this code (Gnome Terminal is affected), or your window manager is using this key, so underlying applications won't ever see it ... Try using another terminal emulator/escape sequence. To change the escape sequence, either define the ZSSHESCAPE variable or use the -z option for zssh. 3) It just doesn't transmit any file, though i invoke the sz/rz commands as explained in the man page. zssh depends on 3 other binaries to operate properly : ssh, sz and rz. ssh is run from the local machine, sz and rz are run from _both_ the local and remote machine. Actually, when downloading remote runs sz, local runs rz uploading local runs sz, remote runs rz. zssh thus depends on the rz/sz package to be working on both machines, _and_ of compatible versions. Make sure the problem does not come from sz/rz before suspecting zssh. 4) I don't get my shell prompt back after file transfer completes !!! Just press return 2 or 3 times and stay calm =) 5) File transfer is initiated but never completes ( ie a line like : Bytes Sent: 38144/4610624 BPS:3424 ETA 22:15 or Bytes Sent: 0/ 513 BPS:0 ETA 00:00 Retry 0: Got ZCAN can be seen, but transfer never completes ) Chances are the pty/tty on one of the systems are not 8-bit clean. (Linux is 8-bit clean, NetBSD is not) Using the -e (escape) option of sz should solve this problem. 6) It still doesn't work Beware that any program interferring (ie non transparent) with the tty/pty chain will likely prevent file tranfers from working. For example, running 'screen' on the REMOTE side will prevent zssh from working properly because it will be messing things between sz and rz : ------------------------REMOTE---------------------- ----------------------------LOCAL--------------------------- ************** / ** sz ** ****** ********** ******** ******* |/ /| ************** ** rz ** ** screen ** ** sshd ** <==ssh_channel==> ** ssh ** / should neither be insecure, nor require suid privileges (...) - add support for irix (segfaults mysteriously for now ...) - detect if telnet accepts '-8' and do something if this is not the case - add ZSSH_FORCE env variable done: - check for readline headers in configure script - works on MacOS X: - updated config: readline depends on (n)curses instead of termcap on some systems - don't use getpgid(): some systems don't have it - now compiles with readline v4.2 zssh-1.5c.debian.1.orig/test/0000700000175000017500000000000007734216456014455 5ustar bartbartzssh-1.5c.debian.1.orig/test/README0000600000175000017500000000405707734216030015331 0ustar bartbart This directory has a few utilities that will hopefully make it easier to trace tty problems. Here's how to proceed: 1) test tty sanity on the local host (the one you're running zssh on). - cd in this directory, type make to build the tools. - run ./local_test. this script runs local_tty_test, which basically opens a pty/tty pair on the local host, prints all 256 ascii chars on the tty, and displays what comes out of the pty on stdout. it also checks the other direction - writing to the pty, reading frome the tty. 2) test tty sanity on the remote host (the one you're ssh'ing to). same thing: copy the zssh source tree there, run configure, cd to the test/ directory, type make and run the script. 3) end to end test: [local side] - on the local host, cd to this directory (test/). - connect to the remote side using zssh [remote side, through zssh] - cd to the test/ directory that got created in step 2) - there should be a ttydump program in there. it roughly does a cat > output.dump (as the tty is put in raw mode however, it's immune to ^C and stuff, so you'll have to kill it from another term) run it: $ ./ttydump type ' kill 15627 ' to kill me output file is output.dump - now hit the zssh escape key, and type zssh > hook ./ttyprint that will send our reference output on the tty. - now kill ttydump from another term on the remote host. - check the output: $ ./check_remote_test remote tty test passed ! 4) end to end test, the other way this time: proceed likewise but with the remote side sending, and local side receiving: [remote side, through zssh] - it's a little bit more tricky because you need to setup the local side before the remote side can send, so : $ sleep 20 ; ./ttyprint - hit zssh escape key zssh > hook ./ttydump [local side] - wait 20 seconds, kill ttydump - check the output: $ ./check_remote_test remote tty test passed ! zssh-1.5c.debian.1.orig/test/local_tty_test.reference_output0000600000175000017500000001262207733470367023015 0ustar bartbarttesting char 0: '' testing char 1: '' testing char 2: '' testing char 3: '' testing char 4: '' testing char 5: '' testing char 6: '' testing char 7: '' testing char 8: '' testing char 9: ' ' testing char 10: ' ' testing char 11: ' ' testing char 12: ' ' testing char 13: ' ' testing char 14: '' testing char 15: '' testing char 16: '' testing char 17: '' testing char 18: '' testing char 19: '' testing char 20: '' testing char 21: '' testing char 22: '' testing char 23: '' testing char 24: '' testing char 25: '' testing char 26: '' testing char 27: '' testing char 28: '' testing char 29: '' testing char 30: '' testing char 31: '' testing char 32: ' ' testing char 33: '!' testing char 34: '"' testing char 35: '#' testing char 36: '$' testing char 37: '%' testing char 38: '&' testing char 39: ''' testing char 40: '(' testing char 41: ')' testing char 42: '*' testing char 43: '+' testing char 44: ',' testing char 45: '-' testing char 46: '.' testing char 47: '/' testing char 48: '0' testing char 49: '1' testing char 50: '2' testing char 51: '3' testing char 52: '4' testing char 53: '5' testing char 54: '6' testing char 55: '7' testing char 56: '8' testing char 57: '9' testing char 58: ':' testing char 59: ';' testing char 60: '<' testing char 61: '=' testing char 62: '>' testing char 63: '?' testing char 64: '@' testing char 65: 'A' testing char 66: 'B' testing char 67: 'C' testing char 68: 'D' testing char 69: 'E' testing char 70: 'F' testing char 71: 'G' testing char 72: 'H' testing char 73: 'I' testing char 74: 'J' testing char 75: 'K' testing char 76: 'L' testing char 77: 'M' testing char 78: 'N' testing char 79: 'O' testing char 80: 'P' testing char 81: 'Q' testing char 82: 'R' testing char 83: 'S' testing char 84: 'T' testing char 85: 'U' testing char 86: 'V' testing char 87: 'W' testing char 88: 'X' testing char 89: 'Y' testing char 90: 'Z' testing char 91: '[' testing char 92: '\' testing char 93: ']' testing char 94: '^' testing char 95: '_' testing char 96: '`' testing char 97: 'a' testing char 98: 'b' testing char 99: 'c' testing char 100: 'd' testing char 101: 'e' testing char 102: 'f' testing char 103: 'g' testing char 104: 'h' testing char 105: 'i' testing char 106: 'j' testing char 107: 'k' testing char 108: 'l' testing char 109: 'm' testing char 110: 'n' testing char 111: 'o' testing char 112: 'p' testing char 113: 'q' testing char 114: 'r' testing char 115: 's' testing char 116: 't' testing char 117: 'u' testing char 118: 'v' testing char 119: 'w' testing char 120: 'x' testing char 121: 'y' testing char 122: 'z' testing char 123: '{' testing char 124: '|' testing char 125: '}' testing char 126: '~' testing char 127: '' testing char 128: '' testing char 129: '' testing char 130: '' testing char 131: '' testing char 132: '' testing char 133: '' testing char 134: '' testing char 135: '' testing char 136: '' testing char 137: '' testing char 138: '' testing char 139: '' testing char 140: '' testing char 141: '' testing char 142: '' testing char 143: '' testing char 144: '' testing char 145: '' testing char 146: '' testing char 147: '' testing char 148: '' testing char 149: '' testing char 150: '' testing char 151: '' testing char 152: '' testing char 153: '' testing char 154: '' testing char 155: '' testing char 156: '' testing char 157: '' testing char 158: '' testing char 159: '' testing char 160: '' testing char 161: '' testing char 162: '' testing char 163: '' testing char 164: '' testing char 165: '' testing char 166: '' testing char 167: '' testing char 168: '' testing char 169: '' testing char 170: '' testing char 171: '' testing char 172: '' testing char 173: '' testing char 174: '' testing char 175: '' testing char 176: '' testing char 177: '' testing char 178: '' testing char 179: '' testing char 180: '' testing char 181: '' testing char 182: '' testing char 183: '' testing char 184: '' testing char 185: '' testing char 186: '' testing char 187: '' testing char 188: '' testing char 189: '' testing char 190: '' testing char 191: '' testing char 192: '' testing char 193: '' testing char 194: '' testing char 195: '' testing char 196: '' testing char 197: '' testing char 198: '' testing char 199: '' testing char 200: '' testing char 201: '' testing char 202: '' testing char 203: '' testing char 204: '' testing char 205: '' testing char 206: '' testing char 207: '' testing char 208: '' testing char 209: '' testing char 210: '' testing char 211: '' testing char 212: '' testing char 213: '' testing char 214: '' testing char 215: '' testing char 216: '' testing char 217: '' testing char 218: '' testing char 219: '' testing char 220: '' testing char 221: '' testing char 222: '' testing char 223: '' testing char 224: '' testing char 225: '' testing char 226: '' testing char 227: '' testing char 228: '' testing char 229: '' testing char 230: '' testing char 231: '' testing char 232: '' testing char 233: '' testing char 234: '' testing char 235: '' testing char 236: '' testing char 237: '' testing char 238: '' testing char 239: '' testing char 240: '' testing char 241: '' testing char 242: '' testing char 243: '' testing char 244: '' testing char 245: '' testing char 246: '' testing char 247: '' testing char 248: '' testing char 249: '' testing char 250: '' testing char 251: '' testing char 252: '' testing char 253: '' testing char 254: '' testing char 255: '' zssh-1.5c.debian.1.orig/test/local_test0000755000175000017500000000120207733732741016540 0ustar bartbart#!/bin/sh ./local_tty_test tty > output.tty if diff local_tty_test.reference_output output.tty >& /dev/null ; then echo "local tty -> pty test passed !" else echo "local tty -> pty test FAILED !" echo "diff -au local_tty_test.reference_output output.tty" diff -au local_tty_test.reference_output output.tty fi ./local_tty_test pty > output.pty if diff local_tty_test.reference_output output.pty >& /dev/null ; then echo "local pty -> tty test passed !" else echo "local pty -> tty test FAILED !" echo "diff -au local_tty_test.reference_output output.pty" diff -au local_tty_test.reference_output output.pty fi zssh-1.5c.debian.1.orig/test/check_remote_test0000755000175000017500000000103207733733455020102 0ustar bartbart#!/bin/sh if [ -f "output.dump" ]; then : ; else echo "output.dump file not found" exit 1 fi size=`wc -c < local_tty_test.reference_output` size=`echo $size` rm -f output.dump2 ; \ dd if="output.dump" of="output.dump2" bs=1 count=$size >& /dev/null if diff local_tty_test.reference_output output.dump2 >& /dev/null ; then echo "remote tty test passed !" else echo "remote tty test FAILED !" echo "diff -au local_tty_test.reference_output output.dump2" diff -au local_tty_test.reference_output output.dump2 fi zssh-1.5c.debian.1.orig/test/local_tty_test.c0000600000175000017500000000414307733744662017662 0ustar bartbart /* opens a new pty/tty and write stuff to it */ #include "zssh.h" int gl_master; /* pty fd */ int gl_slave; /* tty fd */ struct winsize gl_win; struct termios gl_tt; /* initial term */ struct termios gl_rtt; /* raw mode term */ /* exit from program */ void error(s1,s2) char*s1; char*s2; { if (!s1) perror(s2); else fprintf(stderr, s1, s2); exit (-1); } int ask_user(char *question, int def_ans, int forced_ans) { return (forced_ans); } void my_init() { if (tcgetattr(0, &gl_tt) < 0) error(0, "tcgetattr"); if (ioctl(0, TIOCGWINSZ, (char *)&gl_win) < 0) error(0, "ioctl TIOCGWINSZ"); gl_rtt = gl_tt; my_cfmakeraw(&gl_rtt); getmaster(); getslave(); /* set raw mode */ tcsetattr(gl_slave, TCSANOW, &gl_rtt); } /* print all 256 ascii characters on stdout */ void char_test() { int i; for (i = 0; i < 256; i++) printf("testing char %i: '%c'\n", i, i); } /* cat stuff to stdout, reading from fd */ void my_cat(int fd) { int i; char buff[20]; while ((i = read(fd, buff, 1)) >= 0) { if (i == 1) write(1, buff, 1); } printf("read() failed, exiting\n"); } void sigusr1_handler(int sig) { exit(0); } void doit(int input, int output) { int parent_pid = getpid(); signal(SIGUSR1, sigusr1_handler); if (!fork()) { /* child: write */ dup2(output, 1); close(output); close(input); char_test(); sleep(1); kill(parent_pid, SIGUSR1); } else { /* parent: read */ /* don't close output, let the child kill us instead otherwise * it doesn't work in the pty->tty case */ my_cat(input); } } void usage() { printf("usage: local_tty_test tty|pty\n"); exit(1); } int main(int ac, char **av) { my_init(); fflush(stdout); if (ac != 2) usage(); if (!strcmp(av[1], "tty")) doit(gl_master, gl_slave); /* write to the tty, read from pty */ else if (!strcmp(av[1], "pty")) doit(gl_slave, gl_master); /* write to the pty, read from tty */ else usage(); return 0; } zssh-1.5c.debian.1.orig/test/Makefile.in0000600000175000017500000000316507734215441016522 0ustar bartbart# # Makefile.in for zssh # # Made by Matthieu Lucotte # Login # # Started on Thu Jun 29 19:04:08 2000 Matthieu Lucotte # Last update Wed Sep 24 00:18:41 2003 # #System specific vars MAKE = @MAKE@ INSTALL = @INSTALL@ TAR = @TAR@ AR = @AR@ RANLIB = @RANLIB@ CC = @CC@ CFLAGS = @CFLAGS@ @DEFS@ @EXTRA_CFLAGS@ -I.. CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ @EXTRA_LIBS@ LDFLAGS = @LDFLAGS@ EXTRA_DEPS = @EXTRA_DEPS@ #uncomment this for debug infos #CFLAGS += -DDEBUG # old stuff. safely ignore. # # uncomment this if your keyboard doesn't send combined key codes packed # The ALT-1 key will not be detected in this case, unless DUMB_KEYBOARD # is defined #CFLAGS += -DDUMB_KEYBOARD #End of system specific vars T1 = local_tty_test T1_SRC = $(T1:=.c) T1_OBJS = $(T1_SRC:.c=.o) ../util.o ../openpty.o T2 = ttydump T2_SRC = $(T2:=.c) T2_OBJS = $(T2_SRC:.c=.o) ../util.o ../openpty.o T3 = ttyprint T3_SRC = $(T3:=.c) T3_OBJS = $(T3_SRC:.c=.o) ../util.o ../openpty.o PRGS = $(T1) $(T2) $(T3) INCL = ../config.h ../zssh.h all: $(PRGS) local_tty_test : $(EXTRA_DEPS) $(T1_OBJS) $(CC) -o $@ $(T1_OBJS) $(LDFLAGS) $(LIBS) ttydump : $(EXTRA_DEPS) $(T2_OBJS) $(CC) -o $@ $(T2_OBJS) $(LDFLAGS) $(LIBS) ttyprint : $(EXTRA_DEPS) $(T3_OBJS) $(CC) -o $@ $(T3_OBJS) $(LDFLAGS) $(LIBS) TAGS : etags *.[ch] new : clean all clean : -rm *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) output.* distclean : clean -rm Makefile config.cache config.status config.log config.scan config.h TAGS autoconf: autoconf autoheader force : $(OBJS) : $(INCL) zssh-1.5c.debian.1.orig/test/ttydump.c0000600000175000017500000000247007733744654016341 0ustar bartbart/* Does roughly a 'cat > output.dump' * except with tty in raw mode */ #include "zssh.h" /* exit from program */ void error(s1,s2) char*s1; char*s2; { if (!s1) perror(s2); else fprintf(stderr, s1, s2); exit (-1); } /* not used */ int gl_master; /* pty fd */ int gl_slave; /* tty fd */ struct winsize gl_win; int ask_user(char *question, int def_ans, int forced_ans) { return (forced_ans); } struct termios gl_tt; /* initial term */ struct termios gl_rtt; /* raw mode term */ struct termios gl_tt2; /* ssh mode term */ void my_init() { if (tcgetattr(0, &gl_tt) < 0) error(0, "tcgetattr"); gl_rtt = gl_tt; my_cfmakeraw(&gl_rtt); gl_tt2 = gl_rtt; fflush(stdout); tcsetattr(0, TCSANOW, &gl_rtt); } int main(int ac, char **av) { char buff[30]; int i, fd; FILE *tty; tty = fopen("/dev/tty", "w"); if (!tty) error(0, "/dev/tty"); fprintf(tty, "type ' kill %i ' to kill me\n", getpid()); fprintf(tty, "output file is output.dump\n"); fclose(tty); /* set tty in raw mode */ my_init(); /* dump stdin to file */ fd = open("output.dump", O_CREAT | O_TRUNC | O_WRONLY, 0666); if (fd == -1) error(0, "output.dump"); while ((i = read(0, buff, 1)) > 0) { if (i == 1) write(fd, buff, 1); } close(fd); return 0; } zssh-1.5c.debian.1.orig/test/ttyprint.c0000600000175000017500000000231307733744760016522 0ustar bartbart/* Does roughly a 'cat < local_tty_test.reference_output' * except with tty in raw mode */ #include "zssh.h" /* exit from program */ void error(s1,s2) char*s1; char*s2; { if (!s1) perror(s2); else fprintf(stderr, s1, s2); exit (-1); } /* not used */ int gl_master; /* pty fd */ int gl_slave; /* tty fd */ struct winsize gl_win; int ask_user(char *question, int def_ans, int forced_ans) { return (forced_ans); } struct termios gl_tt; /* initial term */ struct termios gl_rtt; /* raw mode term */ struct termios gl_tt2; /* ssh mode term */ void my_init() { if (tcgetattr(0, &gl_tt) < 0) error(0, "tcgetattr"); gl_rtt = gl_tt; my_cfmakeraw(&gl_rtt); gl_tt2 = gl_rtt; fflush(stdout); tcsetattr(0, TCSANOW, &gl_rtt); } int main(int ac, char **av) { char buff[30]; int i, fd; /* set tty in raw mode */ my_init(); /* dump stdin to file */ fd = open("local_tty_test.reference_output", O_RDONLY); if (fd == -1) error(0, "local_tty_test.reference_output"); while ((i = read(fd, buff, 1)) > 0) { if (i == 1) write(1, buff, 1); } close(fd); /* switch tty back to sane state */ tcsetattr(0, TCSANOW, &gl_tt); return 0; } zssh-1.5c.debian.1.orig/zmodem.c0000600000175000017500000000573407725004067015141 0ustar bartbart/* ** zmodem.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:11:24 2000 Matthieu Lucotte ** Last update Mon Sep 1 23:02:15 2003 */ #include "zssh.h" #include #include /* prompt one line of input using readline */ char *zprompt() { static char *prompt = 0; char *tmp; char *line; if (!prompt) { prompt = "zssh > "; if ((tmp = getenv("HOSTNAME"))) { tmp = str_cat("zssh@", tmp); prompt = str_cat(tmp, " > "); free(tmp); } } tcdrain(1); tcdrain(0); line = readline(prompt); if (!line) line = strdup("exit\n"); else if (line[0]) /* line != "" */ add_history(line); #ifdef DEBUG printf("read: >%s<\n",line); #endif return (line); } /* parse a line applying some shell expansions */ int zparse(str,av,ac) char **str; char ***av; int *ac; { if (pc_test_escapes(*str) < 0) return (-1); if (pc_tilde_expansion(str) < 0) return (-1); pc_split_words(*str, ac, av); if (*ac == 1) return (-1); pc_quote_removal(*av, ac); glob_args(ac, av); #ifdef DEBUG { int i; for (i = 0; (*av)[i]; i++) printf("arg %i >%s<\n", i, (*av)[i]); } #endif return (0); } int zrun(char **av) { int i,j; gl_repeat = 0; j = 1; do { i = zaction(av, gl_master, gl_slave); if (i >= 100) break; if (gl_repeat && j) { free(av[0]); av++; } j = 0; } while (gl_repeat); return (i); } t_act_tab cmdtab[] = { {"?", C_HELP, zact_help}, {"cd", C_CD, zact_cd}, {"disconnect", C_DISCONNECT, zact_disconnect}, {"escape", C_ESCAPE, zact_escape}, {"exit", C_EXIT, zact_exit}, {"help", C_HELP, zact_help}, {"hook", C_HOOK, zact_hook}, {"quit", C_EXIT, zact_exit}, {"repeat", C_REPEAT, zact_repeat}, {"rz", C_RZ, zact_hook_sub}, {"suspend", C_SUSPEND, zact_suspend}, {"sz", C_SZ, zact_hook_sub}, {"version", C_VERSION, zact_version}, {0, C_SHELL, zact_shell} }; int zaction(av,master,slave) char **av; int master; int slave; { t_act_tab *pt; char c = 24; /* "^X" */ int i = 1; for (pt = cmdtab; pt->name && strcmp(pt->name, av[0]); pt++) ; gl_child_rz = 0; pt->f(av,master); while (gl_child_rz) sigsuspend(&gl_sig_mask); gl_child_rz = 0; if (gl_interrupt) { printf("\nInterrupted !\n"); gl_interrupt = 0; tcflush(master, TCIOFLUSH); tcflush(slave, TCIOFLUSH); for (i = 0;i < 99;i++) { write(master, &c, 1); tcdrain(master); } flush(master); flush(slave); flush(master); } /* tcflush(gl_slave, TCIOFLUSH); */ /* tcflush(gl_master, TCIOFLUSH); */ /* kill(gl_child_output, SIGCONT); */ tcsetattr(gl_slave, TCSANOW, &gl_tt2); tcsetattr(0, TCSANOW, &gl_tt); /* tcsetattr(gl_slave, TCSAFLUSH, &gl_tt2); */ /* tcsetattr(0, TCSAFLUSH, &gl_tt); */ return (pt->n); } zssh-1.5c.debian.1.orig/escape.c0000600000175000017500000000361207356432613015101 0ustar bartbart/* ** escape.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:09:39 2000 Matthieu Lucotte ** Last update Sun Sep 30 21:12:31 2001 Matthieu Lucotte */ #include "zssh.h" int pc_escape_double_chr(str,i,chr,c2) char *str; int *i; char chr; char c2; { int j; if (str[*i] != chr) return (0); for ((*i)++;str[*i] && str[*i] != chr;) if ((j = pc_escape_backslash(str,i,0,0)) < 0) return (-1); else if (!j) (*i)++; if (!str[*i]) return (error_msg("Unmatched %s\n",chr2str(chr))); (*i)++; return (1); } int pc_escape_par(str,i,c1,c2) char *str; int *i; char c1; char c2; { int n; int j; if (str[*i] != c1) return (0); n = 1; for ((*i)++;str[*i];) if ((j = pc_escape_multi(str,i,ESC_COMMON)) < 0) return (-1); else if (!j) { if (str[*i] == c1) n++; if (str[*i] == c2) n--; if (!n) break; (*i)++; } if (!str[*i]) return (error_msg("Unmatched (\n","")); (*i)++; return (1); } int pc_escape_backslash(str,i,c1,c2) char *str; int *i; char c1; char c2; { if (str[*i] != '\\') return (0); (*i)++; if (!str[*i]) return (error_msg("Premature end of line\n","")); (*i)++; return (1); } int pc_escape_dollar_par(str,i,c1,c2) char *str; int *i; char c1; char c2; { int n; int j; if (str[*i] != '$' || str[*i + 1] != c1) return (0); for (n = 1, *i += 2;str[*i];) if ((j = pc_escape_multi(str,i,ESC_COMMON | ESC_PARENT)) < 0) return (-1); else if (!j) { if (str[*i] == '$' && str[*i + 1] == c1) { (*i)++; n++; } if (str[*i] == c2) n--; if (!n) break; (*i)++; } if (!str[*i]) return (error_msg("Unmatched $(\n","")); (*i)++; return (1); } zssh-1.5c.debian.1.orig/aclocal.m40000600000175000017500000000231007361376724015335 0ustar bartbart dnl stolen and modified from readline, wich itself seems to have taken it from bash AC_DEFUN(BASH_CHECK_LIB_TERMCAP, [ if test "X$bash_cv_termcap_lib" = "X"; then _bash_needmsg=yes else AC_MSG_CHECKING(which library has the termcap functions) _bash_needmsg= fi AC_CACHE_VAL(bash_cv_termcap_lib, [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, bash_cv_termcap_lib=libtermcap)])])]) if test "X$_bash_needmsg" = "Xyes"; then AC_MSG_CHECKING(which library has the termcap functions) fi AC_MSG_RESULT(using $bash_cv_termcap_lib) dnl if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then dnl LDFLAGS="$LDFLAGS -L./lib/termcap" dnl TERMCAP_LIB="./lib/termcap/libtermcap.a" dnl TERMCAP_DEP="./lib/termcap/libtermcap.a" dnl elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then if test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= else TERMCAP_LIB=-lcurses TERMCAP_DEP= fi ]) zssh-1.5c.debian.1.orig/fun.h0000600000175000017500000000665607733753743014462 0ustar bartbart /* completion.c */ void initialize_readline(void); char **zssh_completion(char *text, int start, int end); char *command_generator(const char *text, int state); char *tilde_generator(char *text, int state); char *fake_generator(const char *text, int state); /* doit.c */ void doinput(void); void dooutput(void); void doshell(int ac, char **av, char **shav); /* escape.c */ int pc_escape_double_chr(char *str, int *i, char chr, char c2); int pc_escape_par(char *str, int *i, char c1, char c2); int pc_escape_backslash(char *str, int *i, char c1, char c2); int pc_escape_dollar_par(char *str, int *i, char c1, char c2); /* escape_multi.c */ int pc_escape_multi(char *str, int *i, int flags); /* globbing.c */ void glob_args(int *ac, char ***av); void write_vector_word(char *str, int *argc, char ***argv); /* init.c */ void init_gl(int ac, char **av); void version(int exit_prog); void usage(void); int set_escape(char *str); char *escape_help(void); void command_line_options(int *argc, char ***argv); void init(int *argc, char ***argv); /* main.c */ int main(int argc, char **argv); int escape_input(int *cc, unsigned char *ibuf); int escape_input(int *cc, unsigned char *ibuf); void read_input(int *cc, unsigned char *ibuf); void rz_mode(void); void fail(void); void done(int ret); /* misc.c */ char *chr2str(char chr); int mi_is_whitespace(char chr); void error(char *s1, char *s2); int error_msg(char *s1, char *s2); void op_shift(char **argv, int n); void flush(int fd); int ask_user(char *question, int def_ans, int forced_ans); /* openpty.c */ void getmaster(void); void getslave(void); void getmaster(void); void getslave(void); void getmaster(void); void getslave(void); void getmaster(void); void getslave(void); void my_tcsetpgrp(int fd, int pgrpid); void my_cfmakeraw(struct termios *pt); void testslave(char *ttyname); void initslave(void); void call_grantpt(void); /* pc_test_escapes.c */ int pc_test_escapes(char *str); /* quote_removal.c */ int pc_remove_backslash(char *str, int *i); int pc_remove_double_chr(char *str, int *i, char chr); void pc_quote_removal(char **av, int *ac); /* signal.c */ void print_process_status(int pid, int s); RETSIGTYPE sigchld_handler(int sig); RETSIGTYPE sigint_handler(int sig); RETSIGTYPE sigwinch_handler(int sig); /* split_words.c */ void pc_new_tab(int *argc, char ***argv); void pc_mk_word(char **str, int *pos, int *argc, char ***argv); int pc_ok_split(char *comm, int pos, int i); void pc_split_words(char *comm, int *argc, char ***argv); /* tilde_expansion.c */ char *pc_get_tilde_expansion(char *pattern); int pc_tilde_expansion(char **str); /* util.c */ void str_shift(char *str, int i, int n); char *str_n_dup(char *str, int n); char *str_cat(char *str1, char *str2); void str_sub_repl(char **str, int sub_beg, int sub_len, char *sub_repl); void *smalloc(unsigned int n); int sfork(volatile int *pid_child); /* zmodem.c */ char *zprompt(void); int zparse(char **str, char ***av, int *ac); int zrun(char **av); int zaction(char **av, int master, int slave); /* zmodem_act.c */ void zact_shell(char **av, int master); void zact_help(char **av, int master); void zact_version(char **av, int master); void zact_cd(char **av, int master); void zact_suspend(char **av, int master); void zact_disconnect(char **av, int master); void zact_repeat(char **av, int master); void zact_hook_sub(char **av, int master); void zact_hook(char **av, int master); void zact_escape(char **av, int master); void zact_exit(char **av, int master); zssh-1.5c.debian.1.orig/signal.c0000600000175000017500000000350707361435253015120 0ustar bartbart/* ** signal.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:55 2000 Matthieu Lucotte ** Last update Thu Oct 11 20:34:51 2001 Matthieu Lucotte */ #include "zssh.h" /* * Note: all signal handlers should make sure they * reset themselves by calling signal() before * they exit. */ #ifdef DEBUG void print_process_status(int pid, int s) { if (WIFEXITED(s)) printf("process %i: exit value: %i\n", pid, WEXITSTATUS(s)); if (WIFSIGNALED(s)) printf("process %i: received signal %i\n", pid, WTERMSIG(s)); if (WIFSTOPPED(s)) printf("process %i: stopped by signal %i\n", pid, WSTOPSIG(s)); } #endif RETSIGTYPE sigchld_handler(sig) int sig; { int old_errno; int pid; int s; int die; old_errno = errno; signal(SIGCHLD, sigchld_handler); die = 0; while (1) { errno = EINTR; pid = 0; while (pid <= 0 && errno == EINTR) { errno = 0; pid = waitpid (WAIT_ANY, &s, WNOHANG); } if (pid <= 0) { errno = old_errno; if (die) done(0); return; } #ifdef DEBUG print_process_status(pid, s); #endif if (pid == gl_child_shell) die = 1; if (pid == gl_child_rz) gl_child_rz = 0; } } RETSIGTYPE sigint_handler(sig) int sig; { signal(SIGINT, sigint_handler); gl_repeat = 0; if (gl_child_rz) { kill(gl_child_rz, SIGKILL); /* SIGTERM seems to cause sz to interfere with ^Xs */ /* so let's be more persuasive =) */ gl_interrupt = 1; } } RETSIGTYPE sigwinch_handler(sig) int sig; { signal(SIGWINCH, sigwinch_handler); ioctl(0, TIOCGWINSZ, &gl_win); ioctl(gl_slave, TIOCSWINSZ, &gl_win); kill(gl_child_shell, SIGWINCH); } zssh-1.5c.debian.1.orig/README0000600000175000017500000000160407356432613014354 0ustar bartbart zssh -------------------- zssh (Zmodem SSH) a program for interactively transferring files to a remote machine while using the secure shell ( ssh ). It is intended to be a convenient alternative to scp , allowing to transfer files without having to open another session and re-authenticate oneself. Files are transferred through the zmodem protocol, using the rz and sz commands. If you don't already have them, the sz/rz programs can be installed from Uwe Ohse's lrzsz package included in this directory. for more information, see http://www.ohse.de/uwe/software/lrzsz.html the readline library is also required. See the file COPYING for copyright and warranty information. See the file INSTALL for installation information. See also the FAQ Supported architectures currently include : - linux - NetBSD - OpenBSD - FreeBSD but POSIX compliant OSes should do.zssh-1.5c.debian.1.orig/zmodem_act.c0000600000175000017500000000740007733754026015766 0ustar bartbart/* ** zmodem_act.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:11:29 2000 Matthieu Lucotte ** Last update Tue Sep 23 01:20:22 2003 */ #include "zssh.h" void zact_shell(av,master) char **av; int master; { if (!sfork(&gl_child_rz)) { signal(SIGINT, SIG_DFL); signal(SIGWINCH, SIG_DFL); my_tcsetpgrp(0, getpgrp()); signal(SIGTSTP, SIG_IGN); signal(SIGINT, SIG_DFL); execvp(av[0], av); perror(av[0]); exit (1); } } void zact_help(av,master) char **av; int master; { printf("\n"); printf("Builtins :\n"); printf(" ? : print this message\n"); printf(" cd : change directory\n"); printf(" disconnect : disconnect and exit\n"); printf(" escape [^X] : change escape key to ^X \n"); printf(" without argument, print current escape key \n"); printf(" exit : exit file transfer mode\n"); printf(" help : print this message\n"); printf(" hook prg : hook program 'prg' to the pty instead of sz or rz\n"); printf(" quit : same as exit\n"); printf(" repeat : repeats cmd forever (^C to interrupt)\n"); printf(" rz : receive files\n"); printf(" suspend : suspend zssh\n"); printf(" sz ... : send files\n"); printf(" version : print version information\n"); printf(" ... : exec the prog\n"); printf("\n"); printf("Usage :\n"); printf(" Download : run sz on the remote shell before switching to transfer mode\n"); printf(" then type rz\n"); printf(" Upload : switch to transfer mode and type sz \n"); printf(" rz will be automatically run on the remote side\n"); printf("\n"); printf("Tips:\n"); printf(" - If file transfer never completes, use the -e option of sz/rz\n"); printf(" - Transfers can be interrupted with ^C\n"); printf(" - If you get stuck in rz/sz (for example you've just ran rz, but you\n"); printf(" then decided not to transmit anything), hit a dozen ^X to stop it\n"); printf(" - Use sz -y to overwrite remote files\n\n"); printf("This shell supports line edition, history, completion, wildcards and escapes\n\n"); printf("Report bugs to \n"); } void zact_version(av,master) char **av; int master; { version(0); } void zact_cd(av,master) char **av; int master; { char *str; if (!(str = av[1])) str = getenv("HOME"); if (chdir(str) < 0) perror(str); } void zact_suspend(av,master) char **av; int master; { kill(getpid(), SIGTSTP); } void zact_disconnect(av,master) char **av; int master; { done(0); } void zact_repeat(av,master) char **av; int master; { gl_repeat = 1; } void zact_hook_sub(av,master) char **av; int master; { tcsetattr(gl_slave, TCSAFLUSH, &gl_rtt); if (!sfork(&gl_child_rz)) { signal(SIGINT,SIG_DFL); signal(SIGWINCH,SIG_DFL); dup2(master,0); dup2(master,1); execvp(av[0],av); error("error: execvp %s\n",av[0]); exit (1); } #ifdef DEBUG printf("launching %s (pid=%i) ...\n",av[0],gl_child_rz); #endif } void zact_hook(av,master) char **av; int master; { zact_hook_sub(av + 1, master); } void zact_escape(av,master) char **av; int master; { if (!av[1]) printf("Current escape key: ^%c (%s)\n",gl_escape,escape_help()); else set_escape(av[1]); } void zact_exit(av,master) char **av; int master; { write(master,"\n",1); } zssh-1.5c.debian.1.orig/configure0000700000175000017500000020763707734213413015412 0ustar bartbart#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-readline Use libreadline [default] --disable-readline Link with a fake readline library useful for testing if libreadline is not available or if you don't want any command-line edition, history and completion !" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=zmodem.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi EXTRA_DEPS="" EXTRA_LIBS="" EXTRA_CFLAGS="" TERMCAP_LIB="" echo $ac_n "checking whether to use libreadline for cmd-line editing""... $ac_c" 1>&6 echo "configure:539: checking whether to use libreadline for cmd-line editing" >&5 fakereadline="" # Check whether --enable-readline or --disable-readline was given. if test "${enable_readline+set}" = set; then enableval="$enable_readline" case "$enableval" in no) echo "$ac_t""no" 1>&6 fakereadline="yes" EXTRA_DEPS="$EXTRA_DEPS fake_readline" EXTRA_CFLAGS="$EXTRA_CFLAGS -Ifake_readline" EXTRA_LIBS="$EXTRA_LIBS fake_readline/libreadline.a" ;; *) echo "$ac_t""yes" 1>&6 esac else echo "$ac_t""yes" 1>&6 fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:592: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "gmake", so it can be a program name with args. set dummy gmake; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$MAKE"; then ac_cv_prog_MAKE="$MAKE" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_MAKE="gmake" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_MAKE" && ac_cv_prog_MAKE="make" fi fi MAKE="$ac_cv_prog_MAKE" if test -n "$MAKE"; then echo "$ac_t""$MAKE" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gtar", so it can be a program name with args. set dummy gtar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:677: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$TAR"; then ac_cv_prog_TAR="$TAR" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_TAR="gtar" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_TAR" && ac_cv_prog_TAR="tar" fi fi TAR="$ac_cv_prog_TAR" if test -n "$TAR"; then echo "$ac_t""$TAR" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gar", so it can be a program name with args. set dummy gar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:707: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AR="gar" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" fi fi AR="$ac_cv_prog_AR" if test -n "$AR"; then echo "$ac_t""$AR" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "granlib", so it can be a program name with args. set dummy granlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:737: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="granlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:768: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:798: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:849: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:881: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 892 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:923: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:928: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:956: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:988: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 echo "configure:1069: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall" echo $ac_n "checking that the C compiler understands -Wall""... $ac_c" 1>&6 echo "configure:1118: checking that the C compiler understands -Wall" >&5 if eval "test \"`echo '$''{'zssh_cc_wall'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* zssh_cc_wall=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* zssh_cc_wall=no fi rm -f conftest* fi echo "$ac_t""$zssh_cc_wall" 1>&6 if test x"$zssh_cc_wall" != x"yes"; then CFLAGS="$OLD_CFLAGS" fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1151: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 echo "configure:1255: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:1276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in fcntl.h paths.h sys/ioctl.h sys/time.h termios.h unistd.h \ err.h sys/cdefs.h sys/param.h util.h stropts.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1301: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done if test -z "$fakereadline"; then if test "X$bash_cv_termcap_lib" = "X"; then _bash_needmsg=yes else echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 echo "configure:1347: checking which library has the termcap functions" >&5 _bash_needmsg= fi if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 echo "configure:1354: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 bash_cv_termcap_lib=libtermcap else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 echo "configure:1392: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 bash_cv_termcap_lib=libcurses else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 echo "configure:1430: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 bash_cv_termcap_lib=libncurses else echo "$ac_t""no" 1>&6 bash_cv_termcap_lib=libtermcap fi fi fi fi if test "X$_bash_needmsg" = "Xyes"; then echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6 echo "configure:1478: checking which library has the termcap functions" >&5 fi echo "$ac_t""using $bash_cv_termcap_lib" 1>&6 if test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= else TERMCAP_LIB=-lcurses TERMCAP_DEP= fi LIBS="$LIBS $TERMCAP_LIB" for ac_hdr in readline/readline.h readline/history.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1498: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 { echo "configure: error: *** the readline library headers were not found. Check 'config.log' for more details. *** You may use --disable-readline option of configure to build without libreadline *** or make sure libreadline *and* its headers are properly installed" 1>&2; exit 1; } fi done echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 echo "configure:1540: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 { echo "configure: error: *** libreadline was not found. Check 'config.log' for more details. *** You may use --disable-readline option of configure to build without libreadline *** or make sure libreadline is properly installed" 1>&2; exit 1; } fi echo $ac_n "checking for rl_username_completion_function""... $ac_c" 1>&6 echo "configure:1592: checking for rl_username_completion_function" >&5 if eval "test \"`echo '$''{'ac_cv_func_rl_username_completion_function'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rl_username_completion_function(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_rl_username_completion_function) || defined (__stub___rl_username_completion_function) choke me #else rl_username_completion_function(); #endif ; return 0; } EOF if { (eval echo configure:1620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_rl_username_completion_function=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_rl_username_completion_function=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'rl_username_completion_function`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_READLINE_4_2_OR_GREATER 1 EOF else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 echo "configure:1647: checking whether getpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < #include int pid; int pg1, pg2, pg3, pg4; int ng, np, s, child; main() { pid = getpid(); pg1 = getpgrp(0); pg2 = getpgrp(); pg3 = getpgrp(pid); pg4 = getpgrp(1); /* * If all of these values are the same, it's pretty sure that * we're on a system that ignores getpgrp's first argument. */ if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) exit(0); child = fork(); if (child < 0) exit(1); else if (child == 0) { np = getpid(); /* * If this is Sys V, this will not work; pgrp will be * set to np because setpgrp just changes a pgrp to be * the same as the pid. */ setpgrp(np, pg1); ng = getpgrp(0); /* Same result for Sys V and BSD */ if (ng == pg1) { exit(1); } else { exit(0); } } else { wait(&s); exit(s>>8); } } EOF if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_getpgrp_void=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_getpgrp_void=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6 if test $ac_cv_func_getpgrp_void = yes; then cat >> confdefs.h <<\EOF #define GETPGRP_VOID 1 EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo "configure:1734: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifdef signal #undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main() { int i; ; return 0; } EOF if { (eval echo configure:1756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_signal" 1>&6 cat >> confdefs.h <&6 echo "configure:1777: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done for ac_func in _getpty getpseudotty openpty grantpt unlockpt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1834: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for pseudo ttys""... $ac_c" 1>&6 echo "configure:1887: checking for pseudo ttys" >&5 if test -c /dev/getpty && test $ac_cv_func_getpseudotty = yes then cat >> confdefs.h <<\EOF #define HAVE_GETPSEUDOTTY 1 EOF echo "$ac_t""getpseudotty" 1>&6 else if test -c /dev/ptmx && test -c /dev/pts/0 then cat >> confdefs.h <<\EOF #define HAVE_DEV_PTMX 1 EOF echo "$ac_t""streams ptys" 1>&6 else if test -c /dev/ptc && test -c /dev/pts || test -d /dev/pts then cat >> confdefs.h <<\EOF #define HAVE_DEV_PTS_AND_PTC 1 EOF echo "$ac_t""/dev/pts and /dev/ptc" 1>&6 else if test -c /dev/ptyp10 then cat >> confdefs.h <<\EOF #define HAVE_DEV_PTYP10 1 EOF echo "$ac_t""sco-style ptys" 1>&6 else echo "$ac_t""bsd-style ptys" 1>&6 fi fi fi fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile fake_readline/Makefile test/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@MAKE@%$MAKE%g s%@TAR@%$TAR%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@EXTRA_DEPS@%$EXTRA_DEPS%g s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g s%@EXTRA_LIBS@%$EXTRA_LIBS%g s%@TERMCAP_LIB@%$TERMCAP_LIB%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 zssh-1.5c.debian.1.orig/ztelnet.10000600000175000017500000000002007356432613015232 0ustar bartbart.so man1/zssh.1 zssh-1.5c.debian.1.orig/configure.in0000600000175000017500000000715707734213336016015 0ustar bartbartdnl Process this file with autoconf to produce a configure script. AC_INIT(zmodem.c) dnl Initialising output variables EXTRA_DEPS="" EXTRA_LIBS="" EXTRA_CFLAGS="" TERMCAP_LIB="" dnl Check configure arguments AC_MSG_CHECKING(whether to use libreadline for cmd-line editing) fakereadline="" AC_ARG_ENABLE(readline, [ --enable-readline Use libreadline [default] --disable-readline Link with a fake readline library useful for testing if libreadline is not available or if you don't want any command-line edition, history and completion !], [ case "$enableval" in no) AC_MSG_RESULT(no) fakereadline="yes" EXTRA_DEPS="$EXTRA_DEPS fake_readline" EXTRA_CFLAGS="$EXTRA_CFLAGS -Ifake_readline" EXTRA_LIBS="$EXTRA_LIBS fake_readline/libreadline.a" ;; *) AC_MSG_RESULT(yes) esac ], AC_MSG_RESULT(yes) ) dnl Checks for programs. AC_PROG_INSTALL AC_CHECK_PROG(MAKE, gmake, gmake, make) AC_CHECK_PROG(TAR, gtar, gtar, tar) AC_CHECK_PROG(AR, gar, gar, ar) AC_CHECK_PROG(RANLIB, granlib, granlib, ranlib) dnl Checks for typedefs, structures, and compiler characteristics. AC_PROG_GCC_TRADITIONAL dnl Check if the C compiler understands -Wall OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall" AC_CACHE_CHECK([that the C compiler understands -Wall],zssh_cc_wall, [ AC_TRY_COMPILE([ ],[ ], zssh_cc_wall=yes, zssh_cc_wall=no)]) if test x"$zssh_cc_wall" != x"yes"; then CFLAGS="$OLD_CFLAGS" fi dnl Checks for header files. AC_CONFIG_HEADER(config.h) AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h termios.h unistd.h \ err.h sys/cdefs.h sys/param.h util.h stropts.h) dnl Checks for libraries. if test -z "$fakereadline"; then dnl libtermcap (or (n)curses) is only needed by libreadline BASH_CHECK_LIB_TERMCAP LIBS="$LIBS $TERMCAP_LIB" dnl check for readline headers AC_CHECK_HEADERS(readline/readline.h readline/history.h, , AC_MSG_ERROR( [ *** the readline library headers were not found. Check 'config.log' for more details. *** You may use --disable-readline option of configure to build without libreadline *** or make sure libreadline *and* its headers are properly installed])) AC_CHECK_LIB(readline, readline,, AC_MSG_ERROR( [ *** libreadline was not found. Check 'config.log' for more details. *** You may use --disable-readline option of configure to build without libreadline *** or make sure libreadline is properly installed]), ) dnl Check for completion function names. they are different in version 4.2 and < 4.2 AC_CHECK_FUNC(rl_username_completion_function, AC_DEFINE(HAVE_READLINE_4_2_OR_GREATER)) fi dnl Checks for library functions. AC_FUNC_GETPGRP AC_TYPE_SIGNAL AC_CHECK_FUNCS(strdup getpt isastream tcsetpgrp) dnl Check what is available for tty/pty allocation AC_CHECK_FUNCS(_getpty getpseudotty openpty grantpt unlockpt) AC_MSG_CHECKING(for pseudo ttys) if test -c /dev/getpty && test $ac_cv_func_getpseudotty = yes then AC_DEFINE(HAVE_GETPSEUDOTTY) AC_MSG_RESULT(getpseudotty) else if test -c /dev/ptmx && test -c /dev/pts/0 then AC_DEFINE(HAVE_DEV_PTMX) AC_MSG_RESULT(streams ptys) else if test -c /dev/ptc && test -c /dev/pts || test -d /dev/pts then AC_DEFINE(HAVE_DEV_PTS_AND_PTC) AC_MSG_RESULT(/dev/pts and /dev/ptc) else if test -c /dev/ptyp10 then AC_DEFINE(HAVE_DEV_PTYP10) AC_MSG_RESULT(sco-style ptys) else AC_MSG_RESULT(bsd-style ptys) fi fi fi fi dnl Setting output variables AC_SUBST(EXTRA_DEPS) AC_SUBST(EXTRA_CFLAGS) AC_SUBST(EXTRA_LIBS) AC_SUBST(TERMCAP_LIB) AC_OUTPUT(Makefile fake_readline/Makefile test/Makefile) zssh-1.5c.debian.1.orig/completion.c0000600000175000017500000001136107725003403016001 0ustar bartbart/* ** completion.c ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sun Oct 7 01:43:23 2001 Matthieu Lucotte ** Last update Mon Sep 1 22:57:07 2003 */ #include "zssh.h" #include #include #ifdef HAVE_LIBREADLINE /* for readline < 4.2 we have to use username_completion_function * 4.2 we have to use rl_username_completion_function * and so on ... */ #ifdef HAVE_READLINE_4_2_OR_GREATER #define RL_USERNAME_COMPLETION_FUNCTION rl_username_completion_function #define RL_FILENAME_COMPLETION_FUNCTION rl_filename_completion_function #define RL_COMPLETION_MATCHES rl_completion_matches #else /* readline < 4.2 */ #define RL_USERNAME_COMPLETION_FUNCTION username_completion_function #define RL_FILENAME_COMPLETION_FUNCTION filename_completion_function #define RL_COMPLETION_MATCHES completion_matches #endif /* **************************************************************** */ /* */ /* Interface to Readline Completion */ /* */ /* **************************************************************** */ /* Tell the GNU Readline library how to complete. We want to try to complete on command names if this is the first word in the line, or on filenames if not. */ void initialize_readline() { #ifdef DEBUG printf("Using readline library version: %s\n", rl_library_version); #endif /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "zssh"; /* inhibit default filename completion so that if zssh_completion() fails nothing is completed */ rl_completion_entry_function = fake_generator; /* Tell the completer that we want a crack first. */ rl_attempted_completion_function = (CPPFunction *) zssh_completion; } /* Attempt to complete on the contents of TEXT. START and END bound the region of rl_line_buffer that contains the word to complete. TEXT is the word to complete. We can use the entire contents of rl_line_buffer in case we want to do some simple parsing. Return the array of matches, or NULL if there aren't any. */ char **zssh_completion(text, start, end) char *text; int start; int end; { char **matches; matches = (char **)NULL; /* printf("text: >%s<\n", text); */ /* If this word is at the start of the line, then it is a command to complete. Otherwise it is the name of a file in the current directory. */ if (!start) matches = RL_COMPLETION_MATCHES(text, command_generator); else if (text[0] == '~' && !strchr(text, '/')) matches = RL_COMPLETION_MATCHES(text, RL_USERNAME_COMPLETION_FUNCTION); /* matches = completion_matches(text, tilde_generator); */ else matches = RL_COMPLETION_MATCHES(text, RL_FILENAME_COMPLETION_FUNCTION); return (matches); } /* Generator function for command completion. STATE lets us know whether to start from scratch; without any state (i.e. STATE == 0), then we start at the top of the list. */ char *command_generator(text, state) const char *text; int state; { static int list_index, len; char *name; /* If this is a new word to complete, initialize now. This includes saving the length of TEXT for efficiency, and initializing the index variable to 0. */ if (!state) { list_index = 0; len = strlen (text); } /* Return the next name which partially matches from the command list. */ while ((name = cmdtab[list_index].name)) { list_index++; if (strncmp(name, text, len) == 0) return (strdup(name)); } /* If no names matched, then return NULL. */ return ((char *)NULL); } /* Generator function for tilde completion. STATE lets us know whether to start from scratch; without any state (i.e. STATE == 0), then we start at the top of the list. */ #if 0 char *tilde_generator(text, state) char *text; int state; { struct passwd *pwd; static int len; /* If this is a new word to complete, initialize now. This includes * saving the length of TEXT for efficiency, and initializing the index * variable to 0. */ if (!state) { pwd = getpwent(); setpwent(); len = strlen(text + 1); } rl_filename_completion_desired = 1; /* Return the next homedir which partially matches. */ while ((pwd = getpwent())) { if (strncmp(pwd->pw_name, text + 1, len) == 0) return (str_cat("~", pwd->pw_name)); } /* If no names matched, then return NULL. */ return ((char *)NULL); } #endif /* 0 */ char *fake_generator(text, state) const char *text; int state; { return (0); } #endif /* HAVE_LIBREADLINE */ zssh-1.5c.debian.1.orig/install-sh0000700000175000017500000001273607356432613015506 0ustar bartbart#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 zssh-1.5c.debian.1.orig/escape_multi.c0000600000175000017500000000162507356432613016315 0ustar bartbart/* ** escape_multi.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:09:46 2000 Matthieu Lucotte ** Last update Sun Aug 26 03:47:40 2001 Matthieu Lucotte */ #include "zssh.h" t_escape escape_tab[] = { {ESC_DQUOTES, pc_escape_double_chr, '"', 0}, {ESC_SQUOTES, pc_escape_double_chr, '\'', 0}, {ESC_BQUOTES, pc_escape_double_chr, '`', 0}, {ESC_PARENT, pc_escape_par, '(', ')'}, {ESC_BCKSLASH, pc_escape_backslash, 0, 0}, {ESC_DOLLAR_PAR,pc_escape_dollar_par, '(', ')'}, {ESC_DOLLAR_BRA,pc_escape_dollar_par, '[', ']'}, {0, 0, 0, 0} }; int pc_escape_multi(str,i,flags) char *str; int *i; int flags; { int j; int k; t_escape *pt; k = 0; for (pt = escape_tab;pt->flag;pt++) { j = 0; if (flags & pt->flag && (j = pt->f(str,i,pt->c1,pt->c2)) < 0) return (-1); k += j; } return (k); } zssh-1.5c.debian.1.orig/pc_test_escapes.c0000600000175000017500000000073607356432613017011 0ustar bartbart/* ** pc_test_escapes.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:38 2000 Matthieu Lucotte ** Last update Thu Jun 29 19:10:39 2000 Matthieu Lucotte */ #include "zssh.h" int pc_test_escapes(str) char *str; { int i; int j; for (i = 0;str[i];) if ((j = pc_escape_multi(str,&i,ESC_COMMON | ESC_PARENT)) < 0) return (-1); else if (!j) i++; return (1); } zssh-1.5c.debian.1.orig/.#zmodem_act.c0000777000175000017500000000000010363023741024657 2mll@localhost.localdomain.27687:1062340461ustar bartbartzssh-1.5c.debian.1.orig/doit.c0000600000175000017500000000351207356470462014603 0ustar bartbart/* ** doit.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:09:23 2000 Matthieu Lucotte ** Last update Tue Oct 2 22:00:18 2001 Matthieu Lucotte */ #include "zssh.h" /* copy input to the pty, test for escape key and * switch to local shell mode if it found */ void doinput() { int cc; unsigned char ibuf[BUFSIZ]; signal(SIGINT, sigint_handler); signal(SIGWINCH, sigwinch_handler); while (1) { read_input(&cc, ibuf); if (escape_input(&cc, ibuf)) rz_mode(); else write(gl_master, ibuf, cc); } error("Should not be reached",""); /* not reached */ } /* copy output from the pty */ void dooutput() { int cc; char obuf[BUFSIZ]; #ifdef DEBUG printf("child_output: %i\n", (int) getpid()); #endif signal(SIGTSTP, SIG_IGN); signal(SIGINT, SIG_IGN); close(0); close(gl_slave); while (1) { cc = read(gl_master,obuf,sizeof(obuf)); if (cc <= 0) continue; write(1,obuf,cc); } error("Should not be reached",""); /* not reached */ } /* Launch the remote shell. * shav defaults to [ "ssh" "-e" "none" ] (zssh) * or [ "telnet" "-8" "-E" ] (ztelnet) */ void doshell(ac,av,shav) int ac; char **av; char **shav; { char **argv; int i,j; #ifdef DEBUG printf("child_shell: %i\n", (int) getpid()); #endif initslave(); printf("\n"); for (i = 0; shav[i]; i++) ; i += ac + 1; argv = smalloc(i * sizeof(char *)); for (i = 0; shav[i]; i++) argv[i] = shav[i]; for (j = 1; j < ac; j++) argv[i++] = av[j]; argv[i] = 0; #ifdef DEBUG printf("launching shell: "); for (i = 0; argv[i]; i++) printf("[%s] ", argv[i]); printf("\n"); #endif execvp(shav[0],argv); error("execvp %s\n",shav[0]); fail(); } zssh-1.5c.debian.1.orig/zssh.spec.tpl0000600000175000017500000000212507356432613016134 0ustar bartbart# Makefile will generate the ZSSH definition Summary : Interactive file transfers to/from a remote machine while using the secure shell (ssh). Name : zssh Version : %{ZSSHVER} Release : 1 Copyright : GPL Group : Applications/Communications Source : download.sourceforge.net:/pub/sourceforge/zssh/zssh-%{ZSSHVER}.tgz packager : Matthieu Lucotte %description zssh (Zmodem SSH) is a program for interactively transferring files to/from a remote machine while using the secure shell (ssh). It is intended to be a convenient alternative to scp, allowing to transfer files without having to open another session and re-authenticate oneself. zssh is an interactive wrapper for ssh used to switch the ssh connection between the remote shell and file transfers. Files are transferred through the zmodem protocol, using the rz and sz commands. %prep %setup %build ./configure make %install make install %files %doc CHANGES COPYING FAQ INSTALL README VERSION /usr/local/bin/zssh /usr/local/bin/ztelnet /usr/local/man/man1/zssh.1 /usr/local/man/man1/ztelnet.1 zssh-1.5c.debian.1.orig/fake_readline/0000700000175000017500000000000007734216453016244 5ustar bartbartzssh-1.5c.debian.1.orig/fake_readline/Makefile0000600000175000017500000000075707734216453017717 0ustar bartbart# Generated automatically from Makefile.in by configure. MAKE = gmake INSTALL = /usr/bin/install -c TAR = tar AR = ar RANLIB = ranlib CC = gcc CFLAGS = -g -O2 -Wall -DHAVE_CONFIG_H CPPFLAGS = LIBS = -lreadline -ltermcap LDFLAGS = NAME = libreadline.a SRC = readline.c OBJ = $(SRC:.c=.o) all : $(NAME) $(NAME) : $(OBJ) -rm $@ $(AR) cq $@ $(OBJ) $(RANLIB) $@ new : clean all clean : -rm *.o *~ *.a \#*\# core $(NAME) typescript nohup.out distclean : clean zssh-1.5c.debian.1.orig/fake_readline/history.h0000600000175000017500000000051307357704614020121 0ustar bartbart/* ** history.h ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sat Oct 6 18:45:16 2001 Matthieu Lucotte ** Last update Sat Oct 6 18:45:32 2001 Matthieu Lucotte */ #ifndef __HISTORY_H__ #define __HISTORY_H__ void add_history(char *str); #endif /* __HISTORY_H__ */ zssh-1.5c.debian.1.orig/fake_readline/Makefile.in0000600000175000017500000000065307357672321020320 0ustar bartbart MAKE = @MAKE@ INSTALL = @INSTALL@ TAR = @TAR@ AR = @AR@ RANLIB = @RANLIB@ CC = @CC@ CFLAGS = @CFLAGS@ @DEFS@ CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ NAME = libreadline.a SRC = readline.c OBJ = $(SRC:.c=.o) all : $(NAME) $(NAME) : $(OBJ) -rm $@ $(AR) cq $@ $(OBJ) $(RANLIB) $@ new : clean all clean : -rm *.o *~ *.a \#*\# core $(NAME) typescript nohup.out distclean : clean zssh-1.5c.debian.1.orig/fake_readline/readline.c0000600000175000017500000000110107357670216020170 0ustar bartbart/* ** readline.c ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sat Oct 6 16:45:52 2001 Matthieu Lucotte ** Last update Sat Oct 6 16:58:54 2001 Matthieu Lucotte */ #include #include char *readline(char *prompt) { char *line; int i; printf("%s", prompt); fflush(stdout); line = malloc(100 * sizeof(char)); fgets(line, 100 * sizeof(char), stdin); for (i = 0; line[i]; i++) if (line[i] == '\n') line[i] = 0; return (line); } void add_history(char *str) { } zssh-1.5c.debian.1.orig/fake_readline/readline.h0000600000175000017500000000052007357775714020212 0ustar bartbart/* ** readline.h ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sat Oct 6 18:44:34 2001 Matthieu Lucotte ** Last update Sun Oct 7 02:53:00 2001 Matthieu Lucotte */ #ifndef __READLINE_H__ #define __READLINE_H__ char *readline(char *prompt); #endif /* __READLINE_H__ */ zssh-1.5c.debian.1.orig/fake_readline/readline0000777000175000017500000000000010363023741020025 2.ustar bartbartzssh-1.5c.debian.1.orig/Makefile.in0000600000175000017500000000761307733726616015557 0ustar bartbart# # Makefile.in for zssh # # Made by Matthieu Lucotte # Login # # Started on Thu Jun 29 19:04:08 2000 Matthieu Lucotte # Last update Mon Sep 22 22:18:54 2003 # #System specific vars prefix = @prefix@ exec_prefix = @exec_prefix@ MAKE = @MAKE@ INSTALL = @INSTALL@ TAR = @TAR@ AR = @AR@ RANLIB = @RANLIB@ CC = @CC@ CFLAGS = @CFLAGS@ @DEFS@ @EXTRA_CFLAGS@ CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ @EXTRA_LIBS@ LDFLAGS = @LDFLAGS@ EXTRA_DEPS = @EXTRA_DEPS@ #uncomment this for debug infos #CFLAGS += -DDEBUG # old stuff. safely ignore. # # uncomment this if your keyboard doesn't send combined key codes packed # The ALT-1 key will not be detected in this case, unless DUMB_KEYBOARD # is defined #CFLAGS += -DDUMB_KEYBOARD #End of system specific vars NAME = zssh VERSION = $(shell cat VERSION) PRGS = zssh ztelnet MANS = $(PRGS:=.1) # Files to be installed FILES = $(PRGS) $(MANS) SRC = completion.c doit.c escape.c escape_multi.c globbing.c init.c main.c misc.c openpty.c pc_test_escapes.c quote_removal.c signal.c split_words.c tilde_expansion.c util.c zmodem.c zmodem_act.c OBJS = $(SRC:.c=.o) INCL = config.h parse.h zssh.h # archive and packaging stuff # only used if you do a 'make rpm' RPMDIR = /usr/src/redhat # where to write archives BACKDIR = ${HOME}/backup # name of symlink to BACKDIR BACKLINK = backup # archives are chown-ed to BACKOWNER:BACKGROUP BACKOWNER = 500 BACKGROUP = $(BACKOWNER) TGZ = $(NAME)-$(VERSION).tgz RPMSPEC = $(NAME).spec RPMBUILDARCH = $(shell rpm --showrc | grep "^build arch" | cut -d: -f2 | xargs echo ) all: $(PRGS) $(NAME) : $(EXTRA_DEPS) version.h ${OBJS} $(CC) -o $(NAME) $(LDFLAGS) $(OBJS) $(LIBS) ztelnet : $(NAME) @-rm $@ > /dev/null 2>&1 ln $(NAME) $@ install : strip $(NAME) $(INSTALL) -m 0711 zssh @bindir@ ln -f @bindir@/zssh @bindir@/ztelnet $(INSTALL) -m 0644 $(MANS) @mandir@/man1 uninstall : -cd @bindir@ && rm $(PRGS) -cd @mandir@/man1 && rm $(MANS) fake_readline : force -cd fake_readline && $(MAKE) lrzsz : cd lrzsz-0.12.20 && ./configure --prefix=@prefix@ cd lrzsz-0.12.20 && $(MAKE) lrzsz_links : ln -s @bindir@/lrz @bindir@/rz ln -s @bindir@/lsz @bindir@/sz ln -s @bindir@/lrb @bindir@/rb ln -s @bindir@/lsb @bindir@/sb ln -s @bindir@/lrx @bindir@/rx ln -s @bindir@/lsx @bindir@/sx lrzsz_install : cd lrzsz-0.12.20 && $(MAKE) install # create source archive in ~/backup tgz $(TGZ) : distclean force @cdir=`pwd` && cdir=`basename $$cdir` && cd .. && \ echo "#################################################" && \ echo $(TAR) -cvzf "$(BACKDIR)/$(TGZ)" "$$cdir" && \ echo "#################################################" && echo -n "Press return" && read f && \ $(TAR) -cvzf "$(BACKDIR)/$(TGZ)" "$$cdir" ln -sf $(BACKDIR) $(BACKLINK) # create rpm and srpm rpm : $(RPMSPEC) @echo -n "Be sure to 'make tgz' before 'make rpm'. Usually must be root to succeed. Press return if ok" && read f cp -f $(BACKLINK)/$(TGZ) $(RPMDIR)/SOURCES rpm -ba $(RPMSPEC) $(INSTALL) -o $(BACKOWNER) -g $(BACKGROUP) -m 600 $(RPMDIR)/RPMS/$(RPMBUILDARCH)/$(NAME)-$(VERSION)-1.$(RPMBUILDARCH).rpm $(BACKLINK) $(INSTALL) -o $(BACKOWNER) -g $(BACKGROUP) -m 600 $(RPMDIR)/SRPMS/$(NAME)-$(VERSION)-1.src.rpm $(BACKLINK) $(RPMSPEC) : $(RPMSPEC:.spec=.spec.tpl) echo "%define ZSSHVER $(VERSION)" > $(RPMSPEC) cat $(RPMSPEC:.spec=.spec.tpl) >> $(RPMSPEC) version.h : force echo '#define ZSSH_VERSION "' `cat VERSION` ', built' `date` '"' > version.h fun.h : $(SRC) protos -o fun.h $(SRC) TAGS : etags *.[ch] new : clean all clean : -rm *.o *~ *.a \#*\# core $(PRGS) typescript nohup.out $(RPMSPEC) $(BACKLINK) distclean : clean -rm Makefile config.cache config.status config.log config.scan config.h TAGS -(cd lrzsz-0.12.20 && $(MAKE) distclean) -(cd fake_readline && $(MAKE) distclean) -(cd test && $(MAKE) distclean) autoconf: autoconf autoheader force : $(OBJS) : $(INCL) init.o : version.h zssh-1.5c.debian.1.orig/init.c0000600000175000017500000001265607733467133014620 0ustar bartbart/* ** init.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:01 2000 Matthieu Lucotte ** Last update Sun Sep 21 23:36:59 2003 */ #include "zssh.h" #include "version.h" int gl_master; /* pty fd */ int gl_slave; /* tty fd */ int gl_main_pid; volatile sig_atomic_t gl_child_output; /* pid of child handling output from the pty */ volatile sig_atomic_t gl_child_shell; /* pid of shell (ssh) */ volatile sig_atomic_t gl_child_rz; /* pid of child forked for use in the local shell */ int gl_local_shell_mode; volatile sig_atomic_t gl_interrupt; volatile sig_atomic_t gl_repeat; /* repeat action forever */ int gl_force; /* don't ask user questions */ struct termios gl_tt; /* initial term */ struct termios gl_rtt; /* raw mode term */ struct termios gl_tt2; /* ssh mode term */ struct winsize gl_win; sigset_t gl_sig_mask; char gl_escape; /* gl_escape = 'X' -> escape seq is ^X */ char **gl_shav; /* remote shell argv, defaults to ssh -e none */ void init_gl(int ac, char **av) { gl_master = gl_slave = 0; gl_main_pid = getpid(); gl_child_shell = gl_child_output = 0; gl_child_rz = 0; gl_force = 0; sigemptyset(&gl_sig_mask); sigprocmask(SIG_SETMASK, &gl_sig_mask, 0); gl_local_shell_mode = 0; gl_interrupt = 0; gl_escape = '@'; gl_shav = smalloc(4 * sizeof(char*)); if (strstr(av[0],"ztelnet")) { gl_shav[0] = "telnet"; gl_shav[1] = "-8"; gl_shav[2] = "-E"; gl_shav[3] = 0; } else { gl_shav[0] = "ssh"; gl_shav[1] = "-e"; gl_shav[2] = "none"; gl_shav[3] = 0; } if (tcgetattr(0, &gl_tt) < 0) error(0, "tcgetattr"); if (ioctl(0, TIOCGWINSZ, (char *)&gl_win) < 0) error(0, "ioctl TIOCGWINSZ"); gl_rtt = gl_tt; my_cfmakeraw(&gl_rtt); gl_tt2 = gl_rtt; } void version(int exit_prog) { printf("zssh version"); printf(ZSSH_VERSION); printf("\nCopyright (C) 2001 Matthieu Lucotte \n"); printf("zssh comes with ABSOLUTELY NO WARRANTY. Use at your own risk.\n"); printf("This is free software, and you are welcome to redistribute it\n"); printf("under certain conditions.\n"); printf("See the GNU General Public License for more details.\n"); if (exit_prog) exit (0); } void usage() { printf("\ Usage: zssh [zssh options] [--] [ssh options]\n\ ztelnet [zssh options] [--] [telnet options]\n\ \n\ Options:\n\ -f Do not ask user any question\n\ --force \n\ \n\ -h This help\n\ --help \n\ \n\ -s cmd run cmd as remote shell instead of the\n\ --shell cmd default \"ssh -e none\" (zssh) \n\ or \"telnet -8 -E\" (ztelnet) \n\ ex: zssh -s \"rsh -x\" \n\ \n\ -V show version\n\ --version \n\ \n\ -z ^X set escape sequence to ^X\n\ --zssh-escape ^X \n\ \n\ '--' may be used to separate zssh options from ssh ones \n\ Other options are passed verbatim to ssh/telnet.\n\ See also zssh/ssh/telnet man pages for more details\n\ "); exit (1); } /* set escape key * str : "^X" * -> set gl_escape to X */ int set_escape(char *str) { if (!str || !str[0] || str[0] != '^') { printf("Invalid escape sequence\n"); return -1; } gl_escape = str[1]; if ('a' <= gl_escape && gl_escape <= 'z') gl_escape += 'A' - 'a'; return 0; } /* Returns the key to press to generate the esc sequence * ^@ -> C-Space * ^X -> C-x */ char *escape_help() { static char str[40]; if (gl_escape == '@') sprintf(str,"C-Space"); else sprintf(str,"C-%c", tolower(gl_escape)); return (str); } void command_line_options(argc,argv) int *argc; char ***argv; { int ac = *argc; char **av = *argv; int i,j; int shift; int endzsshargs = 0; for (i = 1; i < ac && !endzsshargs; ) { shift = 0; if (!strcmp(av[i], "--")) { endzsshargs = 1; shift = 1; } if ((!strcmp(av[i], "-h") || !strcmp(av[i], "--help"))) usage(); if ((!strcmp(av[i], "-V") || !strcmp(av[i], "--version"))) version(1); if ((!strcmp(av[i], "-z") || !strcmp(av[i], "--zssh-escape"))) { if (i+1 == ac || strlen(av[i+1]) != 2 || set_escape(av[i+1]) < 0) usage(); shift = 2; } if (!strcmp(av[i], "-s") || !strcmp(av[i], "--shell")) { if (i+1 == ac) usage(); free(gl_shav); if (pc_test_escapes(av[i+1]) < 0) error("%s: parse error\n", av[i+1]); pc_split_words(av[i+1], &j, &gl_shav); pc_quote_removal(gl_shav, &j); shift = 2; } if (!strcmp(av[i], "-f") || !strcmp(av[i], "--force")) { gl_force = 1; shift = 1; } if (shift) { ac -= shift; for (j = i + shift; av[j]; j++) av[j - shift] = av[j]; av[j - shift] = 0; } else i++; } *argc = ac; *argv = av; } void init(argc,argv) int *argc; char ***argv; { char *str; #ifdef HAVE_LIBREADLINE initialize_readline(); #endif init_gl(*argc,*argv); if ((str = getenv("ZSSHESCAPE"))) if (set_escape(str) < 0) printf("Warning: invalid ZSSHESCAPE variable value\n"); command_line_options(argc,argv); getmaster(); getslave(); /* set current tty to raw mode */ tcsetattr(0, TCSAFLUSH, &gl_rtt); signal(SIGCHLD, sigchld_handler); } zssh-1.5c.debian.1.orig/openpty.c0000600000175000017500000002270007734213762015340 0ustar bartbart/* ** openpty.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:25 2000 Matthieu Lucotte ** Last update Wed Sep 24 00:05:06 2003 */ #include "zssh.h" #define GL_SLAVENAMELEN 50 static char gl_slavename[GL_SLAVENAMELEN + 1] = {0}; #define NEEDED /****************************************************************************/ #if defined(HAVE_OPENPTY) && defined(NEEDED) /****************************************************************************/ #undef NEEDED /* openpty exists in MacOS X */ #ifdef HAVE_UTIL_H #include #endif void getmaster() { #ifdef DEBUG printf("Using openpty() for tty allocation\n"); #endif if (openpty(&gl_master, &gl_slave, gl_slavename, &gl_tt, &gl_win) < 0) error(0,"openpty"); } void getslave() { testslave(gl_slavename); } /****************************************************************************/ #endif /* HAVE_OPENPTY */ /****************************************************************************/ /****************************************************************************/ #if defined(HAVE__GETPTY) && defined(NEEDED) /****************************************************************************/ #undef NEEDED /* _getpty(3) exists in SGI Irix 4.x, 5.x & 6.x -- it generates more pty's automagically when needed */ void getmaster() { char *name; #ifdef DEBUG printf("Using _getpty() to allocate pty\n"); #endif name = _getpty(&gl_master, O_RDWR, 0620, 0); if (!name) error(0, "_getpty"); strncpy(gl_slavename, name, GL_SLAVENAMELEN); } /* Open the slave side. */ void getslave() { #ifdef DEBUG printf("Allocated tty: %s\n", gl_slavename); #endif if ((gl_slave = open(gl_slavename, O_RDWR | O_NOCTTY)) < 0) error(0, "gl_slavename"); testslave(gl_slavename); if (tcsetattr(gl_slave, TCSAFLUSH, &gl_tt) < 0) error(0, "tcsetattr slave"); if (ioctl(gl_slave, TIOCSWINSZ, (char *)&gl_win) < 0) error(0, "ioctl TIOCSWINSZ slave"); } /****************************************************************************/ #endif /* HAVE__GETPTY */ /****************************************************************************/ /****************************************************************************/ #if defined(HAVE_DEV_PTMX) && defined(NEEDED) /****************************************************************************/ #undef NEEDED /* System V.4 pty routines from W. Richard Stevens */ #ifdef HAVE_STROPTS_H #include #endif /* HAVE_STROPTS_H */ #define DEV_CLONE "/dev/ptmx" void getmaster() { char *ttyptr; #ifdef DEBUG printf("Using SYSTEM V style tty allocation routine\n"); #endif #ifdef HAVE_GETPT gl_master = getpt(); #else gl_master = open(DEV_CLONE, O_RDWR); #endif /* HAVE_GETPT */ if (gl_master < 0) error(0, DEV_CLONE); if (!(ttyptr = ptsname(gl_master))) error(0, "ptsname"); strncpy(gl_slavename, ttyptr, GL_SLAVENAMELEN); #ifdef HAVE_GRANTPT call_grantpt(); #endif /* HAVE_GRANTPT */ #ifdef HAVE_UNLOCKPT if ( unlockpt(gl_master) < 0 ) /* clear slave's lock flag */ error(0,"unlockpt"); #endif /* HAVE_UNLOCKPT */ } /* * Open the slave half of a pseudo-terminal. */ void getslave() { if ( (gl_slave = open(gl_slavename, O_RDWR | O_NOCTTY)) < 0 ) /* open the slave */ error(0, "open slave"); #ifdef DEBUG printf("Allocated tty: %s\n", gl_slavename); #endif testslave(gl_slavename); #ifdef HAVE_ISASTREAM if (isastream(gl_slave)) { #ifdef DEBUG printf("Now calling ioctls to push term emulation modules:\n"); printf(" ioctl I_PUSH ptem\n"); printf(" ioctl I_PUSH ldterm\n"); printf(" ioctl I_PUSH ttcompat\n"); #endif if ( ioctl(gl_slave, I_PUSH, "ptem") < 0 ) error(0,"ioctl I_PUSH ptem"); if ( ioctl(gl_slave, I_PUSH, "ldterm") < 0 ) error(0,"ioctl I_PUSH ldterm"); /* Allow ttcompat to fail silently */ ioctl(gl_slave, I_PUSH, "ttcompat"); } #endif /* HAVE_ISASTREAM */ if (tcsetattr(gl_slave, TCSAFLUSH, &gl_tt) < 0) error(0, "tcsetattr slave"); if (ioctl(gl_slave, TIOCSWINSZ, (char *)&gl_win) < 0) error(0, "ioctl TIOCSWINSZ slave"); } /****************************************************************************/ #endif /* HAVE_DEV_PTMX */ /****************************************************************************/ /****************************************************************************/ #ifdef NEEDED /****************************************************************************/ /* BSD style tty/pty allocation routines */ static char gl_line[] = "/dev/ptyXX"; void getmaster() { char *pty, *bank, *cp; struct stat stb; int ok; #ifdef DEBUG printf("Using BSD style tty allocation routine\n"); #endif pty = &gl_line[strlen("/dev/ptyp")]; for (bank = "pqrs"; *bank; bank++) { gl_line[strlen("/dev/pty")] = *bank; *pty = '0'; if (stat(gl_line, &stb) < 0) break; for (cp = "0123456789abcdef"; *cp; cp++) { *pty = *cp; gl_master = open(gl_line, O_RDWR); if (gl_master >= 0) { strncpy(gl_slavename, gl_line, GL_SLAVENAMELEN); gl_slavename[strlen("/dev/")] = 't'; #ifdef HAVE_GRANTPT call_grantpt(); #endif /* HAVE_GRANTPT */ #ifdef HAVE_UNLOCKPT if (unlockpt(gl_master) < 0) error(0,"unlockpt"); #endif /* HAVE_UNLOCKPT */ /* verify slave side is usable */ ok = access(gl_slavename, R_OK | W_OK) == 0; if (ok) return; close(gl_master); } } } error("out of pty's\n", ""); } void getslave() { if ( (gl_slave = open(gl_slavename, O_RDWR | O_NOCTTY)) < 0) error(0, gl_slavename); #ifdef DEBUG printf("Allocated tty: %s\n", gl_slavename); #endif testslave(gl_slavename); if (tcsetattr(gl_slave, TCSAFLUSH, &gl_tt) < 0) error(0, "tcsetattr slave"); if (ioctl(gl_slave, TIOCSWINSZ, (char *)&gl_win) < 0) error(0, "ioctl TIOCSWINSZ slave"); } /****************************************************************************/ #endif /* BSD style ptys */ /****************************************************************************/ void my_tcsetpgrp(int fd, int pgrpid) { int ret; #ifdef HAVE_TCSETPGRP ret = tcsetpgrp(fd, pgrpid); #else ret = ioctl(fd, TIOCSPGRP, &pgrpid); #endif /* HAVE_TCSETPGRP */ if (ret < 0) error(0, "my_tcsetpgrp"); } /* set raw mode */ void my_cfmakeraw(struct termios *pt) { /* beginning of 'official' cfmakeraw function */ pt->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP |INLCR|IGNCR|ICRNL|IXON); pt->c_oflag &= ~OPOST; pt->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); pt->c_cflag &= ~(CSIZE|PARENB); pt->c_cflag |= CS8; /* end of 'official' cfmakeraw function */ pt->c_cc[VMIN] = 1; pt->c_cc[VTIME] = 0; /* pt->c_oflag |= OPOST; */ /* pt->c_lflag &= ~ECHO; */ } /* called by getslave() * test tty permissions and warn user if insecure */ void testslave(char *ttyname) { struct stat st; struct passwd *pwd; int ask = 0; if (fstat(gl_slave, &st) < 0) error(0, "fstat tty"); if (st.st_uid != getuid()) { /* tty is not owned by the user, this can be a security issue so prompt the user */ if ( (pwd = getpwuid(st.st_uid)) ) printf("*** %s: This tty is owned by someone else (%s) !\n", ttyname, pwd->pw_name); else printf("*** %s: This tty is owned by someone else (uid %lu) !\n", ttyname, (long) st.st_uid); ask = 1; } if (st.st_mode & S_IWOTH) /* tty is world writeable: this can be abused but there is no serious security issue here * so just print a warning. */ printf("*** %s: this tty is world writeable !\n", ttyname); if (st.st_mode & S_IROTH) { /* tty is world readable: this is very insecure so prompt the user */ printf("*** %s: this tty is world readable !\n", ttyname); ask = 1; } if (ask) { printf("*** This is a security issue\n"); if (!ask_user("Do you want to continue anyway ?", 0, 1)) error("aborting\n", ""); } } /* init slave after call to getslave * make slave the controlling tty for current process */ void initslave() { close(gl_master); setsid(); /* by now we should have dropped the controlling tty * make sure it is indeed the case */ if (open("/dev/tty", O_RDWR) >= 0) error("Couldn't drop controlling tty\n",""); #ifdef TIOCSCTTY if (ioctl(gl_slave, TIOCSCTTY, 0) < 0) perror("ioctl(slave, TIOCSCTTY, 0)"); #else /* re-open the tty so that it becomes the controlling tty */ close(gl_slave); if ( (gl_slave = open(gl_slavename, O_RDWR)) < 0 ) error(0, gl_slavename); #endif /* TIOCSCTTY */ if (dup2(gl_slave, 0) < 0) error(0, "dup2(slave, 0)"); dup2(gl_slave, 1); dup2(gl_slave, 2); close(gl_slave); } #ifdef HAVE_GRANTPT /* Call grantpt(). If it fails, prompt the user whether * to continue anyway despite the security issue. */ void call_grantpt() { static int answered = 0; /* SIGCHLD should NOT be handled at this point otherwise it * may interfere with grantpt */ signal(SIGCHLD, SIG_DFL); if (grantpt(gl_master) < 0 && !answered) { perror("grantpt"); printf("*** Calling grantpt() failed. This can be a security issue\n" "*** as another user may be able to spy on this session\n"); if (!ask_user("Do you want to continue anyway ?", 0, 1)) error("aborting\n", ""); answered = 1; } } #endif /* HAVE_GRANTPT */ zssh-1.5c.debian.1.orig/quote_removal.c0000600000175000017500000000216707357750642016535 0ustar bartbart/* ** quote_removal.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:43 2000 Matthieu Lucotte ** Last update Sat Oct 6 23:53:06 2001 Matthieu Lucotte */ #include "zssh.h" int pc_remove_backslash(str,i) char *str; int *i; { if (str[*i] != '\\') return (0); str_shift(str,*i,1); if (!str[*i]) return (-1); (*i)++; return (1); } int pc_remove_double_chr(str,i,chr) char *str; int *i; char chr; { str_shift(str,*i,1); while (str[*i] && str[*i] != chr) if (pc_remove_backslash(str,i) <= 0) (*i)++; if (!str[*i]) return (-1); str_shift(str,*i,1); return (1); } void pc_quote_removal(av,ac) char **av; int *ac; { int i; int j; char *str; for (i = 0;i < *ac;i++) if ((str = av[i])) { if (!strcmp(str,"#")) { op_shift(av + i,*ac - i - 1); *ac = i + 1; } else for (j = 0;str[j];) if (str[j] == '"' || str[j] == '\'') pc_remove_double_chr(str, &j, str[j]); else if (pc_remove_backslash(str, &j) <= 0) j++; } } zssh-1.5c.debian.1.orig/VERSION0000600000175000017500000000000507733726501014537 0ustar bartbart1.5c zssh-1.5c.debian.1.orig/main.c0000600000175000017500000000624407725006042014562 0ustar bartbart/* ** main.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:13 2000 Matthieu Lucotte ** Last update Mon Sep 1 23:18:58 2003 */ #include "zssh.h" int main(argc, argv) int argc; char **argv; { init(&argc,&argv); printf("Press ^%c (%s) to enter file transfer mode, then ? for help\n", gl_escape, escape_help()); fflush(stdout); if (!sfork(&gl_child_output)) dooutput(); if (!sfork(&gl_child_shell)) doshell(argc, argv, gl_shav); doinput(); return (0); } /* old stuff: test Alt-1 as escape sequence * scary stuff. fortunately it's dummied out */ #if 0 int escape_input(cc,ibuf) int *cc; unsigned char *ibuf; { if (*cc == 1 && ibuf[0] == 0xb1) /* Alt-1 X11 key code */ return (1); #ifndef DUMB_KEYBOARD if (*cc >= 2 && ibuf[0] == 27 && ibuf[1] == '1') /* Alt-1 text key code */ return (1); #else if (*cc == 1 && ibuf[0] == 27) { int i; char c; usleep(40000); i = fcntl(0,F_GETFL,0); i |= O_NONBLOCK; fcntl(0,F_SETFL,i); read_input(cc,ibuf); i = fcntl(0,F_GETFL,0); i &= ~O_NONBLOCK; fcntl(0,F_SETFL,i); if (*cc >= 1 && ibuf[0] == '1') /* Alt-1 text key code, dumb keyboard */ return (1); else { c = 27; write(gl_master,&c,1); } } #endif return (0); } #endif /* 0 */ /* new one: test escape sequence * NB: customizing Ctrl-Something escape sequences is easy ... * Alt-Something is not. */ int escape_input(cc,ibuf) int *cc; unsigned char *ibuf; { if (*cc == 1 && ibuf[0] == gl_escape - '@') /* escape key code */ return (1); return (0); } void read_input(cc,ibuf) int *cc; unsigned char *ibuf; { *cc = read(0,ibuf,BUFSIZ); #ifdef DEBUG_CRAZY { int i; for (i = 0;i < *cc;i++) printf("%02i ", ibuf[i]); printf("\n"); } #endif } /* switch to local shell mode */ void rz_mode() { char **av; int ac; int i,k; char *line; gl_local_shell_mode = 1; kill(gl_child_output,SIGSTOP); /* suspend output */ printf("\n"); printf("\r"); /* tcgetattr(0, &gl_rtt); */ tcgetattr(gl_slave, &gl_tt2); /* save slave tty state */ /* TCSAFLUSH causes problems on some systems */ tcsetattr(0, TCSANOW, &gl_tt); /* was in raw mode */ for (i = 0; i < 100; ) /* action codes >= 100 exit */ { line = zprompt(); if (zparse(&line, &av, &ac) < 0) continue; i = zrun(av); free(line); for (k = 0; k < ac; k++) if (av[k]) free(av[k]); } tcsetattr(0, TCSANOW, &gl_rtt); /* restore raw term */ kill(gl_child_output, SIGCONT); /* resume output */ gl_local_shell_mode = 0; } void fail() { done(1); } /* should be called only by main process */ void done(ret) int ret; { if (getpid() != gl_main_pid) error("done() should only be called by main process",""); if (gl_child_rz) kill(gl_child_rz, SIGTERM); if (gl_child_shell) kill(gl_child_shell, SIGTERM); if (gl_child_output) { usleep(500); kill(gl_child_output, SIGTERM); tcsetattr(0, TCSAFLUSH, &gl_tt); } exit (ret); } zssh-1.5c.debian.1.orig/config.h.in0000600000175000017500000000577307734213411015523 0ustar bartbart/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* ** acconfig.h ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sat Oct 6 02:21:45 2001 Matthieu Lucotte ** Last update Thu Oct 11 16:51:21 2001 Matthieu Lucotte */ /* * acconfig.h - template used by autoheader to create config.h.in * config.h.in - used by autoconf to create config.h * config.h - created by autoconf; contains defines generated by autoconf */ /* Define if the `getpgrp' function takes no argument. */ #undef GETPGRP_VOID /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you have SYSV-style /dev/ptmx and /dev/pts/. */ #undef HAVE_DEV_PTMX /* Define this if you have getpseudotty() (DYNIX/ptx 2.1) */ #undef HAVE_GETPSEUDOTTY /* Define if you have /dev/pts and /dev/ptc devices (as in AIX). */ #undef HAVE_DEV_PTS_AND_PTC /* Define this if you have sco-style pty:s (ptyp0, ..., ptyp9, ptyp10...) */ #undef HAVE_DEV_PTYP10 /* Define this if you have libreadline v4.2 or greater */ #undef HAVE_READLINE_4_2_OR_GREATER /* Define if you have the _getpty function. */ #undef HAVE__GETPTY /* Define if you have the getpseudotty function. */ #undef HAVE_GETPSEUDOTTY /* Define if you have the getpt function. */ #undef HAVE_GETPT /* Define if you have the grantpt function. */ #undef HAVE_GRANTPT /* Define if you have the isastream function. */ #undef HAVE_ISASTREAM /* Define if you have the openpty function. */ #undef HAVE_OPENPTY /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the tcsetpgrp function. */ #undef HAVE_TCSETPGRP /* Define if you have the unlockpt function. */ #undef HAVE_UNLOCKPT /* Define if you have the header file. */ #undef HAVE_ERR_H /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_PATHS_H /* Define if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define if you have the header file. */ #undef HAVE_STROPTS_H /* Define if you have the header file. */ #undef HAVE_SYS_CDEFS_H /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_TERMIOS_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the header file. */ #undef HAVE_UTIL_H /* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE zssh-1.5c.debian.1.orig/misc.c0000600000175000017500000000425407361435405014575 0ustar bartbart/* ** misc.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:19 2000 Matthieu Lucotte ** Last update Thu Oct 11 20:36:21 2001 Matthieu Lucotte */ #include "zssh.h" char *chr2str(chr) char chr; { char *pt; pt = smalloc(2 * sizeof(char)); *pt = chr; pt[1] = 0; return (pt); } char whitespaces[] = { ' ', '\t', '\n', 0 }; int mi_is_whitespace(chr) char chr; { int j; for (j = 0;whitespaces[j];j++) if (chr == whitespaces[j]) return (1); return (0); } /* exit from program */ void error(s1,s2) char *s1; char *s2; { if (!s1) perror(s2); else fprintf(stderr, s1, s2); if (getpid() == gl_main_pid) done(-1); exit (-1); } /* just displays an error message */ int error_msg(s1,s2) char *s1; char *s2; { if (!s1) perror(s2); else fprintf(stderr, s1, s2); return (-1); } void op_shift(argv,n) char **argv; int n; { int i; for (i = 0;i < n;i++) if (argv[i]) { free(argv[i]); argv[i] = 0; } for (i = n;argv[i];i++) argv[i - n] = argv[i]; argv[i - n] = 0; } void flush(fd) int fd; { int i, mode, tot = 0; char buff[4096]; mode = fcntl(fd,F_GETFL,0); fcntl(fd,F_SETFL,mode | O_NONBLOCK); do { tot += i = read(fd,buff,4096); usleep(50); } while (i > 0); fcntl(fd,F_SETFL,mode); #ifdef DEBUG printf("flushed fd#%i: %i\n",fd,tot); #endif } /* ask the user a question, answer should be y, Y, n, or N * or nothing in which case def_ans is returned */ int ask_user(char *question, int def_ans, int forced_ans) { char *str; char buf[50]; int res = def_ans; if (gl_force) return (forced_ans); if (def_ans) str = "[Y/n]"; else str = "[y/N]"; while (1) { printf("%s %s: ", question, str); fflush(stdout); while (read(0, buf, 49) <= 0) ; if (buf[0] == '\n') break; if (buf[0] == 'y' || buf[0] == 'Y') { res = 1; break; } if (buf[0] == 'n' || buf[0] == 'N') { res = 0; break; } } return (res); } zssh-1.5c.debian.1.orig/globbing.c0000600000175000017500000000212407357762564015435 0ustar bartbart/* ** globbing.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:09:55 2000 Matthieu Lucotte ** Last update Sun Oct 7 01:17:40 2001 Matthieu Lucotte */ #include "zssh.h" #include void glob_args(ac,av) int *ac; char ***av; { int i,j,flags; glob_t glb; int ac2; char **av2; flags = 0; #ifdef GLOB_BRACE flags |= GLOB_BRACE; #endif /*#ifdef GLOB_TILDE */ /* flags |= GLOB_TILDE; */ /*#endif */ av2 = smalloc(TAB_STEP * sizeof(char *)); ac2 = 0; for (i = 0; (*av)[i]; i++) { if (glob((*av)[i], flags, 0, &glb) != 0 || !glb.gl_pathc) write_vector_word((*av)[i], &ac2, &av2); else { for (j = 0; glb.gl_pathv[j]; j++) write_vector_word(glb.gl_pathv[j], &ac2, &av2); } free((*av)[i]); globfree(&glb); } free(*av); av2[ac2++] = 0; *av = av2; *ac = ac2; } void write_vector_word(str,argc,argv) char *str; int *argc; char ***argv; { (*argv)[(*argc)++] = strdup(str); if (!(*argc % TAB_STEP)) pc_new_tab(argc,argv); } zssh-1.5c.debian.1.orig/util.c0000600000175000017500000000455007725004016014610 0ustar bartbart/* ** util.c ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Tue Oct 2 20:28:27 2001 Matthieu Lucotte ** Last update Mon Sep 1 23:01:34 2003 */ #include "zssh.h" /* shift position i by n chars * Ex : str_shift("1234567",2,3) -> "1267" * ||| */ void str_shift(str,i,n) char *str; int i; int n; { int j; for (j = i;str[j + n];j++) str[j] = str[j + n]; str[j] = str[j + n]; } char *str_n_dup(str,n) char *str; int n; { char *pt; int i; int len; len = min(strlen(str),n); pt = smalloc(len + 1); for (i = 0;i < len;i++) pt[i] = str[i]; pt[len] = 0; return (pt); } char *str_cat(str1,str2) char *str1; char *str2; { int i; int len1; int len2; char *str_res; len1 = strlen(str1); len2 = strlen(str2); if ((str_res = smalloc(len1 + len2 + 1)) == 0) return (0); for (i = 0;i < len1;i++) str_res[i] = str1[i]; for (i = 0;i <= len2;i++) str_res[len1 + i] = str2[i]; return (str_res); } void str_sub_repl(str,sub_beg,sub_len,sub_repl) char **str; int sub_beg; int sub_len; char *sub_repl; { char *s1; char *s2; s1 = s2 = str_n_dup(*str,sub_beg); s1 = str_cat(s1,sub_repl); free(s2); s2 = s1; s1 = str_cat(s1,*str + sub_beg + sub_len); free(s2); free(*str); *str = s1; } void *smalloc(n) unsigned int n; { void *pt; if ((pt = malloc(n)) != 0) return (pt); error(0, "malloc"); exit (1); } /*int sfork() */ /*{ */ /* int pid; */ /* */ /* pid = fork(); */ /* if (pid == -1) */ /* error(0,"fork"); */ /* return (pid); */ /*} */ /* sfork(): Exits if unable to fork * if pid_child is non zero, also avoids race condition that would occur * if the child's pid must be known by the parent *before* the child dies. */ int sfork(volatile int *pid_child) { sigset_t mask; sigset_t old_mask; int pid; sigprocmask(SIG_SETMASK, 0, &old_mask); /* save mask */ sigprocmask(SIG_SETMASK, 0, &mask); sigaddset(&mask, SIGCHLD); sigprocmask(SIG_SETMASK, &mask, 0); /* block SIGCHLD */ pid = fork(); if (pid == -1) error(0, "fork"); if (pid) /* parent process */ if (pid_child) *pid_child = pid; sigprocmask(SIG_SETMASK, &old_mask, 0); /* restore old mask */ return (pid); } zssh-1.5c.debian.1.orig/parse.h0000600000175000017500000000212407356432613014755 0ustar bartbart/* ** parse.h for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:10:32 2000 Matthieu Lucotte ** Last update Thu Jun 29 19:10:33 2000 Matthieu Lucotte */ #ifndef __ESCAPE_H__ #define __ESCAPE_H__ #define TAB_STEP 512 typedef struct { char *str; long (*f)(long, long); int prio; } t_arith_op; #include typedef struct { char *user; char *dir; } t_tilde_ent; #define TILDE_TAB_STEP 100 #define TILDE_SEARCH_STEP 10 typedef struct { t_tilde_ent *tilde_tab; int tilde_tab_size; } t_pc_env; #define ESC_DQUOTES 1 #define ESC_SQUOTES 2 #define ESC_BCKSLASH 4 #define ESC_PARENT 8 #define ESC_DOLLAR_PAR 16 #define ESC_DOLLAR_BRA 32 #define ESC_BQUOTES 64 #define ESC_COMMON (ESC_DQUOTES | ESC_SQUOTES | ESC_BCKSLASH) #define ESC_SPLIT (ESC_DQUOTES | ESC_SQUOTES | ESC_BQUOTES | \ ESC_BCKSLASH | ESC_DOLLAR_PAR | ESC_DOLLAR_BRA) typedef struct { int flag; int (*f)(char *str, int *i, char c1, char c2); char c1; char c2; } t_escape; #endif /* __ESCAPE_H__ */ zssh-1.5c.debian.1.orig/zssh.10000600000175000017500000001424607360105556014551 0ustar bartbart.\" -*- nroff -*- .\" .\" zssh.1 .\" .\" Author: Matthieu Lucotte .\" .\" Copyright (c) 2000 Matthieu Lucotte France .\" All rights reserved .\" .\" Created: Mon Jun 26 23:18:13 2000 .TH ZSSH 1 "June 26, 2000" "ZSSH" "ZSSH" .SH NAME zssh \- interactive file transfer wrapper for ssh .SH SYNOPSIS .B zssh [zssh options] [--] [ssh options] .br .B ztelnet [zssh options] [--] [telnet options] .SH DESCRIPTION .LP .B zssh (Zmodem SSH) is a program for interactively transferring files to a remote machine while using the secure shell ( .B ssh ). It is intended to be a convenient alternative to .B scp , allowing to transfer files without having to open another session and re-authenticate oneself. zssh is an interactive wrapper for ssh used to switch the ssh connection between the remote shell and file transfers. This is achieved by using another tty/pty pair between the user and the local ssh process to plug either the user's tty (remote shell mode) or another process (file transfer mode) on the ssh connection. ztelnet behaves similarly to zssh, except telnet is used instead of ssh. It is equivalent to 'zssh -s "telnet -8 -E"' Files are transferred through the .I zmodem protocol, using the .B rz and .B sz commands. zssh behaves as an usual ssh session until the escape sequence is depressed ( default is .B ^@ which can be produced by pressing C-space, or C-2, or C-` ), which enables file transfer mode. A new prompt is then displayed, and commands can be executed locally to initiate file transfers (among other things). It roughly behaves as a local shell featuring line edition, history and completion (thanks to libreadline), globbing, and escape characters ( " ' and \\ ). The following builtins are handled by zssh itself: .B ? , .B cd , .B disconnect , .B escape , .B exit , .B help , .B hook , .B quit , .B repeat , .B rz , .B suspend , .B sz , .B version .PP .PD 0 .TP 20 .B cd change current directory .TP 20 .B disconnect disconnect and exit .TP 20 .B escape [^X] Change escape key to ^X. Without argument, print current escape key .TP 20 .B exit exit file transfer mode. ^D may also be used for this purpose. .TP 20 .B help print help and tips .TP .B ? .TP 20 .B hook prg [args] Hook program 'prg' on the the pty. Its standard input and output will go through the ssh channel. .br typing 'sz'/'rz' is in fact equivalent to 'hook sz'/'hook rz' .br A weird imagination is most useful to gain full advantage of this feature. .TP 20 .B quit same as exit. .TP 20 .B repeat repeats cmd forever (^C to interrupt). Useful for example if you use a remote script invoking "sz" and you don't want to be typing "rz" each time... Remember however that several files can be transferred by a single sz/rz pair so this is not usually necessary to use repeat. .TP 20 .B rz Receive files from the remote machine. runs rz and plugs the process on the ssh connection. running sz on the REMOTE machine is required : .TP 25 .B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1) run `sz ...' from the remote machine shell .TP .B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2) press the escape sequence (C-space) to enter file transfer mode .TP .B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3) run the `rz' builtin .TP 20 .B suspend suspend zssh (back to the local machine shell) .TP 20 .B sz ... Send files to the remote machine. runs sz and plugs the process on the ssh connection. There is no need to manually run rz on the remote side. .TP 20 .B version print version information .PD .PP builtins .B rz , .B sz , .B hook and .B exit return to shell mode after completion. .SH OPTIONS .LP .PP .PD 0 .TP 20 .B -f .TP .B --force Do not ask user any question .TP .B -h .TP .B --help show basic help .TP .B -s cmd .TP .B --shell cmd run cmd as remote shell instead of the default "ssh -e none" (zssh) or "telnet -8 -E" (ztelnet) .br ex: zssh -s "rsh -x" .TP .B -V .TP .B --version show version .TP .B -z ^X .TP .B --zssh-escape ^X set escape sequence to ^X .PD .PP .B -- may be used to separate zssh options from ssh ones .br Other arguments are passed verbatim to ssh/telnet/whatever. .SH ENVIRONMENT .LP .PP .PD 0 .TP 10 .B ZSSHESCAPE Setting the ZSSHESCAPE environment variable allows to override the default escape sequence. ZSSHESCAPE should contain only two characters of the form `^X', meaning that ^X is to be the new escape sequence. .PD .PP .SH REQUIREMENTS .LP the following binaries need to be properly installed for zssh to work : .TP 10 .B ssh/telnet/... the remote shell to be executed (local machine) .TP .B sz rz zmodem send and receive programs. Should be both on local and remote machine, and (hopefully) of compatible versions. .LP .SH TIPS .LP If file transfer is initiated but never completes .br ( ie a line like : Bytes Sent: 38144/4610624 BPS:3424 ETA 22:15 or Bytes Sent: 0/ 513 BPS:0 ETA 00:00 Retry 0: Got ZCAN can be seen, but transfer never completes .br ) .br Chances are the pty/tty on one of the systems are not 8-bit clean. (Linux is 8-bit clean, NetBSD is not). .br Using the -e (escape) option of rz should solve this problem. Transfers can be interrupted with ^C (somewhat experimental =) If you get stuck in rz/sz (for example you've just ran rz, but you then decided not to transmit anything), hit a dozen ^X (Ctrl-X, not the zssh escape!) to stop it Use `sz -y ' to overwrite files on the other side .SH BUGS / LIMITATIONS .LP You may sometimes have to hit return 2 or 3 times after file transfer completion in order get back to the shell. Some digits are usually displayed; don't worry it won't harm (you or your term) ... the tty may (sometimes) be somewhat upset after an interrupted transfer ( using ^C ). typing `reset' in this case should help. no pipe, redirection (and other stuff) support in shell ... but after all there are already wonderful shells around =) .SH CREDITS ttssh's author - Robert O'Callahan - for the original idea The sourceforge team. .SH AUTHOR Matthieu Lucotte zssh homepage: http://zssh.sourceforge.net .SH SEE ALSO .BR ssh (1), .BR telnet (1), .BR scp (1), .BR sz (1), .BR rz (1), .BR readline (3), zssh-1.5c.debian.1.orig/zssh.h0000600000175000017500000001023407725005310014621 0ustar bartbart/* ** zssh.h for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:11:37 2000 Matthieu Lucotte ** Last update Mon Sep 1 23:13:12 2003 */ /* -------------REMOTE------------- ----------------------------LOCAL--------------------------- * ************** * ** zssh input ** <- * ******** ******** ******* / ************** \ * ** bash ** ** sshd ** <==ssh_channel==> ** ssh ** ** zssh output ** * *************** * * in file transfer mode the output process is stopped, and the input process forks * and connects whatever new process is needed * * Processs genealogy: * zssh_input * / | \ * zssh_output ssh rz * */ #ifndef __ZSSH_H__ #define __ZSSH_H__ /* for getpt and ptsname in stdlib.h */ #define _GNU_SOURCE #include "config.h" #ifdef STDC_HEADERS #include #include #include #include #include #include #include #include #include /*#include alpha */ #include #include #endif /* STDC_HEADERS */ #ifdef HAVE_TERMIOS_H #include #else #include #endif /*HAVE_TERMIOS_H*/ #ifdef HAVE_SYS_WAIT_H #include #endif /*HAVE_SYS_WAIT_H*/ #ifdef HAVE_SYS_PARAM_H #include #endif /*HAVE_SYS_PARAM_H*/ #ifdef HAVE_FCNTL_H #include #endif /*HAVE_FCNTL_H*/ #ifdef HAVE_PATHS_H #include #endif /*HAVE_PATHS_H*/ #ifdef HAVE_SYS_IOCTL_H #include #endif /*HAVE_SYS_IOCTL_H*/ #ifdef HAVE_SYS_TIME_H #include #endif /*HAVE_SYS_TIME_H*/ #if 0 #ifdef HAVE_SYS_TERMIOS_H #include #else #include #endif /*HAVE_TERMIO_H*/ #endif #ifdef HAVE_UNISTD_H #include #endif /*HAVE_UNISTD_H*/ #ifdef HAVE_ERR_H #include /*Net*/ #endif /*HAVE_ERR_H*/ #ifdef HAVE_SYS_CDEFS_H #include /*Net*/ #endif /*HAVE_SYS_CDEFS_H*/ #ifdef _SUNOS_VTOC_8 #define SOLARIS #endif #ifndef WAIT_ANY #define WAIT_ANY (-1) #endif #ifndef SECSPERMIN #define SECSPERMIN (60) #endif /*Actions leaving the user in the file xmission mode */ #define C_SHELL 1 #define C_HELP 2 #define C_CD 3 #define C_REPEAT 4 #define C_ESCAPE 5 #define C_VERSION 6 #define C_SUSPEND 7 #define C_DISCONNECT 8 /*Actions exiting xmission mode after completiion */ #define C_RZ 100 #define C_SZ 101 #define C_HOOK 102 #define C_EXIT 103 #define min(a,b) ((a) < (b) ? (a) : (b)) typedef struct { char *name; int n; void (*f)(char **av, int master); } t_act_tab; extern t_act_tab cmdtab[]; extern int gl_master; /* pty fd */ extern int gl_slave; /* tty fd */ extern int gl_main_pid; extern volatile sig_atomic_t gl_child_output; /* pid of child handling output from the pty */ extern volatile sig_atomic_t gl_child_shell; /* pid of shell (ssh) */ extern volatile sig_atomic_t gl_child_rz; /* pid of child forked for use in the local shell */ extern int gl_local_shell_mode; extern volatile sig_atomic_t gl_interrupt; extern volatile sig_atomic_t gl_repeat; /* repeat action forever */ extern int gl_force; /* don't ask user questions */ extern struct termios gl_tt; /* initial term */ extern struct termios gl_rtt; /* raw mode term */ extern struct termios gl_tt2; /* ssh mode term */ extern struct winsize gl_win; extern sigset_t gl_sig_mask; extern char gl_escape; /* gl_escape = 'X' -> escape seq is ^X */ extern char **gl_shav; /* remote shell argv, defaults to ssh -e none */ #include "parse.h" int grantpt(int); int unlockpt(int); #include "fun.h" #endif /* __ZSSH_H__ */ zssh-1.5c.debian.1.orig/INSTALL0000600000175000017500000000372107733747143014535 0ustar bartbart Dependencies : libreadline, libtermcap and their headers must be properly installed (if you're using rpm, make sure the packages readline, readline-devel, libtermcap, libtermcap-devel are installed) **************************************************************************** Just follow the usual steps : > ./configure (edit Makefile) > make > su # make install **************************************************************************** Testing tools: the test/ directory has a few tools to trace tty problems. **************************************************************************** NetBSD ------ you may have to tell configure where to find libreadline, which is usually in /usr/pkg/lib : CFLAGS=-I/usr/pkg/include LIBS=-L/usr/pkg/lib ./configure **************************************************************************** If compilation fails, edit the Makefile produced by the configure script to ensure it is correct for your system. If you want to install the rz/sz commands from the lrzsz package (probably because you don't have them, or they don't work), you'll also have to : > make lrzsz > su # make lrzsz_install # make lrzsz_links (make symlinks : sz -> lsz, rz -> lrz ...) ** Also, make _sure_ the new programs are run and not the old ones ** -> Check your path / (re)move the old ones / do as you wish ** `whereis sz' should answer /usr/local/bin/sz (or where-ever you put it) Also remember that sz and rz need to be installed on the remote host and (preferably) be somewhat compatible with your local versions for the magic to work. Hopefully, rz and sz will already be there and working =) arch: tested on - linux - NetBSD - OpenBSD - FreeBSD you're on your own anywhere else ... (though POSIX should be ok) other make rules : clean : cleans temporary and binary files distclean : even removes autoconf files config.h, Makefile uninstall : remove installed files zssh-1.5c.debian.1.orig/CHANGES0000600000175000017500000000651007734216271014470 0ustar bartbartversion 1.5c Jim Grishaw - fixes for cygwin - added tty test suite (test/ directory) ----------------------------- version 1.5b Richard Hoyle - fix problem with initial flush of tty on some systems (slackware 9.0) - cleanup, got rid of c++ style comments, fixed warnings ----------------------------- version 1.5a - now compiles with readline v4.2 - works on MacOS X config: - detect readline headers - fixed configure.in bug (-ltermcap not needed in AC_CHECK_LIB) (Jeff Squyres) ----------------------------- v1.5 - now compiles under solaris - added hostname in prompt - fixed tilde expansion: used to done by glob()'s GLOB_TILDE option which is not supported everywhere, and is buggy ( substitutes in ~/a/b but not in ~/a/b/c !) some more code now replaces this ... - improved completion : builtin, tilde and pathname completions - cleaned/rewrote openpty.c - ask user whether to continue after failed grantpt() or if using a tty with dangerous perms - check that old controlling tty has been dropped - under linux use /dev/ptmx if available instead of /dev/pty* - should be easier to port - added 'suspend' and 'disconnect' builtins - fixed race conditions due to fork() - fixed signal handlers : they have to reset themselves so that it works everywhere ... - fixed some memory leaks - cleaning cleaning cleaning - added '--force' option to avoid being asked questions (doesn't suppres warnings though) - added '--' option to allow separation of zssh options from ssh options - handle quotes in --shell option, so that we can now do some really weird stuff such as: zssh -s "sh -c 'ps aux | grep ssh'" config: - detect pty functions/devices available - added '--disable-readline' option of configure to allow building zssh without libreadline - use -Wall compiler option if available ----------------------------- v1.4 - added escape key help msg - fixed rpm spec file bug - added escape builtin : allows to change the escape key - added -s switch to allow the remote shell to be changed - fixed bug with child handling (delay in sfork) - added hook builtin : allows to hook any proram to the tty/pty, not just rz and sz - added ztelnet hard link : remote logging prg defaults to "telnet -8 -E" instead of "ssh -e none" ------------------------------ v1.3 - Fixed a bug that cause the app to segfault under FreeBSD (globbing.c:27) - Added redefinable escape sequence (environment variable and command line arg) - tilde expansion is now performed (provided the GLOB_TILDE flag is supported by the glob(3) function) ------------------------------ v1.2* - Install problem fixes mainly ------------------------------ v1.1 - Changed escape sequence from Alt-1 to ^@ (C-space) Alt-1 is bound by default under window maker and Ctrl-x sequences will be easier to customize. ------------------------------ v1.0 - Removed sending of "rz" command to the remote shell, it seems it works just fine without ! - Fixed ^D in local shell... caused segfault - ^C works when sz-ing (^X sent to interrupt remote rz) rz-ing not tested yet - Added test for both text and X11 Alt-1 key codes - fixed bug in shell escapes handling : used to exit on parse error ! - Added builtin 'repeat' - Now correctly flushes output after ^C during transfert The tty should no longer be polluted ! zssh-1.5c.debian.1.orig/version.h0000600000175000017500000000010307733754046015331 0ustar bartbart#define ZSSH_VERSION " 1.5c , built Tue Sep 23 01:20:38 EDT 2003 " zssh-1.5c.debian.1.orig/split_words.c0000600000175000017500000000261207357747310016215 0ustar bartbart/* ** split_words.c for zssh ** ** Made by Matthieu Lucotte ** Login ** ** Started on Thu Jun 29 19:11:06 2000 Matthieu Lucotte ** Last update Sat Oct 6 23:40:56 2001 Matthieu Lucotte */ #include "zssh.h" void pc_new_tab(argc,argv) int *argc; char ***argv; { char **pt; pt = smalloc((*argc + TAB_STEP) * sizeof(char *)); memcpy(pt, *argv, *argc * sizeof(char *)); free(*argv); *argv = pt; } void pc_mk_word(str,pos,argc,argv) char **str; int *pos; int *argc; char ***argv; { int len; if ((len = *pos)) { (*argv)[(*argc)++] = str_n_dup(*str,len); if (!(*argc % TAB_STEP)) pc_new_tab(argc,argv); *str += len; *pos = 0; } while (**str && mi_is_whitespace(**str)) (*str)++; } int pc_ok_split(comm,pos,i) char *comm; int pos; int i; { if ((!pos || mi_is_whitespace(comm[pos - 1]))) return (1); return (0); } void pc_split_words(comm,argc,argv) char *comm; int *argc; char ***argv; { int pos; int i; *argv = smalloc(TAB_STEP * sizeof(char *)); *argc = 0; while (mi_is_whitespace(*comm)) comm++; for (pos = 0;comm[pos];) if ((i = pc_escape_multi(comm,&pos,ESC_COMMON)) <= 0) { if (mi_is_whitespace(comm[pos])) pc_mk_word(&comm,&pos,argc,argv); else pos++; } pc_mk_word(&comm,&pos,argc,argv); (*argv)[(*argc)++] = 0; } zssh-1.5c.debian.1.orig/acconfig.h0000600000175000017500000000161007361403111015376 0ustar bartbart/* ** acconfig.h ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sat Oct 6 02:21:45 2001 Matthieu Lucotte ** Last update Thu Oct 11 16:51:21 2001 Matthieu Lucotte */ /* * acconfig.h - template used by autoheader to create config.h.in * config.h.in - used by autoconf to create config.h * config.h - created by autoconf; contains defines generated by autoconf */ @TOP@ /* Define if you have SYSV-style /dev/ptmx and /dev/pts/. */ #undef HAVE_DEV_PTMX /* Define this if you have getpseudotty() (DYNIX/ptx 2.1) */ #undef HAVE_GETPSEUDOTTY /* Define if you have /dev/pts and /dev/ptc devices (as in AIX). */ #undef HAVE_DEV_PTS_AND_PTC /* Define this if you have sco-style pty:s (ptyp0, ..., ptyp9, ptyp10...) */ #undef HAVE_DEV_PTYP10 /* Define this if you have libreadline v4.2 or greater */ #undef HAVE_READLINE_4_2_OR_GREATER zssh-1.5c.debian.1.orig/COPYING0000600000175000017500000004307707356432613014541 0ustar bartbart GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. zssh-1.5c.debian.1.orig/tilde_expansion.c0000600000175000017500000000257007357763457017046 0ustar bartbart/* ** tilde_expansion.c ** ** Made by (Matthieu Lucotte) ** Login ** ** Started on Sun Oct 7 01:04:37 2001 Matthieu Lucotte ** Last update Sun Oct 7 01:25:03 2001 Matthieu Lucotte */ #include "zssh.h" char *pc_get_tilde_expansion(pattern) char *pattern; { char *str; struct passwd *pass; if (!*pattern) { if ((str = getenv("HOME"))) return (str); else return (getpwuid(getuid())->pw_dir); } pass = getpwnam(pattern); if (!pass) return (0); return (pass->pw_dir); } int pc_tilde_expansion(str) char **str; { int i; int j; char *pattern; char *tmp; for (i = 0; (*str)[i]; ) if ((j = pc_escape_multi(*str, &i, ESC_COMMON)) < 0) return (-1); else if (!j) { if ((*str)[i] == '~') { for (j = 1; isalnum((*str)[i + j]); ) j++; pattern = str_n_dup(*str + i++ + 1,j - 1); if ((tmp = pc_get_tilde_expansion(pattern))) { str_sub_repl(str, --i, j, tmp); i += strlen(tmp); } free(pattern); } else i++; } return (0); }