Remove lsh

This commit is contained in:
Brendan Shanks 2018-07-31 23:39:31 -07:00
parent e535c4d4f2
commit e17c667b36
658 changed files with 0 additions and 145302 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
lsh/FAQ

Binary file not shown.

View File

@ -1,3 +0,0 @@
libs
*Data
apps

Binary file not shown.

View File

@ -1,320 +0,0 @@
/* prefix.h */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to enable sanity checking on memory allocation and casting */
#undef DEBUG_ALLOC
/* Define to enable tracing */
#undef DEBUG_TRACE
/* Define if zlib should be used */
#undef WITH_ZLIB
/* Define to enable pty support */
#undef WITH_PTY_SUPPORT
/* Define to enable fallback to SSH1 */
#undef WITH_SSH1_FALLBACK
/* Location of the SSH1 daemon */
#undef SSHD1
/* Define if IDEA should be used */
#undef WITH_IDEA
/* Define if SRP should be supported */
#undef WITH_SRP
/* Define to enable tcp forwarding */
#undef WITH_TCP_FORWARD
/* For Ipv6 support */
#undef WITH_IPV6
/* Define if AI_NUMERICHOST exists */
#undef HAVE_AI_NUMERICHOST
/* For utmp support */
#undef WITH_UTMP
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if the compiler understands __FUNCTION__ */
#undef HAVE_GCC_FUNCTION
/* Define if the compiler understands offsetof(TYPE, MEMBER) */
#define HAVE_C_OFFSETOF 1
/* Define if a we have working UNIX98 pty handling */
#undef HAVE_UNIX98_PTYS
/* For BSD-style pty allocation */
#undef PTY_BSD_SCHEME_FIRST_CHARS
#undef PTY_BSD_SCHEME_SECOND_CHARS
#undef PTY_BSD_SCHEME
/* syslog() available? */
#undef HAVE_SYSLOG
/* struct utmp has a ut_host member */
#undef HAVE_UT_HOST
/* struct utmp has a ut_name member */
#undef HAVE_UT_NAME
/* struct utmp has a ut_user member */
#undef HAVE_UT_USER
/* struct utmp has a ut_addr member */
#undef HAVE_UT_ADDR
/* struct utmp has a ut_addr_v6 member */
#undef HAVE_UT_ADDR_V6
/* Length type used by getsockopt() */
/* #undef socklen_t */
/* Define to support non-standard packets of ssh2 */
#undef DATAFELLOWS_WORKAROUNDS
/* Global variables needed by argp */
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
/* Define to enable x11 forwarding */
#undef WITH_X11_FORWARD
/* Define to enable authentication agent forwarding */
#undef WITH_AGENT_FORWARD
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Define if you have the argp_parse function. */
#undef HAVE_ARGP_PARSE
/* Define if you have the cfmakeraw function. */
#undef HAVE_CFMAKERAW
/* Define if you have the flockfile function. */
#undef HAVE_FLOCKFILE
/* Define if you have the fputs_unlocked function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the fwrite_unlocked function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define if you have the gai_strerror function. */
#undef HAVE_GAI_STRERROR
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the getopt_long function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the getspnam function. */
#undef HAVE_GETSPNAM
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the login function. */
#undef HAVE_LOGIN
/* Define if you have the logout function. */
#undef HAVE_LOGOUT
/* Define if you have the logwtmp function. */
#undef HAVE_LOGWTMP
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the memxor function. */
#undef HAVE_MEMXOR
/* Define if you have the openpty function. */
#undef HAVE_OPENPTY
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
#define strsignal(x) (sys_signame[x])
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the syslog function. */
#undef HAVE_SYSLOG
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <argp.h> header file. */
#undef HAVE_ARGP_H
/* Define if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gmp.h> header file. */
#define HAVE_GMP_H 1
/* Define if you have the <gmp2/gmp.h> header file. */
#undef HAVE_GMP2_GMP_H
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the xnet library (-lxnet). */
#undef HAVE_LIBXNET
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
/* Name of package */
#define PACKAGE "lsh"
/* Version number of package */
#define VERSION "1.0"
/* MacOS Library */
#define MACOS 1
#define LSH 1

View File

@ -1,320 +0,0 @@
/* prefix.h */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to enable sanity checking on memory allocation and casting */
#undef DEBUG_ALLOC
/* Define to enable tracing */
#undef DEBUG_TRACE
/* Define if zlib should be used */
#undef WITH_ZLIB
/* Define to enable pty support */
#undef WITH_PTY_SUPPORT
/* Define to enable fallback to SSH1 */
#undef WITH_SSH1_FALLBACK
/* Location of the SSH1 daemon */
#undef SSHD1
/* Define if IDEA should be used */
#undef WITH_IDEA
/* Define if SRP should be supported */
#undef WITH_SRP
/* Define to enable tcp forwarding */
#undef WITH_TCP_FORWARD
/* For Ipv6 support */
#undef WITH_IPV6
/* Define if AI_NUMERICHOST exists */
#undef HAVE_AI_NUMERICHOST
/* For utmp support */
#undef WITH_UTMP
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if the compiler understands __FUNCTION__ */
#undef HAVE_GCC_FUNCTION
/* Define if the compiler understands offsetof(TYPE, MEMBER) */
#define HAVE_C_OFFSETOF 1
/* Define if a we have working UNIX98 pty handling */
#undef HAVE_UNIX98_PTYS
/* For BSD-style pty allocation */
#undef PTY_BSD_SCHEME_FIRST_CHARS
#undef PTY_BSD_SCHEME_SECOND_CHARS
#undef PTY_BSD_SCHEME
/* syslog() available? */
#undef HAVE_SYSLOG
/* struct utmp has a ut_host member */
#undef HAVE_UT_HOST
/* struct utmp has a ut_name member */
#undef HAVE_UT_NAME
/* struct utmp has a ut_user member */
#undef HAVE_UT_USER
/* struct utmp has a ut_addr member */
#undef HAVE_UT_ADDR
/* struct utmp has a ut_addr_v6 member */
#undef HAVE_UT_ADDR_V6
/* Length type used by getsockopt() */
/* #undef socklen_t */
/* Define to support non-standard packets of ssh2 */
#undef DATAFELLOWS_WORKAROUNDS
/* Global variables needed by argp */
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
/* Define to enable x11 forwarding */
#undef WITH_X11_FORWARD
/* Define to enable authentication agent forwarding */
#undef WITH_AGENT_FORWARD
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Define if you have the argp_parse function. */
#undef HAVE_ARGP_PARSE
/* Define if you have the cfmakeraw function. */
#undef HAVE_CFMAKERAW
/* Define if you have the flockfile function. */
#undef HAVE_FLOCKFILE
/* Define if you have the fputs_unlocked function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the fwrite_unlocked function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define if you have the gai_strerror function. */
#undef HAVE_GAI_STRERROR
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the getopt_long function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the getspnam function. */
#undef HAVE_GETSPNAM
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the login function. */
#undef HAVE_LOGIN
/* Define if you have the logout function. */
#undef HAVE_LOGOUT
/* Define if you have the logwtmp function. */
#undef HAVE_LOGWTMP
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the memxor function. */
#undef HAVE_MEMXOR
/* Define if you have the openpty function. */
#undef HAVE_OPENPTY
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
#define strsignal(x) (sys_signame[x])
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the syslog function. */
#undef HAVE_SYSLOG
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <argp.h> header file. */
#undef HAVE_ARGP_H
/* Define if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gmp.h> header file. */
#define HAVE_GMP_H 1
/* Define if you have the <gmp2/gmp.h> header file. */
#undef HAVE_GMP2_GMP_H
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the xnet library (-lxnet). */
#undef HAVE_LIBXNET
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
/* Name of package */
#define PACKAGE "lsh"
/* Version number of package */
#define VERSION "1.0"
/* MacOS Library */
#define MACOS 1
#define LSH 1

View File

@ -1,320 +0,0 @@
/* prefix.h */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to enable sanity checking on memory allocation and casting */
#undef DEBUG_ALLOC
/* Define to enable tracing */
#undef DEBUG_TRACE
/* Define if zlib should be used */
#undef WITH_ZLIB
/* Define to enable pty support */
#undef WITH_PTY_SUPPORT
/* Define to enable fallback to SSH1 */
#undef WITH_SSH1_FALLBACK
/* Location of the SSH1 daemon */
#undef SSHD1
/* Define if IDEA should be used */
#undef WITH_IDEA
/* Define if SRP should be supported */
#undef WITH_SRP
/* Define to enable tcp forwarding */
#undef WITH_TCP_FORWARD
/* For Ipv6 support */
#undef WITH_IPV6
/* Define if AI_NUMERICHOST exists */
#undef HAVE_AI_NUMERICHOST
/* For utmp support */
#undef WITH_UTMP
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if the compiler understands __FUNCTION__ */
#undef HAVE_GCC_FUNCTION
/* Define if the compiler understands offsetof(TYPE, MEMBER) */
#define HAVE_C_OFFSETOF 1
/* Define if a we have working UNIX98 pty handling */
#undef HAVE_UNIX98_PTYS
/* For BSD-style pty allocation */
#undef PTY_BSD_SCHEME_FIRST_CHARS
#undef PTY_BSD_SCHEME_SECOND_CHARS
#undef PTY_BSD_SCHEME
/* syslog() available? */
#undef HAVE_SYSLOG
/* struct utmp has a ut_host member */
#undef HAVE_UT_HOST
/* struct utmp has a ut_name member */
#undef HAVE_UT_NAME
/* struct utmp has a ut_user member */
#undef HAVE_UT_USER
/* struct utmp has a ut_addr member */
#undef HAVE_UT_ADDR
/* struct utmp has a ut_addr_v6 member */
#undef HAVE_UT_ADDR_V6
/* Length type used by getsockopt() */
/* #undef socklen_t */
/* Define to support non-standard packets of ssh2 */
#undef DATAFELLOWS_WORKAROUNDS
/* Global variables needed by argp */
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
/* Define to enable x11 forwarding */
#undef WITH_X11_FORWARD
/* Define to enable authentication agent forwarding */
#undef WITH_AGENT_FORWARD
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Define if you have the argp_parse function. */
#undef HAVE_ARGP_PARSE
/* Define if you have the cfmakeraw function. */
#undef HAVE_CFMAKERAW
/* Define if you have the flockfile function. */
#undef HAVE_FLOCKFILE
/* Define if you have the fputs_unlocked function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the fwrite_unlocked function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define if you have the gai_strerror function. */
#undef HAVE_GAI_STRERROR
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the getopt_long function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the getspnam function. */
#undef HAVE_GETSPNAM
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the login function. */
#undef HAVE_LOGIN
/* Define if you have the logout function. */
#undef HAVE_LOGOUT
/* Define if you have the logwtmp function. */
#undef HAVE_LOGWTMP
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the memxor function. */
#undef HAVE_MEMXOR
/* Define if you have the openpty function. */
#undef HAVE_OPENPTY
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
#define strsignal(x) (sys_signame[x])
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the syslog function. */
#undef HAVE_SYSLOG
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <argp.h> header file. */
#undef HAVE_ARGP_H
/* Define if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gmp.h> header file. */
#define HAVE_GMP_H 1
/* Define if you have the <gmp2/gmp.h> header file. */
#undef HAVE_GMP2_GMP_H
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the xnet library (-lxnet). */
#undef HAVE_LIBXNET
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
/* Name of package */
#define PACKAGE "lsh"
/* Version number of package */
#define VERSION "1.0"
/* MacOS Library */
#define MACOS 1
#define LSH 1

View File

@ -1,156 +0,0 @@
/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
* POSIX Standard: 9.2.1 Group Database Access <grp.h>
*/
#ifndef _GRP_H
#define _GRP_H 1
/*#include <features.h>*/
__BEGIN_DECLS
#ifndef _BITS_TYPES_H
/*#include <bits/types.h>*/
#ifndef __uid_t__gid_t
#define __uid_t__gid_t
typedef unsigned long __uid_t;
typedef unsigned long __gid_t;
#endif
#endif
#define __need_size_t
#include <stddef.h>
/* For the Single Unix specification we must define this type here. */
#if defined __USE_XOPEN && !defined gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
#endif
/* The group structure. */
struct group
{
char *gr_name; /* Group name. */
char *gr_passwd; /* Password. */
__gid_t gr_gid; /* Group ID. */
char **gr_mem; /* Member list. */
};
#if defined __USE_SVID || defined __USE_GNU
# define __need_FILE
# include <stdio.h>
#endif
#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Rewind the group-file stream. */
extern void setgrent __P ((void));
/* Close the group-file stream. */
extern void endgrent __P ((void));
/* Read an entry from the group-file stream, opening it if necessary. */
extern struct group *getgrent __P ((void));
#endif
#ifdef __USE_SVID
/* Read a group entry from STREAM. */
extern struct group *fgetgrent __P ((FILE *__stream));
#endif
#ifdef __USE_GNU
/* Write the given entry onto the given stream. */
extern int putgrent __P ((__const struct group *__restrict __p,
FILE *__restrict __f));
#endif
/* Search for an entry with a matching group ID. */
extern struct group *getgrgid __P ((__gid_t __gid));
/* Search for an entry with a matching group name. */
extern struct group *getgrnam __P ((__const char *__name));
#if defined __USE_POSIX || defined __USE_MISC
# ifdef __USE_MISC
/* Reasonable value for the buffer sized used in the reentrant
functions below. But better use `sysconf'. */
# define NSS_BUFLEN_GROUP 1024
# endif
/* Reentrant versions of some of the functions above.
PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
The interface may change in later versions of this library. But
the interface is designed following the principals used for the
other reentrant functions so the chances are good this is what the
POSIX people would choose. */
# if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern int getgrent_r __P ((struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result));
# endif
/* Search for an entry with a matching group ID. */
extern int getgrgid_r __P ((__gid_t __gid,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result));
/* Search for an entry with a matching group name. */
extern int getgrnam_r __P ((__const char *__restrict __name,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result));
# ifdef __USE_SVID
/* Read a group entry from STREAM. This function is not standardized
an probably never will. */
extern int fgetgrent_r __P ((FILE *__restrict __stream,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result));
# endif
#endif /* POSIX or reentrant */
#ifdef __USE_BSD
# define __need_size_t
# include <stddef.h>
/* Set the group set for the current user to GROUPS (N of them). */
extern int setgroups __P ((size_t __n, __const __gid_t *__groups));
/* Initialize the group set for the current user
by reading the group database and using all groups
of which USER is a member. Also include GROUP. */
extern int initgroups __P ((__const char *__user, __gid_t __group));
#endif /* Use BSD. */
__END_DECLS
#endif /* grp.h */

View File

@ -1,41 +0,0 @@
/* System specific type definitions for networking code.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _NETINET_IN_SYSTM_H
#define _NETINET_IN_SYSTM_H 1
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
/*
* Network order versions of various data types. Unfortunately, BSD
* assumes specific sizes for shorts (16 bit) and longs (32 bit) which
* don't hold in general. As a consequence, the network order versions
* may not reflect the actual size of the native data types.
*/
typedef uint16_t n_short; /* short as received from the net */
typedef uint32_t n_long; /* long as received from the net */
typedef uint32_t n_time; /* ms since 00:00 GMT, byte rev */
__END_DECLS
#endif /* netinet/in_systm.h */

View File

@ -1,30 +0,0 @@
/* System specific type definitions for networking code.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _NETINET_IP_H
#define _NETINET_IP_H 1
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
__END_DECLS
#endif /* netinet/ip.h */

View File

@ -1,158 +0,0 @@
/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
* POSIX Standard: 9.2.2 User Database Access <pwd.h>
*/
#ifndef _PWD_H
#define _PWD_H 1
/*#include <features.h>*/
#ifndef __const
#define __const const
#endif
__BEGIN_DECLS
#ifndef _BITS_TYPES_H
/*#include <bits/types.h>*/
#ifndef __uid_t__gid_t
#define __uid_t__gid_t
typedef unsigned long __uid_t;
typedef unsigned long __gid_t;
#endif
#endif
#define __need_size_t
#include <stddef.h>
#ifdef __USE_XOPEN
/* The Single Unix specification says that some more types are
available here. */
# ifndef gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
# endif
# ifndef uid_t
typedef __uid_t uid_t;
# define uid_t uid_t
# endif
#endif
/* The passwd structure. */
struct passwd
{
char *pw_name; /* Username. */
char *pw_passwd; /* Password. */
__uid_t pw_uid; /* User ID. */
__gid_t pw_gid; /* Group ID. */
char *pw_gecos; /* Real name. */
char *pw_dir; /* Home directory. */
char *pw_shell; /* Shell program. */
};
#if defined __USE_SVID || defined __USE_GNU
# define __need_FILE
# include <stdio.h>
#endif
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
/* Rewind the password-file stream. */
extern void setpwent __P ((void));
/* Close the password-file stream. */
extern void endpwent __P ((void));
/* Read an entry from the password-file stream, opening it if necessary. */
extern struct passwd *getpwent __P ((void));
#endif
#ifdef __USE_SVID
/* Read an entry from STREAM. */
extern struct passwd *fgetpwent __P ((FILE *__stream));
/* Write the given entry onto the given stream. */
extern int putpwent __P ((__const struct passwd *__restrict __p,
FILE *__restrict __f));
#endif
/* Search for an entry with a matching user ID. */
extern struct passwd *getpwuid __P ((__uid_t __uid));
/* Search for an entry with a matching username. */
extern struct passwd *getpwnam __P ((__const char *__name));
#if defined __USE_POSIX || defined __USE_MISC
# ifdef __USE_MISC
/* Reasonable value for the buffer sized used in the reentrant
functions below. But better use `sysconf'. */
# define NSS_BUFLEN_PASSWD 1024
# endif
/* Reentrant versions of some of the functions above.
PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
The interface may change in later versions of this library. But
the interface is designed following the principals used for the
other reentrant functions so the chances are good this is what the
POSIX people would choose. */
# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN_EXTENDED
extern int getpwent_r __P ((struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result));
# endif
extern int getpwuid_r __P ((__uid_t __uid,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result));
extern int getpwnam_r __P ((__const char *__restrict __name,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result));
# ifdef __USE_SVID
/* Read an entry from STREAM. This function is not standardized and
probably never will. */
extern int fgetpwent_r __P ((FILE *__restrict __stream,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result));
# endif
#endif /* POSIX or reentrant */
#ifdef __USE_GNU
/* Re-construct the password-file line for the given uid
in the given buffer. This knows the format that the caller
will expect, but this need not be the format of the password file. */
extern int getpw __P ((__uid_t __uid, char *__buffer));
#endif
__END_DECLS
#endif /* pwd.h */

View File

@ -1,69 +0,0 @@
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H 1
/*
#include <limits.h>
#include <linux/limits.h>
#include <linux/param.h>
*/
/* BSD names for some <limits.h> values. */
/*
#define NBBY CHAR_BIT
#ifndef NGROUPS
# define NGROUPS NGROUPS_MAX
#endif
#define MAXSYMLINKS 5
#define CANBSIZ MAX_CANON
#define NCARGS ARG_MAX
*/
#define MAXPATHLEN 255
/*
#define NOFILE OPEN_MAX
*/
#include <sys/types.h>
/* Bit map related macros. */
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
/* Macros for counting and rounding. */
#ifndef howmany
# define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
#define powerof2(x) ((((x)-1)&(x))==0)
/* Macros for min/max. */
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
/* Unit of `st_blocks'. */
#define DEV_BSIZE 512
#endif /* sys/param.h */

View File

@ -1,202 +0,0 @@
/*
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)syslog.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _SYS_SYSLOG_H
#define _SYS_SYSLOG_H 1
#include <sys/cdefs.h>
/*
#include <features.h>
#define __need___va_list
#include <stdarg.h>
*/
#ifndef __const
#define __const const
#endif
#define _PATH_LOG "/dev/log"
/*
* priorities/facilities are encoded into a single 32-bit quantity, where the
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
* (0-big number). Both the priorities and the facilities map roughly
* one-to-one to strings in the syslogd(8) source code. This mapping is
* included in this file.
*
* priorities (these are ordered)
*/
#define LOG_EMERG 0 /* system is unusable */
#define LOG_ALERT 1 /* action must be taken immediately */
#define LOG_CRIT 2 /* critical conditions */
#define LOG_ERR 3 /* error conditions */
#define LOG_WARNING 4 /* warning conditions */
#define LOG_NOTICE 5 /* normal but significant condition */
#define LOG_INFO 6 /* informational */
#define LOG_DEBUG 7 /* debug-level messages */
#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
/* extract priority */
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
#ifdef SYSLOG_NAMES
#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
/* mark "facility" */
#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
typedef struct _code {
char *c_name;
int c_val;
} CODE;
CODE prioritynames[] =
{
{ "alert", LOG_ALERT },
{ "crit", LOG_CRIT },
{ "debug", LOG_DEBUG },
{ "emerg", LOG_EMERG },
{ "err", LOG_ERR },
{ "error", LOG_ERR }, /* DEPRECATED */
{ "info", LOG_INFO },
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
{ "notice", LOG_NOTICE },
{ "panic", LOG_EMERG }, /* DEPRECATED */
{ "warn", LOG_WARNING }, /* DEPRECATED */
{ "warning", LOG_WARNING },
{ NULL, -1 }
};
#endif
/* facility codes */
#define LOG_KERN (0<<3) /* kernel messages */
#define LOG_USER (1<<3) /* random user-level messages */
#define LOG_MAIL (2<<3) /* mail system */
#define LOG_DAEMON (3<<3) /* system daemons */
#define LOG_AUTH (4<<3) /* security/authorization messages */
#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
#define LOG_LPR (6<<3) /* line printer subsystem */
#define LOG_NEWS (7<<3) /* network news subsystem */
#define LOG_UUCP (8<<3) /* UUCP subsystem */
#define LOG_CRON (9<<3) /* clock daemon */
#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
#define LOG_FTP (11<<3) /* ftp daemon */
/* other codes through 15 reserved for system use */
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
#define LOG_LOCAL2 (18<<3) /* reserved for local use */
#define LOG_LOCAL3 (19<<3) /* reserved for local use */
#define LOG_LOCAL4 (20<<3) /* reserved for local use */
#define LOG_LOCAL5 (21<<3) /* reserved for local use */
#define LOG_LOCAL6 (22<<3) /* reserved for local use */
#define LOG_LOCAL7 (23<<3) /* reserved for local use */
#define LOG_NFACILITIES 24 /* current number of facilities */
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
/* facility of pri */
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
#ifdef SYSLOG_NAMES
CODE facilitynames[] =
{
{ "auth", LOG_AUTH },
{ "authpriv", LOG_AUTHPRIV },
{ "cron", LOG_CRON },
{ "daemon", LOG_DAEMON },
{ "ftp", LOG_FTP },
{ "kern", LOG_KERN },
{ "lpr", LOG_LPR },
{ "mail", LOG_MAIL },
{ "mark", INTERNAL_MARK }, /* INTERNAL */
{ "news", LOG_NEWS },
{ "security", LOG_AUTH }, /* DEPRECATED */
{ "syslog", LOG_SYSLOG },
{ "user", LOG_USER },
{ "uucp", LOG_UUCP },
{ "local0", LOG_LOCAL0 },
{ "local1", LOG_LOCAL1 },
{ "local2", LOG_LOCAL2 },
{ "local3", LOG_LOCAL3 },
{ "local4", LOG_LOCAL4 },
{ "local5", LOG_LOCAL5 },
{ "local6", LOG_LOCAL6 },
{ "local7", LOG_LOCAL7 },
{ NULL, -1 }
};
#endif
/*
* arguments to setlogmask.
*/
#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
/*
* Option flags for openlog.
*
* LOG_ODELAY no longer does anything.
* LOG_NDELAY is the inverse of what it used to be.
*/
#define LOG_PID 0x01 /* log the pid with each message */
#define LOG_CONS 0x02 /* log on the console if errors in sending */
#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
#define LOG_NDELAY 0x08 /* don't delay open */
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR 0x20 /* log to stderr as well */
__BEGIN_DECLS
/* Close desriptor used to write to system logger. */
extern void closelog __P ((void));
/* Open connection to system logger. */
extern void openlog __P ((__const char *__ident, int _option,
int __facility));
/* Set the log mask level. */
extern int setlogmask __P ((int __mask));
/* Generate a log message using FMT string and option arguments. */
extern void syslog __P ((int __pri, __const char *__fmt, ...));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP. */
extern void vsyslog __P ((int __pri, __const char *__fmt,
__gnuc_va_list __ap));
#endif
__END_DECLS
#endif /* sys/syslog.h */

View File

@ -1,7 +0,0 @@
#ifndef __SYSEXITS__
#define __SYSEXITS__
#define EX_USAGE 64 /* command line usage error */
#endif

View File

@ -1,4 +0,0 @@
#ifndef _SYSLOG_H
#define _SYSLOG_H
#include <sys/syslog.h>
#endif

View File

@ -1,320 +0,0 @@
#ifndef __TERMIOS__
#define __TERMIOS__
#ifndef __const
#define __const const
#endif
typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
/* Return the output baud rate stored in *TERMIOS_P. */
extern speed_t cfgetospeed __P ((__const struct termios *__termios_p));
/* Return the input baud rate stored in *TERMIOS_P. */
extern speed_t cfgetispeed __P ((__const struct termios *__termios_p));
/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
extern int cfsetospeed __P ((struct termios *__termios_p, speed_t __speed));
/* Set the input baud rate stored in *TERMIOS_P to SPEED. */
extern int cfsetispeed __P ((struct termios *__termios_p, speed_t __speed));
/* Put the state of FD into *TERMIOS_P. */
extern int tcgetattr __P ((int __fd, struct termios *__termios_p));
/* Set the state of FD to *TERMIOS_P.
Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */
extern int tcsetattr __P ((int __fd, int __optional_actions,
__const struct termios *__termios_p));
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#endif
/*
* termios type and macro definitions. Be careful about adding stuff
* to this file since it's used in GNU libc and there are strict rules
* concerning namespace pollution.
*/
#define NCCS 32
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline (== c_cc[19]) */
cc_t c_cc[NCCS]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
};
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#endif
/* c_cc characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VMIN 5
#define VEOL 6
#define VTIME 7
#define VEOL2 8
#define VSWTC 9
#define VWERASE 10
#define VREPRINT 11
#define VSUSP 12
#define VSTART 13
#define VSTOP 14
#define VLNEXT 15
#define VDISCARD 16
/* c_iflag bits */
#define IGNBRK 0000001
#define BRKINT 0000002
#define IGNPAR 0000004
#define PARMRK 0000010
#define INPCK 0000020
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#define IXON 0001000
#define IXOFF 0002000
/* POSIX.1 doesn't want these... */
#ifdef __USE_BSD
# define IXANY 0004000
# define IUCLC 0010000
# define IMAXBEL 0020000
#endif
/* c_oflag bits */
#define OPOST 0000001
#define ONLCR 0000002
#define OLCUC 0000004
#define OCRNL 0000010
#define ONOCR 0000020
#define ONLRET 0000040
#define OFILL 00000100
#define OFDEL 00000200
#define NLDLY 00001400
#define NL0 00000000
#define NL1 00000400
#define NL2 00001000
#define NL3 00001400
#define TABDLY 00006000
#define TAB0 00000000
#define TAB1 00002000
#define TAB2 00004000
#define TAB3 00006000
#define CRDLY 00030000
#define CR0 00000000
#define CR1 00010000
#define CR2 00020000
#define CR3 00030000
#define FFDLY 00040000
#define FF0 00000000
#define FF1 00040000
#define BSDLY 00100000
#define BS0 00000000
#define BS1 00100000
#define VTDLY 00200000
#define VT0 00000000
#define VT1 00200000
#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
/* c_cflag bit meaning */
#define CBAUD 0000377
#define B0 0000000 /* hang up */
#define B50 0000001
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017
#define EXTA B19200
#define EXTB B38400
#define CBAUDEX 0000020
#define B57600 00020
#define B115200 00021
#define B230400 00022
#define B460800 00023
#define B500000 00024
#define B576000 00025
#define B921600 00026
#define B1000000 00027
#define B1152000 00030
#define B1500000 00031
#define B2000000 00032
#define B2500000 00033
#define B3000000 00034
#define B3500000 00035
#define B4000000 00036
#define CSIZE 00001400
#define CS5 00000000
#define CS6 00000400
#define CS7 00001000
#define CS8 00001400
#define CSTOPB 00002000
#define CREAD 00004000
#define PARENB 00010000
#define PARODD 00020000
#define HUPCL 00040000
#define CLOCAL 00100000
#define CRTSCTS 020000000000 /* flow control */
/* c_lflag bits */
#define ISIG 0x00000080
#define ICANON 0x00000100
#define XCASE 0x00004000
#define ECHO 0x00000008
#define ECHOE 0x00000002
#define ECHOK 0x00000004
#define ECHONL 0x00000010
#define NOFLSH 0x80000000
#define TOSTOP 0x00400000
#define ECHOCTL 0x00000040
#define ECHOPRT 0x00000020
#define ECHOKE 0x00000001
#define FLUSHO 0x00800000
#define PENDIN 0x20000000
#define IEXTEN 0x00000400
/* Values for the ACTION argument to `tcflow'. */
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
#define TCIFLUSH 0
#define TCOFLUSH 1
#define TCIOFLUSH 2
/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2
struct sgttyb {
char sg_ispeed;
char sg_ospeed;
char sg_erase;
char sg_kill;
short sg_flags;
};
struct tchars {
char t_intrc;
char t_quitc;
char t_startc;
char t_stopc;
char t_eofc;
char t_brkc;
};
struct ltchars {
char t_suspc;
char t_dsuspc;
char t_rprntc;
char t_flushc;
char t_werasc;
char t_lnextc;
};
/* Used for packet mode */
/* already defined in ttycom.h
#define TIOCPKT_DATA 0
#define TIOCPKT_FLUSHREAD 1
#define TIOCPKT_FLUSHWRITE 2
#define TIOCPKT_STOP 4
#define TIOCPKT_START 8
#define TIOCPKT_NOSTOP 16
#define TIOCPKT_DOSTOP 32
*/
/* already defined in ttycom.h
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
*/
#define NCC 10
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
/* c_cc characters */
#define _VINTR 0
#define _VQUIT 1
#define _VERASE 2
#define _VKILL 3
#define _VEOF 4
#define _VMIN 5
#define _VEOL 6
#define _VTIME 7
#define _VEOL2 8
#define _VSWTC 9
/* modem lines */
/* already defined in ttycom.h
#define TIOCM_LE 0x001
#define TIOCM_DTR 0x002
#define TIOCM_RTS 0x004
#define TIOCM_ST 0x008
#define TIOCM_SR 0x010
#define TIOCM_CTS 0x020
#define TIOCM_CAR 0x040
#define TIOCM_RNG 0x080
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
*/
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
/* line disciplines */
#define N_TTY 0
#define N_SLIP 1
#define N_MOUSE 2
#define N_PPP 3
#define N_STRIP 4
#define N_AX25 5
#define N_X25 6 /* X.25 async */
#define N_6PACK 7
#define N_MASC 8 /* Mobitex module */
#define N_R3964 9 /* Simatic R3964 module */
#define N_PROFIBUS_FDL 10 /* Profibus */
#define N_IRDA 11 /* Linux IR */
#define N_SMSBLOCK 12 /* SMS block mode */
#define N_HDLC 13 /* synchronous HDLC */
#define N_SYNC_PPP 14 /* synchronous PPP */
#endif /* __TERMIOS__ */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +0,0 @@
lsh_new
lsh_delete
lsh_yield
lsh_read
lsh_canread
lsh_write
lsh_canwrite
lsh_getprefsd
lsh_current
lsh_running
lsh_init
lsh_terminate

Binary file not shown.

Binary file not shown.

View File

@ -1,16 +0,0 @@
lsh_new
lsh_delete
lsh_yield
lsh_read
lsh_canread
lsh_write
lsh_canwrite
lsh_getprefsd
lsh_current
lsh_running
lsh_init
lsh_terminate
GusiLSHSetWriteConsole
GusiLSHSetErrConsole
GusiLSHSetInConsole
GusiLSHSetHandleEvent

View File

@ -1,320 +0,0 @@
/* prefix.h */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to enable sanity checking on memory allocation and casting */
#undef DEBUG_ALLOC
/* Define to enable tracing */
#undef DEBUG_TRACE
/* Define if zlib should be used */
#undef WITH_ZLIB
/* Define to enable pty support */
#undef WITH_PTY_SUPPORT
/* Define to enable fallback to SSH1 */
#undef WITH_SSH1_FALLBACK
/* Location of the SSH1 daemon */
#undef SSHD1
/* Define if IDEA should be used */
#undef WITH_IDEA
/* Define if SRP should be supported */
#undef WITH_SRP
/* Define to enable tcp forwarding */
#undef WITH_TCP_FORWARD
/* For Ipv6 support */
#undef WITH_IPV6
/* Define if AI_NUMERICHOST exists */
#undef HAVE_AI_NUMERICHOST
/* For utmp support */
#undef WITH_UTMP
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if the compiler understands __FUNCTION__ */
#undef HAVE_GCC_FUNCTION
/* Define if the compiler understands offsetof(TYPE, MEMBER) */
#define HAVE_C_OFFSETOF 1
/* Define if a we have working UNIX98 pty handling */
#undef HAVE_UNIX98_PTYS
/* For BSD-style pty allocation */
#undef PTY_BSD_SCHEME_FIRST_CHARS
#undef PTY_BSD_SCHEME_SECOND_CHARS
#undef PTY_BSD_SCHEME
/* syslog() available? */
#undef HAVE_SYSLOG
/* struct utmp has a ut_host member */
#undef HAVE_UT_HOST
/* struct utmp has a ut_name member */
#undef HAVE_UT_NAME
/* struct utmp has a ut_user member */
#undef HAVE_UT_USER
/* struct utmp has a ut_addr member */
#undef HAVE_UT_ADDR
/* struct utmp has a ut_addr_v6 member */
#undef HAVE_UT_ADDR_V6
/* Length type used by getsockopt() */
/* #undef socklen_t */
/* Define to support non-standard packets of ssh2 */
#undef DATAFELLOWS_WORKAROUNDS
/* Global variables needed by argp */
#undef HAVE_PROGRAM_INVOCATION_NAME
#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME
/* Define to enable x11 forwarding */
#undef WITH_X11_FORWARD
/* Define to enable authentication agent forwarding */
#undef WITH_AGENT_FORWARD
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Define if you have the argp_parse function. */
#undef HAVE_ARGP_PARSE
/* Define if you have the cfmakeraw function. */
#undef HAVE_CFMAKERAW
/* Define if you have the flockfile function. */
#undef HAVE_FLOCKFILE
/* Define if you have the fputs_unlocked function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define if you have the fwrite_unlocked function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define if you have the gai_strerror function. */
#undef HAVE_GAI_STRERROR
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the getopt_long function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the getspnam function. */
#undef HAVE_GETSPNAM
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the login function. */
#undef HAVE_LOGIN
/* Define if you have the logout function. */
#undef HAVE_LOGOUT
/* Define if you have the logwtmp function. */
#undef HAVE_LOGWTMP
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the memxor function. */
#undef HAVE_MEMXOR
/* Define if you have the openpty function. */
#undef HAVE_OPENPTY
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putc_unlocked function. */
#undef HAVE_PUTC_UNLOCKED
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
#define strsignal(x) (sys_signame[x])
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the syslog function. */
#undef HAVE_SYSLOG
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <argp.h> header file. */
#undef HAVE_ARGP_H
/* Define if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gmp.h> header file. */
#define HAVE_GMP_H 1
/* Define if you have the <gmp2/gmp.h> header file. */
#undef HAVE_GMP2_GMP_H
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the crypt library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the xnet library (-lxnet). */
#undef HAVE_LIBXNET
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
/* Name of package */
#define PACKAGE "lsh"
/* Version number of package */
#define VERSION "1.0"
/* MacOS Library */
#define MACOS 1
#define LSH 1

View File

@ -1,83 +0,0 @@
/**************** BEGIN GUSI CONFIGURATION ****************************
*
* GUSI Configuration section generated by GUSI Configurator
* last modified: Sat Jul 15 19:32:39 2000
*
* This section will be overwritten by the next run of Configurator.
*/
#define GUSI_SOURCE
#include <GUSIConfig.h>
#include <sys/cdefs.h>
/* Declarations of Socket Factories */
__BEGIN_DECLS
void GUSIwithInetSockets();
void GUSIwithLocalSockets();
void GUSIwithMTInetSockets();
void GUSIwithMTTcpSockets();
void GUSIwithMTUdpSockets();
void GUSIwithOTInetSockets();
void GUSIwithOTTcpSockets();
void GUSIwithOTUdpSockets();
void GUSIwithPPCSockets();
void GUSISetupFactories();
__END_DECLS
/* Configure Socket Factories */
void GUSISetupFactories()
{
#ifdef GUSISetupFactories_BeginHook
GUSISetupFactories_BeginHook
#endif
GUSIwithOTInetSockets();
#ifdef GUSISetupFactories_EndHook
GUSISetupFactories_EndHook
#endif
}
/* Declarations of File Devices */
__BEGIN_DECLS
void GUSIwithDConSockets();
void GUSIwithNullSockets();
void GUSIwithTTYSockets();
void GUSISetupDevices();
__END_DECLS
/* Configure File Devices */
void GUSISetupDevices()
{
#ifdef GUSISetupDevices_BeginHook
GUSISetupDevices_BeginHook
#endif
GUSIwithNullSockets();
GUSIwithTTYSockets();
#ifdef GUSISetupDevices_EndHook
GUSISetupDevices_EndHook
#endif
}
#ifndef __cplusplus
#error GUSISetupConfig() needs to be written in C++
#endif
GUSIConfiguration::FileSuffix sSuffices[] = {
"", '????', '????'
};
extern "C" void GUSISetupConfig()
{
GUSIConfiguration * config =
GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource);
config->ConfigureDefaultTypeCreator('TEXT', 'CWIE');
config->ConfigureSuffices(
sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices);
config->ConfigureSharedOpen(true);
}
/**************** END GUSI CONFIGURATION *************************/

View File

@ -1,307 +0,0 @@
/*
* GUSIPatches.cp
*/
#include "lshprefix.h"
#include "lsh_context.h"
#include <GUSIInternal.h>
#include <GUSIBasics.h>
#include <GUSIContext.h>
#include <GUSIConfig.h>
#include <GUSIDiag.h>
#include <GUSISocket.h>
#include <GUSIPThread.h>
#include <GUSIFactory.h>
#include <GUSIDevice.h>
#include <GUSIDescriptor.h>
#include <GUSIOTNetDB.h>
#include <pthread.h>
#include <sched.h>
#include <sys/stat.h>
#include <unistd.h>
#ifndef __CONSOLE__
#include <console.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
void ssh2_init();
void ssh2_terminate();
int open(const char * path, int mode, ...);
int dup(int s);
int socket(int domain, int type, int protocol);
int close(int s);
void add_one_file(struct lshcontext *context, int fd);
void remove_one_file(struct lshcontext *context, int fd);
#ifdef __cplusplus
}
#endif
/*
* default GUSIProcess::Yield has 20 ticks to remain in same state
* we use 0.
*/
/* GUSI 2.1.3
void GUSIProcess::Yield(GUSIYieldMode wait)
{
ProcessSerialNumber front;
Boolean same;
if (wait == kGUSIBlock) {
fWillSleep = true;
if (fReadyThreads > 1 || fDontSleep)
wait = kGUSIYield;
}
if (wait == kGUSIYield && LMGetTicks() - fResumeTicks < 0) {
return;
}
if (fClosing)
fClosing->CheckClose();
if (gGUSISpinHook) {
gGUSISpinHook(wait == kGUSIBlock);
} else {
GUSI_SMESSAGE("Suspend\n");
GUSIHandleNextEvent(wait == kGUSIBlock ? 600 : 0);
GUSI_SMESSAGE("Resume\n");
}
fWillSleep = false;
fDontSleep = false;
fResumeTicks = LMGetTicks();
}
*/
/* GUSI 2.1.5 */
void GUSIProcess::Yield(GUSIYieldMode wait)
{
if (wait == kGUSIBlock) {
fWillSleep = true;
if (fReadyThreads > 1 || fDontSleep) {
GUSI_SMESSAGE("Don't Sleep\n");
wait = kGUSIYield;
}
}
if (fExistingThreads < 2) // Single threaded process skips sleep only once
fDontSleep = false;
if (wait == kGUSIYield && LMGetTicks() - fResumeTicks < 1) {
fWillSleep = false;
return;
}
if (gGUSISpinHook) {
gGUSISpinHook(wait == kGUSIBlock);
} else {
GUSI_SMESSAGE("Suspend\n");
GUSIHandleNextEvent(wait == kGUSIBlock ? 60 : 0);
GUSI_SMESSAGE("Resume\n");
}
if (fExistingThreads < 2) // Single threaded process skips sleep only once
fDontSleep = false;
fWillSleep = false;
fResumeTicks = LMGetTicks();
if (fClosing)
fClosing->CheckClose();
}
/*
* default GUSIContext::Yield has 12 ticks to remain in same state
* we use 0.
*/
bool GUSIContext::Yield(GUSIYieldMode wait)
{
if (wait == kGUSIYield && LMGetTicks() - sCurrentContext->fEntryTicks < 0)
return false;
bool mainThread = sCurrentContext->fThreadID == kApplicationThreadID;
bool block = wait == kGUSIBlock && !mainThread;
GUSIProcess * process = GUSIProcess::Instance();
bool interrupt = false;
do {
if (mainThread)
process->Yield(wait);
if (interrupt = Raise())
goto done;
if (sHasThreading) {
if (block)
SetThreadState(kCurrentThreadID, kStoppedThreadState, kNoThreadID);
else
YieldToAnyThread();
}
} while (wait == kGUSIBlock && !sCurrentContext->fWakeup);
done:
sCurrentContext->fWakeup = false;
return interrupt;
}
/*
* we need to track open()/dup()/close()/socket() calls to close files/sockets
* upon abort/exit
*/
/*
* open.
*/
int open(const char * path, int mode, ...)
{
GUSIErrorSaver saveError;
GUSIDeviceRegistry * factory = GUSIDeviceRegistry::Instance();
GUSIDescriptorTable * table = GUSIDescriptorTable::Instance();
GUSISocket * sock;
int fd;
if (sock = factory->open(path, mode)) {
if ((fd = table->InstallSocket(sock)) > -1) {
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context ) {
add_one_file(context, fd);
}
return fd;
}
sock->close();
}
if (!errno)
return GUSISetPosixError(ENOMEM);
else
return -1;
}
/*
* dup.
*/
int dup(int s)
{
GUSIDescriptorTable *table = GUSIDescriptorTable::Instance();
GUSISocket *sock = GUSIDescriptorTable::LookupSocket(s);
int fd;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if (!sock)
return -1;
fd = table->InstallSocket(sock);
if ( context ) {
add_one_file(context, fd);
}
return fd;
}
/*
* dup2.
*/
int dup2(int s, int s1)
{
GUSIDescriptorTable *table = GUSIDescriptorTable::Instance();
GUSISocket *sock = GUSIDescriptorTable::LookupSocket(s);
int fd;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if (!sock)
return -1;
table->RemoveSocket(s1);
fd = table->InstallSocket(sock, s1);
if ( context && s1 != fd ) {
remove_one_file(context, s1);
add_one_file(context, fd);
}
return fd;
}
/*
* socket.
*/
int socket(int domain, int type, int protocol)
{
GUSIErrorSaver saveError;
GUSISocketFactory * factory = GUSISocketDomainRegistry::Instance();
GUSIDescriptorTable * table = GUSIDescriptorTable::Instance();
GUSISocket * sock;
int fd;
if (sock = factory->socket(domain, type, protocol)) {
if ((fd = table->InstallSocket(sock)) > -1) {
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context ) {
add_one_file(context, fd);
}
return fd;
}
sock->close();
}
if (!errno)
return GUSISetPosixError(ENOMEM);
else
return -1;
}
/*
* close.
*/
int close(int s)
{
if ( s > STDERR_FILENO ) {
GUSIDescriptorTable * table = GUSIDescriptorTable::Instance();
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context ) {
remove_one_file(context, s);
}
return table->RemoveSocket(s);
} else {
/* we don't close stdin/stdout/stderr */
return 0;
}
}
#pragma mark -
static Boolean sGUSISetup = false;
/*
* ssh2_init
*/
extern "C" short SIOUXHandleOneEvent(EventRecord *userevent);
void ssh2_init()
{
if ( !sGUSISetup ) {
GUSIContext::Setup(true);
GUSISetupConsole();
GUSISetHook(GUSI_EventHook+keyDown, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+keyUp, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+autoKey, (GUSIHook)SIOUXHandleOneEvent);
sGUSISetup = true;
}
}
/*
* ssh2_terminate
*/
void ssh2_terminate()
{
if ( sGUSISetup ) {
sGUSISetup = false;
}
}

View File

@ -1,247 +0,0 @@
// <GUSISIOUX.cp>=
#include "GUSIInternal.h"
#include "GUSISIOUX.h"
#include "GUSIDevice.h"
#include "GUSIDescriptor.h"
#include "GUSIBasics.h"
#include "GUSIDiag.h"
#include <LowMem.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <console.h>
// \section{Definition of [[GUSISIOUXSocket]]}
//
// A [[GUSISIOUXSocket]] is another singleton class: There is only one SIOUX
// console per application.
//
//
// <Declaration of class [[GUSISIOUXSocket]]>=
class GUSISIOUXSocket : public GUSISocket {
public:
~GUSISIOUXSocket();
// Some member functions are fairly trivial wrappers.
//
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
ssize_t read(const GUSIScatterer & buffer);
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
ssize_t write(const GUSIGatherer & buffer);
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
virtual int ioctl(unsigned int request, va_list arg);
// Since we know we're running on a pseudodevice, we can pass on that fact.
//
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
virtual int fstat(struct stat * buf);
// And we also know we're a TTY.
//
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
virtual int isatty();
// [[select]] requires a walk of the event queue.
//
// <Overridden member functions for class [[GUSISIOUXSocket]]>=
virtual bool pre_select(bool wantRead, bool wantWrite, bool wantExcept);
virtual bool select(bool * canRead, bool * canWrite, bool * exception);
virtual void post_select(bool wantRead, bool wantWrite, bool wantExcept);
static GUSISIOUXSocket * Instance();
private:
static GUSISIOUXSocket * sInstance;
GUSISIOUXSocket();
};
extern "C" void GUSIWakeupSIOUXSocket()
{
GUSISIOUXSocket::Instance()->Wakeup();
}
// \section{Definition of [[GUSISIOUXDevice]]}
//
// A [[GUSISIOUXDevice]] is a singleton class supporting the standard [[open]]
// operation.
//
// <Declaration of class [[GUSISIOUXDevice]]>=
class GUSISIOUXDevice : public GUSIDevice {
public:
static GUSISIOUXDevice * Instance();
// [[GUSISIOUXDevice]] is prepared to handle an [[open]] on a limited set of names.
//
// <Overridden member functions for class [[GUSISIOUXDevice]]>=
virtual bool Want(GUSIFileToken & file);
// [[open]] returns the sole instance of [[GUSISIOUXSocket]].
//
// <Overridden member functions for class [[GUSISIOUXDevice]]>=
virtual GUSISocket * open(GUSIFileToken &, int flags);
private:
GUSISIOUXDevice() {}
static GUSISIOUXDevice * sInstance;
};
// \section{Implementation of [[GUSISIOUXSocket]]}
//
// A [[GUSISIOUXSocket]] is a dataless wrapper for the SIOUX
// library. To protect the sole instance from ever being deleted
// again, we artificially raise its reference count.
//
// <Member functions for class [[GUSISIOUXSocket]]>=
GUSISIOUXSocket * GUSISIOUXSocket::sInstance;
GUSISIOUXSocket * GUSISIOUXSocket::Instance()
{
if (!sInstance)
if (sInstance = new GUSISIOUXSocket)
sInstance->AddReference();
return sInstance;
}
// On construction, we make sure to install the SIOUX event handler for all
// relevant elements.
//
// <Member functions for class [[GUSISIOUXSocket]]>=
// This declaration lies about the return type
extern "C" void SIOUXHandleOneEvent(EventRecord *userevent);
GUSISIOUXSocket::GUSISIOUXSocket()
{
InstallConsole(0);
GUSISetHook(GUSI_EventHook+nullEvent, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+mouseDown, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+mouseUp, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+updateEvt, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+diskEvt, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+activateEvt, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+osEvt, (GUSIHook)SIOUXHandleOneEvent);
}
GUSISIOUXSocket::~GUSISIOUXSocket()
{
RemoveConsole();
}
// <Member functions for class [[GUSISIOUXSocket]]>=
ssize_t GUSISIOUXSocket::read(const GUSIScatterer & buffer)
{
GUSIStdioFlush();
return buffer.SetLength(
ReadCharsFromConsole((char *) buffer.Buffer(), (int)buffer.Length()));
}
// <Member functions for class [[GUSISIOUXSocket]]>=
ssize_t GUSISIOUXSocket::write(const GUSIGatherer & buffer)
{
return WriteCharsToConsole((char *) buffer.Buffer(), (int)buffer.Length());
}
// <Member functions for class [[GUSISIOUXSocket]]>=
int GUSISIOUXSocket::ioctl(unsigned int request, va_list)
{
switch (request) {
case FIOINTERACTIVE:
return 0;
default:
return GUSISetPosixError(EOPNOTSUPP);
}
}
// <Member functions for class [[GUSISIOUXSocket]]>=
int GUSISIOUXSocket::fstat(struct stat * buf)
{
GUSISocket::fstat(buf);
buf->st_mode = S_IFCHR | 0666;
return 0;
}
// <Member functions for class [[GUSISIOUXSocket]]>=
int GUSISIOUXSocket::isatty()
{
return 1;
}
// <Member functions for class [[GUSISIOUXSocket]]>=
static bool input_pending()
{
QHdrPtr eventQueue = LMGetEventQueue();
EvQElPtr element = (EvQElPtr)eventQueue->qHead;
// now, count the number of pending keyDown events.
while (element != nil) {
if (element->evtQWhat == keyDown || element->evtQWhat == autoKey)
return true;
element = (EvQElPtr)element->qLink;
}
return false;
}
// [[pre_select]] and [[post_select]] often don't have to do anything. By default,
// we assume that a socket can sleep.
bool GUSISIOUXSocket::pre_select(bool wantRead, bool wantWrite, bool wantExcept)
{
return GUSISocket::pre_select(wantRead, wantWrite, wantExcept);
}
void GUSISIOUXSocket::post_select(bool wantRead, bool wantWrite, bool wantExcept)
{
GUSISocket::post_select(wantRead, wantWrite, wantExcept);
}
extern Boolean gSIOUXTerminalMode;
extern short gSIOUXBufSize;
bool GUSISIOUXSocket::select(bool * canRead, bool * canWrite, bool *)
{
bool cond = false;
if (canRead)
if (*canRead = /*input_pending()*/
((gSIOUXTerminalMode && gSIOUXBufSize != 0) || input_pending()) )
cond = true;
if (canWrite)
cond = *canWrite = true;
return cond;
}
// \section{Implementation of [[GUSISIOUXDevice]]}
//
// [[GUSISIOUXDevice]] is a singleton class.
//
// <Member functions for class [[GUSISIOUXDevice]]>=
GUSISIOUXDevice * GUSISIOUXDevice::sInstance;
// <Member functions for class [[GUSISIOUXDevice]]>=
GUSISIOUXDevice * GUSISIOUXDevice::Instance()
{
if (!sInstance)
sInstance = new GUSISIOUXDevice();
return sInstance;
}
// <Member functions for class [[GUSISIOUXDevice]]>=
bool GUSISIOUXDevice::Want(GUSIFileToken & file)
{
switch (file.WhichRequest()) {
case GUSIFileToken::kWillOpen:
return file.IsDevice() && (file.StrStdStream(file.Path()) > -1);
default:
return false;
}
}
// <Member functions for class [[GUSISIOUXDevice]]>=
GUSISocket * GUSISIOUXDevice::open(GUSIFileToken &, int)
{
return GUSISIOUXSocket::Instance();
}
// A SIOUX application connects to the three standard descriptors on startup.
//
// <SIOUX implementation of [[GUSISetupConsoleDescriptors]]>=
void GUSISetupConsoleDescriptors()
{
GUSIDescriptorTable * table = GUSIDescriptorTable::Instance();
GUSISIOUXSocket * SIOUX = GUSISIOUXSocket::Instance();
table->InstallSocket(SIOUX);
table->InstallSocket(SIOUX);
table->InstallSocket(SIOUX);
}

View File

@ -1,282 +0,0 @@
/*
* GUSITTY.cp
* (c) 2000 Jean-Pierre Stierlin.
*
* 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
*/
#include "GUSIInternal.h"
#include "GUSITTY.h"
#include "GUSIDevice.h"
#include "GUSIDescriptor.h"
#include "GUSIBasics.h"
#include "GUSIDiag.h"
#include <LowMem.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
class GUSITTYDevice : public GUSIDevice {
public:
static GUSITTYDevice * Instance();
// [[GUSITTYDevice]] is prepared to handle an [[open]] on a limited set of names.
//
// <Overridden member functions for class [[GUSITTYDevice]]>=
virtual bool Want(GUSIFileToken & file);
// [[open]] returns instance of [[GUSITTYSocket]].
//
// <Overridden member functions for class [[GUSITTYDevice]]>=
virtual GUSISocket * open(GUSIFileToken &, int flags);
private:
GUSITTYDevice() {}
static GUSITTYDevice * sInstance;
};
class GUSITTYSocket : public GUSISocket {
public:
~GUSITTYSocket();
// Some member functions are fairly trivial wrappers.
//
// <Overridden member functions for class [[GUSITTYSocket]]>=
ssize_t read(const GUSIScatterer & buffer);
// <Overridden member functions for class [[GUSITTYSocket]]>=
ssize_t write(const GUSIGatherer & buffer);
// <Overridden member functions for class [[GUSITTYSocket]]>=
virtual int ioctl(unsigned int request, va_list arg);
// Since we know we're running on a pseudodevice, we can pass on that fact.
//
// <Overridden member functions for class [[GUSITTYSocket]]>=
virtual int fstat(struct stat * buf);
// And we also know we're a TTY.
//
// <Overridden member functions for class [[GUSITTYSocket]]>=
virtual int isatty();
// [[select]] requires a walk of the event queue.
//
// <Overridden member functions for class [[GUSITTYSocket]]>=
virtual bool pre_select(bool wantRead, bool wantWrite, bool wantExcept);
virtual bool select(bool * canRead, bool * canWrite, bool * exception);
virtual void post_select(bool wantRead, bool wantWrite, bool wantExcept);
protected:
GUSITTYSocket(int id, void *context);
int mId;
void *mContext;
friend class GUSITTYDevice;
};
/*
* GUSIwithTTYSockets
*/
extern "C" void GUSIwithTTYSockets()
{
GUSIDeviceRegistry::Instance()->AddDevice(GUSITTYDevice::Instance());
}
/*
* GUSIwithoutTTYSockets
*/
extern "C" void GUSIwithoutTTYSockets()
{
GUSIDeviceRegistry::Instance()->RemoveDevice(GUSITTYDevice::Instance());
}
/*
* GUSIWakeupTTYSocket
*/
extern "C" void GUSIWakeupTTYSocket( void *insock )
{
GUSISocket *sock = (GUSISocket *)insock;
sock->Wakeup();
}
/*
* GUSITTYDevice::Instance
*/
GUSITTYDevice * GUSITTYDevice::sInstance;
GUSITTYDevice * GUSITTYDevice::Instance()
{
if (!sInstance)
sInstance = new GUSITTYDevice();
return sInstance;
}
/*
* GUSITTYDevice::Want
*/
bool GUSITTYDevice::Want(GUSIFileToken &file)
{
const char *path = file.Path();
switch (file.WhichRequest()) {
case GUSIFileToken::kWillOpen:
return file.IsDevice() && file.StrFragEqual(path+4, "tty")
&& (!path[7]
|| (file.StrFragEqual(path+7, "in") && !path[9])
|| (file.StrFragEqual(path+7, "out") && !path[10])
|| (file.StrFragEqual(path+7, "err") && !path[10]));
default:
return false;
}
}
/*
* GUSITTYDevice::open
*/
GUSISocket * GUSITTYDevice::open(GUSIFileToken &file, int flags)
{
GUSISocket *sock;
const char *path = file.Path();
int id;
if (!path[7]) {
id = 3;
} else if (!path[9]) {
id = 0;
} else if (file.StrFragEqual(path+7, "out")) {
id = 1;
} else /*if (file.StrFragEqual(path+7, "err"))*/ {
id = 2;
}
if ( !(sock = new GUSITTYSocket(id, pthread_getspecific(ssh2threadkey)) )) {
GUSISetPosixError(ENOMEM);
}
return sock;
}
/*
* GUSITTYSocket::GUSITTYSocket
*/
GUSITTYSocket::GUSITTYSocket(int id, void *context) : mId(id), mContext(context)
{
InstallTTY(id, context, this);
}
/*
* GUSITTYSocket::~GUSITTYSocket
*/
GUSITTYSocket::~GUSITTYSocket()
{
RemoveTTY(mId, mContext, this);
}
/*
* GUSITTYSocket::read
*/
ssize_t GUSITTYSocket::read(const GUSIScatterer & buffer)
{
/* FIXME: flush pending output */
/*FlushTTY(mId);*/
return buffer.SetLength(
ReadCharsFromTTY(mId, mContext, (char *) buffer.Buffer(), (int)buffer.Length()));
}
/*
* GUSITTYSocket::write
*/
ssize_t GUSITTYSocket::write(const GUSIGatherer & buffer)
{
return WriteCharsToTTY(mId, mContext, (char *) buffer.Buffer(), (int)buffer.Length());
}
/*
* GUSITTYSocket::ioctl
*/
int GUSITTYSocket::ioctl(unsigned int request, va_list)
{
switch (request) {
case FIOINTERACTIVE:
return 0;
default:
return GUSISetPosixError(EOPNOTSUPP);
}
}
/*
* GUSITTYSocket::fstat
*/
int GUSITTYSocket::fstat(struct stat * buf)
{
GUSISocket::fstat(buf);
buf->st_mode = S_IFCHR | 0666;
return 0;
}
/*
* GUSITTYSocket::isatty
*/
int GUSITTYSocket::isatty()
{
return 1;
}
extern "C" int get_context_listener();
/*
* GUSITTYSocket::pre_select
*/
bool GUSITTYSocket::pre_select(bool wantRead, bool wantWrite, bool wantExcept)
{
/* we can't sleep when in pseudo-port forwarding mode */
/* because the select functions polls for the connection */
if (get_context_listener() == -1) {
return GUSISocket::pre_select(wantRead, wantWrite, wantExcept);
}
return false;
}
/*
* GUSITTYSocket::post_select
*/
void GUSITTYSocket::post_select(bool wantRead, bool wantWrite, bool wantExcept)
{
if (get_context_listener() == -1) {
GUSISocket::post_select(wantRead, wantWrite, wantExcept);
}
}
/*
* GUSITTYSocket::select
*/
bool GUSITTYSocket::select(bool * canRead, bool * canWrite, bool *)
{
bool cond = false;
if (canRead)
if (*canRead = AvailableFromTTY(mId, mContext))
cond = true;
if (canWrite)
cond = *canWrite = true;
return cond;
}

View File

@ -1,24 +0,0 @@
#ifndef _GUSITTY_
#define _GUSITTY_
#include <pthread.h>
#ifdef __cplusplus
extern "C" {
#endif
extern pthread_key_t ssh2threadkey;
extern void GUSIWakeupTTYSocket( void *sock );
extern int InstallTTY(int id, void *context, void *sock);
extern void RemoveTTY(int id, void *context, void *sock);
extern int ReadCharsFromTTY(int id, void *context, char * buffer, int length);
extern int WriteCharsToTTY(int id, void *context, char * buffer, int length);
extern int AvailableFromTTY(int id, void *context);
#ifdef __cplusplus
}
#endif
#endif /* _GUSITTY_ */

View File

@ -1,266 +0,0 @@
/*
File: PasswordDialog.c
Contains: This file contains all the interesting password stuff
Written by: Tim Dierks
Copyright: Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
You may incorporate this Apple sample source code into your program(s) without
restriction. This Apple sample source code has been provided "AS IS" and the
responsibility for its operation is yours. You are not permitted to redistribute
this Apple sample source code as "Apple sample source code" after having made
changes. If you're going to re-distribute the source, we require that you make
it clear in the source that the code was descended from Apple sample source
code, but that you've made changes.
Change History (most recent first):
8/9/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
*/
#include <Types.h>
#include <Memory.h>
#include <Resources.h>
#include <OSUtils.h>
#include <Quickdraw.h>
#include <Fonts.h>
#include <Events.h>
#include <Windows.h>
#include <Menus.h>
#include <Dialogs.h>
#include <TextEdit.h>
#include <Drag.h>
#include <Scrap.h>
#include "PasswordDialog.h"
/*
#include "movableModal.h"
#include "DlogUtils.proto.h"
*/
static pascal Boolean InternalBufferFilter(DialogPtr dlog,EventRecord *event,short *itemHit);
static void DeleteRange(char *buffer,short start,short end);
static void InsertChar(char *buffer,short pos,char c);
#define kMaxPasswordLen 128
Boolean YesNoDialog(StringPtr prompt)
{
Boolean result = false;
DialogPtr dlog;
short item;
/*ModalFilterUPP yesNoFilterUPP;*/
/*yesNoFilterUPP = NewModalFilterProc(YesNoFilter);*/
dlog = GetNewDialog(rYesNoDialog, 0L, (WindowPtr)-1L);
if ( dlog ) {
ParamText(prompt, "\p", "\p", "\p");
ShowWindow(dlog);
SetDialogDefaultItem(dlog, 1);
SetDialogCancelItem(dlog, 2);
do {
ModalDialog(NULL, &item);
} while (item != 1 && item != 2); // Until the OK/Cancel button is hit
result = (item == 2);
DisposeDialog(dlog);
}
/*DisposeRoutineDescriptor(yesNoFilterUPP);*/
return result;
}
/*
Boolean SSH2PasswordDialog(StringPtr prompt, StringPtr password)
{
DialogPtr dlog;
short item;
ModalFilterUPP internalBufferFilterUPP;
SetUpMovableModalMenus();
internalBufferFilterUPP = NewModalFilterProc(InternalBufferFilter);
*password = '\0';
//dlog = GetNewDialog(rSSH2PasswordDialog, 0L, (WindowPtr)-1L);
dlog = GetNewMyDialog(rSSH2PasswordDialog, 0L, (WindowPtr)-1L, (void *)ThirdCenterDialog);
if ( dlog ) {
SInt16 itemType;
Handle itemHandle;
Rect itemRect;
GetDialogItem(dlog, 5, &itemType, &itemHandle, &itemRect);
SetDialogItemText(itemHandle, prompt);
//ParamText(prompt, "\p", "\p", "\p");
ShowWindow(dlog);
SetWRefCon(dlog, (long)password); // Stash the buffer's address
SetDialogDefaultItem(dlog, 1);
SetDialogCancelItem(dlog, 2);
do {
//ModalDialog(internalBufferFilterUPP, &item);
movableModalDialog(internalBufferFilterUPP, &item);
} while (item != 1 && item != 2); // Until the OK button is hit
DisposeDialog(dlog);
}
DisposeRoutineDescriptor(internalBufferFilterUPP);
ResetMenus();
}
*/
void InternalBufferDialog(StringPtr prompt, StringPtr password)
{
DialogPtr dlog;
short item;
ModalFilterUPP internalBufferFilterUPP;
internalBufferFilterUPP = NewModalFilterProc(InternalBufferFilter);
*password = '\0'; // Zero out the buffered password
dlog = GetNewDialog(rInternalBufferDialog, 0L, (WindowPtr)-1L);
if ( dlog ) {
ParamText(prompt, "\p", "\p", "\p");
ShowWindow(dlog);
SetWRefCon(dlog, (long)password); // Stash the buffer's address
SetDialogDefaultItem(dlog, 1);
do {
ModalDialog(internalBufferFilterUPP, &item);
} while (item != 1); // Until the OK button is hit
DisposeDialog(dlog);
}
DisposeRoutineDescriptor(internalBufferFilterUPP);
}
static pascal Boolean
InternalBufferFilter(DialogPtr dlog,EventRecord *event,short *itemHit)
{ char key;
short start,end;
char *buffer;
if (event->what != keyDown && event->what != autoKey)
return false; // We don't want to deal with them
key = event->message & charCodeMask;
switch (key) {
case '\r': // Return
case '\003': // Enter
*itemHit = 1; // OK Button
return true; // We handled the event
case '.': // Cmd-.
if (!(event->modifiers & cmdKey))
break;
case '\033': // Esc
*itemHit = 2; // Cancel Button
return true; // We handled the event
case '\t': // Tab
case '\034': // Left arrow
case '\035': // Right arrow
case '\036': // Up arrow
case '\037': // Down arrow
return false; // Let ModalDialog handle them
default: // Everything else falls through to be dealt with
break; // below
}
start = (**((DialogPeek)dlog)->textH).selStart; // Get the current selection
end = (**((DialogPeek)dlog)->textH).selEnd;
buffer = (char*)GetWRefCon(dlog); // Get the buffer's address
if (start != end) { // If there's a selection, delete it
DeleteRange(buffer,start,end);
}
if (key == '\010') { // Backspace
if (start != 0) {
DeleteRange(buffer,start-1,start); // Delete the character to the left
}
} else {
if ((event->modifiers & cmdKey)) {
if (key == 'v' || key == 'V') {
// get scrap
Handle hText;
OSErr err;
if ((err = GetScrapHandle('TEXT', &hText)) == noErr) {
int len = GetHandleSize(hText);
if (len + *buffer <= kMaxPasswordLen) {
int i;
for (i = 0; i < len; i++) {
InsertChar(buffer,start++,(*hText)[i]); // Insert the real key into the buffer
TEKey('¥', ((DialogPeek)dlog)->textH);
}
}
// add scrap to textedit view
DisposeHandle(hText);
event->what = nullEvent;
}
}
} else {
InsertChar(buffer,start,key); // Insert the real key into the buffer
event->message = '¥'; // Character to use in field
}
}
return false; // Let ModalDialog insert the fake char
}
static void
DeleteRange(char *buffer,short start,short end)
{ register char *src,*dest,*last;
last = buffer + *buffer;
src = buffer + end + 1;
dest = buffer + start + 1;
while (src <= last) // Shift character to the left over the removed characters
*(dest++) = *(src++);
(*buffer) -= (end-start); // Adjust the buffer's length
}
static void
InsertChar(char *buffer,short pos,char c)
{ register short index,len;
len = *buffer;
if (len == 0xFF) // if the string is full, return
return;
for (index = len;index > pos;index--) // Shift characters to the right to make room
buffer[index+1] = buffer[index];
buffer[pos+1] = c; // Fill in the new character
(*buffer)++; // Add one to the length of the string
}
OSErr
GetScrapHandle( FlavorType dataFlavor, Handle *dataHandle )
{
SInt32 scrapOffset;
SInt32 scrapResult;
OSErr err;
*dataHandle = NewHandle(0);
// allocate a temporary handle
if ( ( err = MemError() ) != noErr )
{
goto cleanup;
}
// look for an item with the specified flavor on the desk scrap
if ( ( scrapResult = GetScrap( *dataHandle, dataFlavor, &scrapOffset ) ) < 0 )
{
// a negative result from GetScrap is an error code
err = scrapResult;
DisposeHandle( *dataHandle );
goto cleanup;
}
// clear result code
err = noErr;
cleanup:
// return result code
return err;
}

View File

@ -1,40 +0,0 @@
/*
File: Password.h
Contains: This file contains all the interesting password stuff
Written by: Tim Dierks
Copyright: Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
You may incorporate this Apple sample source code into your program(s) without
restriction. This Apple sample source code has been provided "AS IS" and the
responsibility for its operation is yours. You are not permitted to redistribute
this Apple sample source code as "Apple sample source code" after having made
changes. If you're going to re-distribute the source, we require that you make
it clear in the source that the code was descended from Apple sample source
code, but that you've made changes.
Change History (most recent first):
8/9/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
*/
#include <Dialogs.h>
#define rInternalBufferDialog 256
#define rYesNoDialog 257
#ifdef __cplusplus
extern "C" {
#endif
void InternalBufferDialog (StringPtr inprompt, StringPtr outpassword);
Boolean YesNoDialog (StringPtr inprompt);
OSErr GetScrapHandle( FlavorType dataFlavor, Handle *dataHandle );
#ifdef __cplusplus
}
#endif

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,740 +0,0 @@
/* Metrowerks Standard Library */
/* $Date$
* $Revision$ + Carbon Changes
* $NoKeywords: $
*
* Copyright © 1995-1999 Metrowerks, Inc.
* All rights reserved.
*/
/*****************************************************************************/
/* Project...: C++ and ANSI-C Compiler Environment */
/* Name......: SIOUXMenus.c */
/* Purpose...: Menu related functions for SIOUX */
/*****************************************************************************/
#include <SIOUX.h>
#include "SIOUXGlobals.h"
#include "SIOUXMenus.h"
#include "SIOUXPrinter.h"
#include "SIOUXWindows.h"
#include "PasswordDialog.h" /* just for GetScrapHandle() */
#if SIOUX_USE_WASTE
#include <limits.h>
#endif
/*#include <unix.h>*/
extern long _fcreator, _ftype;
#include <Devices.h>
#include <LowMem.h>
#include <Scrap.h> /*bkoz*/
#include <StandardFile.h>
#include <ToolUtils.h>
#if TARGET_API_MAC_CARBON
#include <AEDataModel.h> /* ra 990612 */
#include <Gestalt.h>
#include <MacErrors.h>
#include <Navigation.h> /* ra 990612 */
#endif /* TARGET_API_MAC_CARBON */
#pragma bool on
#ifndef TRUE /* ra 990611 Carbon */
#define TRUE true
#endif
/* Menuhandles ...*/
static MenuHandle appleMenu;
static MenuHandle fileMenu;
static MenuHandle editMenu;
extern Boolean gSIOUXTerminalMode;
extern char gSIOUXChars[];
extern short gSIOUXBufSize;
extern const short gSIOUXMaxSize;
extern void GUSIWakeupSIOUXSocket();
#if ! SIOUX_USE_WASTE
/************************************************************************/
/* Purpose..: Replacement for mac TE glue */
/* Input....: --- */
/* Return...: --- */
/************************************************************************/
static OSErr MyTEFromScrap(void)
{
long length; /* cc 991111 */
#if TARGET_API_MAC_CARBON /* cc 991111 */
ScrapRef theScrapRef;
#else
long scrapOffset; /* cc 991111 */
#endif
#if TARGET_API_MAC_CARBON
GetCurrentScrap(&theScrapRef);
GetScrapFlavorSize(theScrapRef, 'TEXT', &length);
#else
if ((length = GetScrap(0L,'TEXT',&scrapOffset))<0)
return (length);
#endif /* cc 991111 */
if (length>32000)
return (teScrapSizeErr);
#if TARGET_API_MAC_CARBON /* cc 991111 */
HUnlock(TEScrapHandle());
SetHandleSize(TEScrapHandle(), length);
HLock(TEScrapHandle());
GetScrapFlavorData(theScrapRef, 'TEXT', &length, *TEScrapHandle());
#else /* cc 991111 */
HLock(TEScrapHandle());
if ((length = GetScrap(TEScrapHandle(),'TEXT',&scrapOffset))<0) {
HUnlock(TEScrapHandle());
return (length);
}
#endif
HUnlock(TEScrapHandle()); /* cc 991111 */
TESetScrapLength(length);
return (noErr);
}
static OSErr MyTEToScrap(void)
{
long error;
#if TARGET_API_MAC_CARBON /*cc 991111 */
ScrapRef theScrapRef;
#endif
HLock(TEScrapHandle());
#if TARGET_API_MAC_CARBON
error = ClearCurrentScrap();
error = GetCurrentScrap(&theScrapRef);
error = PutScrapFlavor(theScrapRef, 'TEXT', kScrapFlavorMaskNone, TEGetScrapLength(),
*TEScrapHandle());
#else
ZeroScrap();
error = PutScrap(LMGetTEScrpLength(), 'TEXT', *TEScrapHandle());
#endif /* TARGET_API_MAC_CARBON */ /*cc 991111 */
HUnlock(TEScrapHandle());
return error;
}
#endif /* ! SIOUX_USE_WASTE */
/****************************************************************/
/* Purpose..: Setup SIOUX's menus */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXSetupMenus(void)
{
#if TARGET_API_MAC_CARBON
long result;
#endif /* TARGET_API_MAC_CARBON */
unsigned char appleString[2] = "\001\024";
/* Create the Apple menu ...*/
appleMenu = NewMenu(APPLEID, appleString);
#if SIOUX_USE_WASTE
AppendMenu( appleMenu, "\pAbout SIOUX-WASTE;(-");
#else
AppendMenu(appleMenu, "\pAbout SIOUX;(-");
#endif /* SIOUX_USE_WASTE */
AppendResMenu(appleMenu, 'DRVR');
InsertMenu(appleMenu, 0);
/* Create the File menu ...*/
fileMenu = NewMenu(FILEID, "\pFile");
#if TARGET_API_MAC_CARBON
Gestalt(gestaltMenuMgrAttr, &result);
if ((result & gestaltMenuMgrAquaLayoutMask) == gestaltMenuMgrAquaLayoutMask)
/* JWW - On OS X, the Quit item is automaticaly in the application menu, not in File */
AppendMenu(fileMenu, "\p(New...;(Open...;(Close...;Save/S;(-;Page Setup;Print.../P");
else
/* JWW - Be careful if you modify this area -- the else clause is after the #endif */
#endif /* TARGET_API_MAC_CARBON */
AppendMenu(fileMenu, "\p(New...;(Open...;(Close...;Save/S;(-;Page Setup;Print.../P;(-;Quit/Q");
InsertMenu(fileMenu, 0);
/* Create the Edit menu ...*/
editMenu = NewMenu(EDITID, "\pEdit");
AppendMenu(editMenu, "\p(Undo/Z;(-;(Cut/X;(Copy/C;Paste/V;(Clear;(-;Select All/A");
InsertMenu(editMenu, 0);
InvalMenuBar(); /* Instead of DrawMenuBar to allow Carbon to fill in the Apple menu */
}
/****************************************************************/
/* Purpose..: Setup SIOUX's menus */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXUpdateMenuItems(void)
{
#if SIOUX_USE_WASTE
SInt32 weSelStart, weSelEnd;
#endif
/* First disable all possible items ...*/
#if TARGET_API_MAC_CARBON
DisableMenuItem(fileMenu, FILESAVE);
DisableMenuItem(fileMenu, FILEPRINT);
DisableMenuItem(editMenu, EDITCUT);
DisableMenuItem(editMenu, EDITCOPY);
DisableMenuItem(editMenu, EDITPASTE);
DisableMenuItem(editMenu, EDITCLEAR);
DisableMenuItem(editMenu, EDITSELECTALL);
#else
DisableItem(fileMenu, FILESAVE);
DisableItem(fileMenu, FILEPRINT);
DisableItem(editMenu, EDITCUT);
DisableItem(editMenu, EDITCOPY);
DisableItem(editMenu, EDITPASTE);
DisableItem(editMenu, EDITCLEAR);
DisableItem(editMenu, EDITSELECTALL);
#endif /* TARGET_API_MAC_CARBON */
if (SIOUXState != PRINTFING && SIOUXIsAppWindow(FrontWindow())) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(fileMenu, FILEPRINT);
#else
EnableItem(fileMenu, FILEPRINT);
#endif /* TARGET_API_MAC_CARBON */
#if SIOUX_USE_WASTE
if ( WECanPaste( SIOUXTextWindow->edit ) ) {
#endif
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITPASTE);
#else
EnableItem(editMenu, EDITPASTE);
#endif
#if SIOUX_USE_WASTE
}
#endif
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITSELECTALL);
#else
EnableItem(editMenu, EDITSELECTALL);
#endif /* TARGET_API_MAC_CARBON */
#if SIOUX_USE_WASTE
WEGetSelection( &weSelStart, &weSelEnd, SIOUXTextWindow->edit );
if ( weSelStart != weSelEnd ) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCUT);
#else
EnableItem(editMenu, EDITCUT);
#endif /* TARGET_API_MAC_CARBON */
}
if ( weSelStart != weSelEnd ) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCOPY);
#else
EnableItem(editMenu, EDITCOPY);
#endif /* TARGET_API_MAC_CARBON */
}
if ( weSelStart != weSelEnd ) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCLEAR);
#else
EnableItem(editMenu, EDITCLEAR);
#endif /* TARGET_API_MAC_CARBON */
}
#else
if ((*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCUT);
#else
EnableItem(editMenu, EDITCUT);
#endif /* TARGET_API_MAC_CARBON */
}
if ((*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCOPY);
#else
EnableItem(editMenu, EDITCOPY);
#endif /* TARGET_API_MAC_CARBON */
}
if ((*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(editMenu, EDITCLEAR);
#else
EnableItem(editMenu, EDITCLEAR);
#endif /* TARGET_API_MAC_CARBON */
}
#endif /* SIOUX_USE_WASTE */
if (SIOUXTextWindow->dirty) {
#if TARGET_API_MAC_CARBON
EnableMenuItem(fileMenu, FILESAVE);
#else
EnableItem(fileMenu, FILESAVE);
#endif /* TARGET_API_MAC_CARBON */
}
}
}
/****************************************************************/
/* Purpose..: Setup SIOUX's menus */
/* Input....: --- */
/* Returns..: noErr text saved correctly / -1 error or cancel */
/****************************************************************/
#if TARGET_API_MAC_CARBON
/* Prototype for routine in SIOUXWindows.c */
void SIOUXUpdateWindow(WindowPtr theWindow);
static pascal void NavEventProc2(NavEventCallbackMessage inSelector, NavCBRecPtr ioParams,
NavCallBackUserData ioUserData) /* cc 991111 */
{
#pragma unused(ioParams, ioUserData)
if (inSelector == kNavCBEvent) {
SIOUXUpdateWindow(SIOUXTextWindow->window);
}
}
#endif /* TARGET_API_MAC_CARBON */
short SIOUXDoSaveText(void)
{
short error;
HParamBlockRec pb;
StandardFileReply sfReply; /* ra 990612 Change to support NavServ. */
#if SIOUX_USE_WASTE
WEReference theTE = SIOUXTextWindow->edit;
long textLength = WEGetTextLength( theTE );
Handle textHandle = WEGetText( theTE );
#else
TEHandle theTE = SIOUXTextWindow->edit;
long textLength = (long)(*theTE)->teLength;
#endif /* SIOUX_USE_WASTE */
Point aPoint = {100, 100};
#if SIOUX_USE_WASTE
HLock( textHandle );
#else
HLock((*theTE)->hText);
#endif /* SIOUX_USE_WASTE */
if (SIOUXTextWindow->dirid) {
/* Open the file ...*/
pb.ioParam.ioCompletion = 0L;
pb.ioParam.ioNamePtr = SIOUXTextWindow->fname;
pb.ioParam.ioVRefNum = SIOUXTextWindow->vrefnum;
pb.ioParam.ioPermssn = fsWrPerm;
pb.fileParam.ioDirID = SIOUXTextWindow->dirid;
if (PBHOpenDFSync(&pb) != noErr)
/* Couldn't open the file so we try resaving it ...*/
goto RenameFile;
/* Write the text ...*/
#if SIOUX_USE_WASTE
pb.ioParam.ioBuffer = *textHandle;
#else
pb.ioParam.ioBuffer = *(*theTE)->hText;
#endif /* SIOUX_USE_WASTE */
pb.ioParam.ioReqCount = textLength;
pb.ioParam.ioPosMode = fsFromStart;
pb.ioParam.ioPosOffset = 0;
if (PBWriteSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
#if SIOUX_USE_WASTE
if (pb.ioParam.ioActCount != (long)WEGetTextLength( theTE ) )
#else
if (pb.ioParam.ioActCount != (long)(*theTE)->teLength)
#endif /* SIOUX_USE_WASTE */
goto SaveError;
pb.ioParam.ioMisc = (Ptr)pb.ioParam.ioActCount;
if (PBSetEOFSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
/* Close file ...*/
if (PBCloseSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
goto Saved;
} else {
Str255 theTitle;
RenameFile:
GetWTitle(SIOUXTextWindow->window, theTitle);
sfReply.sfGood = false;
#if TARGET_API_MAC_CARBON
{
NavDialogOptions NavOptions;
NavReplyRecord NavReply;
AEDesc specDesc;
OSErr err;
NavEventUPP myEventUPP = NewNavEventUPP(NavEventProc2);
err = NavLoad();
if (err != noErr)
goto NotSaved;
NavGetDefaultDialogOptions(&NavOptions);
BlockMoveData(theTitle, NavOptions.savedFileName, sizeof(sfReply.sfFile.name));
err = NavPutFile(NULL, &NavReply, &NavOptions, myEventUPP, 'TEXT', 'CWIE', NULL);
if (err != noErr)
goto NotSaved;
AECoerceDesc(&NavReply.selection, typeFSS, &specDesc);
DisposeNavEventUPP(myEventUPP);
sfReply.sfGood = NavReply.validRecord;
if (sfReply.sfGood) {
NavTranslationOptions Options = kNavTranslateInPlace;
sfReply.sfFile = **(FSSpec**) specDesc.dataHandle;
NavCompleteSave(&NavReply, Options);
}
NavDisposeReply(&NavReply);
NavUnload();
AEDisposeDesc(&specDesc);
if (err == userCanceledErr)
goto NotSaved;
}
#else
StandardPutFile("\pSave document as...", theTitle, &sfReply); /* ra 990612 UI 3.2 */
if (!sfReply.sfGood)
goto NotSaved;
#endif /* TARGET_API_MAC_CARBON */
/* Make the FSSpec ...*/
SIOUXTextWindow->vrefnum = sfReply.sfFile.vRefNum;
#if TARGET_API_MAC_CARBON
SIOUXTextWindow->dirid = sfReply.sfFile.parID;
#else
SIOUXTextWindow->dirid = LMGetCurDirStore(); /* jd- why is this even being done??? */
#endif /* TARGET_API_MAC_CARBON */
BlockMoveData(sfReply.sfFile.name, SIOUXTextWindow->fname, sfReply.sfFile.name[0] + 1);
pb.ioParam.ioCompletion = 0L;
pb.ioParam.ioNamePtr = SIOUXTextWindow->fname;
pb.ioParam.ioVRefNum = SIOUXTextWindow->vrefnum;
pb.fileParam.ioFlVersNum = 0;
pb.fileParam.ioDirID = SIOUXTextWindow->dirid;
error = PBHCreateSync(&pb);
if (error != noErr && error != dupFNErr)
goto SaveError;
/* Set the finder info ...*/
GetDateTime(&pb.fileParam.ioFlCrDat); /* cc 991111 */
GetDateTime(&pb.fileParam.ioFlMdDat); /* cc 991111 */
if ( _ftype != '\0' )
pb.fileParam.ioFlFndrInfo.fdType = _ftype;
else
pb.fileParam.ioFlFndrInfo.fdType = 'TEXT';
if ( _fcreator != '\0' )
pb.fileParam.ioFlFndrInfo.fdCreator = _fcreator;
else
pb.fileParam.ioFlFndrInfo.fdCreator = 'CWIE';
pb.fileParam.ioFlFndrInfo.fdFlags = 0;
if (PBHSetFInfoSync(&pb) != noErr)
goto SaveError;
/* Open the file ...*/
pb.ioParam.ioPermssn = fsWrPerm;
if (PBHOpenDFSync(&pb) != noErr)
goto SaveError;
/* Write the text ...*/
#if SIOUX_USE_WASTE
pb.ioParam.ioBuffer = *textHandle;
#else
pb.ioParam.ioBuffer = *(*theTE)->hText;
#endif /* SIOUX_USE_WASTE */
pb.ioParam.ioReqCount = textLength;
pb.ioParam.ioPosMode = fsFromStart;
pb.ioParam.ioPosOffset = 0;
if (PBWriteSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
#if SIOUX_USE_WASTE
if (pb.ioParam.ioActCount != (long)WEGetTextLength( theTE ) )
#else
if (pb.ioParam.ioActCount != (long)(*theTE)->teLength)
#endif /* SIOUX_USE_WASTE */
goto SaveError;
pb.ioParam.ioMisc = (Ptr)pb.ioParam.ioActCount;
if (PBSetEOFSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
/* Close file ...*/
if (PBCloseSync((ParmBlkPtr)&pb) != noErr)
goto SaveError;
/* Rename the window ...*/
SetWTitle(SIOUXTextWindow->window, SIOUXTextWindow->fname);
goto Saved;
}
SaveError:
#if SIOUX_USE_WASTE
HUnlock( textHandle );
#else
HUnlock((*theTE)->hText);
#endif /* SIOUX_USE_WASTE */
#if TARGET_API_MAC_CARBON
{
Cursor theArrow;
SetCursor(GetQDGlobalsArrow(&theArrow));
}
#else
SetCursor(&qd.arrow);
#endif /* TARGET_API_MAC_CARBON */
SIOUXCantSaveAlert(SIOUXTextWindow->fname);
NotSaved:
return (-1);
Saved:
#if SIOUX_USE_WASTE
HUnlock( textHandle );
#else
HUnlock((*theTE)->hText);
#endif /* SIOUX_USE_WASTE */
SIOUXTextWindow->dirty = 0;
return (noErr);
}
/****************************************************************/
/* Purpose..: Handle the cut menu command */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoEditCut(void)
{
#if SIOUX_USE_WASTE
SInt32 weSelStart, weSelEnd;
OSErr err;
WEGetSelection( &weSelStart, &weSelEnd, SIOUXTextWindow->edit );
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && weSelStart != weSelEnd) {
err = WECut(SIOUXTextWindow->edit);
SIOUXTextWindow->dirty = TRUE;
SIOUXUpdateScrollbar();
}
#else
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && (*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd) {
TECut(SIOUXTextWindow->edit);
MyTEToScrap();
SIOUXTextWindow->dirty = TRUE;
SIOUXUpdateScrollbar();
}
#endif /* SIOUX_USE_WASTE */
}
/****************************************************************/
/* Purpose..: Handle the copy menu command */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoEditCopy(void)
{
#if SIOUX_USE_WASTE
SInt32 weSelStart, weSelEnd;
OSErr err;
WEGetSelection( &weSelStart, &weSelEnd, SIOUXTextWindow->edit );
if (weSelStart != weSelEnd) {
err = WECopy(SIOUXTextWindow->edit);
}
#else
if ((*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd)
{
TECopy(SIOUXTextWindow->edit);
MyTEToScrap(); /* mm 970428 */
}
#endif /* SIOUX_USE_WASTE */
}
/****************************************************************/
/* Purpose..: Handle the paste menu command */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoEditPaste(void)
{
#if SIOUX_USE_WASTE
OSErr err;
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && WECanPaste( SIOUXTextWindow->edit ) ) {
if (!gSIOUXTerminalMode) {
err = WEPaste(SIOUXTextWindow->edit);
SIOUXTextWindow->dirty = 1;
SIOUXUpdateScrollbar();
} else {
Handle hText = nil ;
OSErr err;
// look for a text flavor
if ( ( err = GetScrapHandle ( 'TEXT', &hText ) ) == noErr ) {
SInt32 size = GetHandleSize ( hText );
if (size > gSIOUXMaxSize - gSIOUXBufSize) {
size = gSIOUXMaxSize - gSIOUXBufSize;
}
BlockMoveData(* hText, gSIOUXChars + gSIOUXBufSize, size);
gSIOUXBufSize += size;
SIOUXState = IDLE;
GUSIWakeupSIOUXSocket();
DisposeHandle( hText );
}
}
}
#else
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && MyTEFromScrap() == noErr) {
TEPaste(SIOUXTextWindow->edit);
SIOUXTextWindow->dirty = 1;
SIOUXUpdateScrollbar();
}
#endif /* SIOUX_USE_WASTE */
}
/****************************************************************/
/* Purpose..: Handle the clear menu command */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoEditClear(void)
{
#if SIOUX_USE_WASTE
SInt32 weSelStart, weSelEnd;
WEGetSelection( &weSelStart, &weSelEnd, SIOUXTextWindow->edit );
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && weSelStart != weSelEnd) {
WEDelete(SIOUXTextWindow->edit);
SIOUXTextWindow->dirty = TRUE;
SIOUXUpdateScrollbar();
}
#else
if (SIOUXisinrange(SIOUXselstart, SIOUXTextWindow->edit) && (*SIOUXTextWindow->edit)->selStart != (*SIOUXTextWindow->edit)->selEnd) {
TEDelete(SIOUXTextWindow->edit);
SIOUXTextWindow->dirty = TRUE;
SIOUXUpdateScrollbar();
}
#endif /* SIOUX_USE_WASTE */
}
/****************************************************************/
/* Purpose..: Handle the select all menu command */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoEditSelectAll(void)
{
#if SIOUX_USE_WASTE
WESetSelection( 0, LONG_MAX, SIOUXTextWindow->edit );
#else
TESetSelect(0, 32767, SIOUXTextWindow->edit);
#endif /* SIOUX_USE_WASTE */
SIOUXUpdateScrollbar();
}
/****************************************************************/
/* Purpose..: Setup SIOUX's menus */
/* Input....: --- */
/* Returns..: --- */
/****************************************************************/
void SIOUXDoMenuChoice(long menuValue)
{
short theMenu = HiWord(menuValue);
short theMenuItem = LoWord(menuValue);
#if TARGET_API_MAC_OS8
Str255 accName;
#endif /* TARGET_API_MAC_OS8 */
if (!SIOUXIsAppWindow(FrontWindow()))
return;
switch(theMenu) {
case APPLEID:
switch (theMenuItem) {
case APPLEABOUT:
SIOUXDoAboutBox();
break;
default: /* ie the apple menu items ...*/
#if TARGET_API_MAC_OS8
GetMenuItemText(appleMenu, theMenuItem, accName);
OpenDeskAcc(accName);
#endif /* TARGET_API_MAC_OS8 */
break;
}
break;
case FILEID:
switch (theMenuItem) {
case FILESAVE:
SIOUXDoSaveText();
break;
case FILEPAGESETUP:
SIOUXDoPageSetup();
break;
case FILEPRINT:
SIOUXDoPrintText();
break;
case FILEQUIT:
if (SIOUXSettings.standalone)
SIOUXQuitting = TRUE;
break;
default:
break;
}
break;
case EDITID:
switch (theMenuItem) {
case EDITCUT:
SIOUXDoEditCut();
break;
case EDITCOPY:
SIOUXDoEditCopy();
break;
case EDITPASTE:
SIOUXDoEditPaste();
break;
case EDITCLEAR:
SIOUXDoEditClear();
break;
case EDITSELECTALL:
SIOUXDoEditSelectAll();
break;
default:
break;
}
break;
default:
break;
}
if (SIOUXSettings.standalone)
HiliteMenu(0);
}
#pragma bool reset
/* Change Record
* BB 01/10/93 removed all TextEdit calls which called toolbox glue
* so that users no longer needed to include MacOS.lib ...
* BB 04/10/93 rewrote savetext so that all file saving was done using
* inline toolbox calls therefore no MacOS.lib ...
* JH 30/12/95 removed uses of OLDROUTINENAMES
* bk 09/02/96 added Universal Headers incase macheaders not the prefix
* mm 970428 Replaced missing statement allowing copying to take place.
* cc 991108 added ra Carbon Changes done 990611
* cc 991109 changed TARGET_CARBON to TARGET_API_MAC_CARBON
* cc 991111 added ra & jww suggestions for functions no longer in carbon
* cc 991115 updated and deleted outdated carbon comments
* cc 991116 bug fix (IR9907-1420) - changed line 398 to if (!sfReply.sfGood)
* ra 000114 SIOUXSetupMenus calls InvalMenuBar for Carbon
* JWW 000531 Don't add a Quit item in the File menu if running on OS X
*/

View File

@ -1,282 +0,0 @@
/*
* console.stubs.c
* (c) 2000 Jean-Pierre Stierlin.
*
* 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
*/
#include "lshprefix.h"
#include "lsh_context.h"
#ifndef __CONSOLE__
#include <console.h>
#endif
#include <sched.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
/*
* The following four functions provide the UI for the console package.
* Users wishing to replace SIOUX with their own console package need
* only provide the four functions below in a library.
*/
/*
* extern short InstallConsole(short fd);
*
* Installs the Console package, this function will be called right
* before any read or write to one of the standard streams.
*
* short fd: The stream which we are reading/writing to/from.
* returns short: 0 no error occurred, anything else error.
*/
short InstallConsole(short fd)
{
#pragma unused (fd)
return 0;
}
/*
* extern void RemoveConsole(void);
*
* Removes the console package. It is called after all other streams
* are closed and exit functions (installed by either atexit or _atexit)
* have been called. Since there is no way to recover from an error,
* this function doesn't need to return any.
*/
void RemoveConsole(void)
{
}
/*
* can_read
*/
Boolean can_read()
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return 0;
}
return context->_gConsoleInBufLen || context->_gConsoleInEOF;
}
/*
* extern long WriteCharsToConsole(char *buffer, long n);
*
* Writes a stream of output to the Console window. This function is
* called by write.
*
* char *buffer: Pointer to the buffer to be written.
* long n: The length of the buffer to be written.
* returns short: Actual number of characters written to the stream,
* -1 if an error occurred.
*/
long WriteCharsToConsole(char *buffer, long n)
{
long written = 0;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
char *buf = buffer;
char c;
if ( !context ) {
return 0;
}
if ( context->_gConsoleOutBufMax ) {
if ( context->_socket == -1 ) {
while (n > 0) {
if ( context->_gConsoleOutBufLen < context->_gConsoleOutBufMax ) {
long len = n;
if ( len > context->_gConsoleOutBufMax - context->_gConsoleOutBufLen ) {
len = context->_gConsoleOutBufMax - context->_gConsoleOutBufLen;
}
if ( context->_convertLFs ) {
long inlen = 0;
long outlen = context->_gConsoleOutBufLen;
/*
while (inlen < len && outlen < context->_gConsoleOutBufMax - 1) {
c = buf[inlen++];
if ( c == 0x0a ) {
context->_gConsoleOutBuf[outlen++] = 0x0d;
}
context->_gConsoleOutBuf[outlen++] = c;
}
*/
while (inlen < len && outlen < context->_gConsoleOutBufMax - 1) {
c = buf[inlen++];
if ( context->_lastCR ) {
if ( c != 0x0a && c != 0x1b )
context->_gConsoleOutBuf[outlen++] = 0x0a;
} else {
if ( c == 0x0a )
context->_gConsoleOutBuf[outlen++] = 0x0d;
}
context->_gConsoleOutBuf[outlen++] = c;
context->_lastCR = (c == 0x0d);
}
context->_gConsoleOutBufLen = outlen;
buf += inlen;
written += inlen;
n -= inlen;
} else {
BlockMoveData( buf, context->_gConsoleOutBuf + context->_gConsoleOutBufLen, len);
/*context->_lastCR = (buf[len-1] == 0x0d);*/
context->_gConsoleOutBufLen += len;
buf += len;
written += len;
n -= len;
}
if ( context->_port != -1 ) {
/*netputuev(CONCLASS, CONDATA, context->_port,0);*/
}
}
ssh2_sched();
}
}
} else {
written = n;
}
/*
syslog( 0, "write\n");
dumpln(0, 0, buffer, written);
*/
return written;
}
/*
* extern long ReadCharsFromConsole(char *buffer, long n);
*
* Reads from the Console into a buffer. This function is called by
* read.
*
* char *buffer: Pointer to the buffer which will recieve the input.
* long n: The maximum amount of characters to be read (size of
* buffer).
* returns short: Actual number of characters read from the stream,
* -1 if an error occurred.
*/
long ReadCharsFromConsole(char *buffer, long n)
{
long len = 0;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return 0;
}
if ( context->_gConsoleInBufMax ) {
if ( context->_socket == -1 ) {
while (!len && n > 0) {
if (context->_gConsoleInEOF) {
buffer[0] = -1;
return 0;
}
if (context->_gConsoleInBufLen) {
len = context->_gConsoleInBufLen;
if ( len > n ) {
len = n;
}
BlockMoveData( context->_gConsoleInBuf, buffer, len );
context->_gConsoleInBufLen -= len;
if ( context->_gConsoleInBufLen ) {
BlockMoveData( context->_gConsoleInBuf + len, context->_gConsoleInBuf, context->_gConsoleInBufLen );
}
}
ssh2_sched();
}
}
} else {
buffer[0] = -1;
}
/*
syslog( 0, "read\n");
dumpln(0, 0, buffer, len);
*/
return len;
}
/*
* extern char *__ttyname(long fildes);
*
* Return the name of the current terminal (only valid terminals are
* the standard stream (ie stdin, stdout, stderr).
*
* long fildes: The stream to query.
*
* returns char*: A pointer to static global data which contains a C string
* or NULL if the stream is not valid.
*/
extern char *__ttyname(long fildes)
{
#pragma unused (fildes)
/* all streams have the same name */
static char *__devicename = "null device";
if (fildes >= 0 && fildes <= 2)
return (__devicename);
return (0L);
}
/* Begin mm 981218 */
/*
*
* int kbhit()
*
* returns true if any keyboard key is pressed without retrieving the key
* used for stopping a loop by pressing any key
*/
int kbhit(void)
{
return 0;
}
/*
*
* int getch()
*
* returns the keyboard character pressed when an ascii key is pressed
* used for console style menu selections for immediate actions.
*/
int getch(void)
{
return 0;
}
/*
* void clrscr()
*
* clears screen
*/
void clrscr()
{
return;
}
/* End mm 981218 */
/* Change record
* mm 981218 Added stubs for kbhit(), getch(), and clrscr()
*/

View File

@ -1,178 +0,0 @@
/*
* dlltest.c
* (c) 2000 Jean-Pierre Stierlin.
*
* 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
*/
#include <MacTypes.h>
#include <Events.h>
#include <console.h>
#include <stdio.h>
#include <SIOUX.h>
#include <SIOUXGlobals.h>
#include "lsh_dll.h"
struct tctx {
lshctx *lsh_ctx;
};
char password[64];
void my_hdlevt(long userData, EventRecord *userEvent, long sleepTime)
{
EventRecord theEvent;
lshctx *lsh_ctx = ((struct tctx *)userData)->lsh_ctx;
char buf[4096];
int count;
char c;
if ( userEvent == NULL ) {
if ( SIOUXUseWaitNextEvent ) {
WaitNextEvent( everyEvent, &theEvent, 0, NULL );
} else {
#if TARGET_API_MAC_OS8
SystemTask();
#endif
GetNextEvent( everyEvent, &theEvent );
}
userEvent = &theEvent;
}
/* something to send ? */
if ( (userEvent->what != keyDown && userEvent->what != autoKey) && !(userEvent->modifiers & cmdKey) ) {
SIOUXHandleOneEvent( userEvent );
} else {
c = userEvent->message & charCodeMask;
lsh_write( lsh_ctx, &c, 1 );
}
/* something received ? */
while ((count = lsh_read(lsh_ctx, buf, 4096)) != 0) {
printf("%.*s", count, buf);
fflush(stdout);
}
}
void my_log(long userData, const char *message)
{
printf("%s", message);
}
char *my_getpass(long userData, const char *prompt)
{
printf("%s", prompt);
fflush(stdout);
fgets(password, sizeof(password), stdin);
password[strlen(password) - 1] = 0;
return password;
}
int my_yes_or_no(long userData, const char *prompt, int def)
{
char input[32];
printf("%s", prompt);
fflush(stdout);
do {
fgets(input, sizeof(input), stdin);
if (input[0] == 'y' || input[0] == 'Y')
return 1;
else if (input[0] == 'n' || input[0] == 'N')
return 0;
printf("please anwser with 'y' or 'n' : ");
fflush(stdout);
} while (1);
return def;
}
int main(void)
{
struct tctx my_ctx;
lshctx *lsh_ctx;
char argstr[1024];
SIOUXSettings.autocloseonquit = 0;
SIOUXSettings.asktosaveonclose = 0;
SIOUXSettings.showstatusline = 1;
SIOUXSettings.columns = 80;
SIOUXSettings.rows = 48;
SIOUXSettings.toppixel = 50;
SIOUXSettings.leftpixel = 20;
SIOUXSettings.tabspaces = 8;
strcpy(argstr, "lsh");
strcat(argstr, " -ljps");
strcat(argstr, " --host-db \"");
strcat(argstr, lsh_getprefsd());
strcat(argstr, "known_hosts\"");
strcat(argstr, " --capture-to \"");
strcat(argstr, lsh_getprefsd());
strcat(argstr, "known_hosts\"");
strcat(argstr, " --sloppy-host-authentication");
strcat(argstr, " -call -zzlib");
//strcat(argstr, " --verbose --trace --debug");
strcat(argstr, " --verbose");
strcat(argstr, " --stdin dev:ttyin --stdout dev:ttyout --stderr dev:ttyerr");
strcat(argstr, " 192.168.1.41");
//strcat(argstr, " cvs -d/home/macssh server");
printf("argstr : %s\n", argstr);
fflush(stdout);
lsh_ctx = lsh_new(argstr, my_hdlevt, my_log, my_getpass, my_yes_or_no, 0L, (long)&my_ctx);
if ( lsh_ctx != NULL ) {
my_ctx.lsh_ctx = lsh_ctx;
printf("lsh_new ok\n");
fflush(stdout);
while (!SIOUXQuitting && lsh_running(lsh_ctx)) {
lsh_yield();
my_hdlevt((long)&my_ctx, NULL, 0L);
}
/* this kills the thread if still running */
lsh_delete(lsh_ctx );
} else {
printf("lsh_new failed\n");
fflush(stdout);
}
printf("done\n");
fflush(stdout);
return 0;
}

View File

@ -1,75 +0,0 @@
#ifndef _LSH_CONTEXT_H
#define _LSH_CONTEXT_H
#include <Types.h>
#include <pthread.h>
#include <setjmp.h>
#include "lsh_types.h"
#include "lsh.h"
#define CONSOLEBUFSIZE 16384
typedef struct lshcontext {
int _port; // for BetterTelnet's networking
void *_userdata; // available for callers
pthread_t _thread;
int _forward;
int _localport;
int _listener; // for cvs
int _socket; // for cvs
int _rcmdline; // for cvs
jmp_buf *_pexitbuf;
Boolean _gConsoleInEOF;
Boolean _convertLFs;
Boolean _stripCRs;
char _lastCR;
void *_insock;
long _gConsoleInBufLen;
long _gConsoleInBufMax;
char _gConsoleInBuf[CONSOLEBUFSIZE];
long _gConsoleOutBufLen;
long _gConsoleOutBufMax;
char _gConsoleOutBuf[CONSOLEBUFSIZE];
int _quiet_flag;
int _verbose_flag;
int _trace_flag;
int _debug_flag;
int _tracing;
int _verbosing;
int _debugging;
char *_envv[4]; // "HOME", "LOGNAME", "TERM", "DISPLAY"
char _term[64]; // home and logname never change
char _display[64]; // home and logname never change
char _kpassword[64];
int _kindex;
int _pindex;
char _keychainprompt[256];
struct lshcontext *_self;
} lshcontext;
extern pthread_key_t ssh2threadkey;
#define quiet_flag (((lshcontext *)pthread_getspecific(ssh2threadkey))->_quiet_flag)
#define verbose_flag (((lshcontext *)pthread_getspecific(ssh2threadkey))->_verbose_flag)
#define trace_flag (((lshcontext *)pthread_getspecific(ssh2threadkey))->_trace_flag)
#define debug_flag (((lshcontext *)pthread_getspecific(ssh2threadkey))->_debug_flag)
#define tracing (((lshcontext *)pthread_getspecific(ssh2threadkey))->_tracing)
#define verbosing (((lshcontext *)pthread_getspecific(ssh2threadkey))->_verbosing)
#define debugging (((lshcontext *)pthread_getspecific(ssh2threadkey))->_debugging)
#define convertLFs (((lshcontext *)pthread_getspecific(ssh2threadkey))->_convertLFs)
#define stripCRs (((lshcontext *)pthread_getspecific(ssh2threadkey))->_stripCRs)
#define window_changed (((lshcontext *)pthread_getspecific(ssh2threadkey))->_window_changed)
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,310 +0,0 @@
#include "lshprefix.h"
#include "lsh_context.h"
#include <GUSIInternal.h>
#include <GUSIFileSpec.h>
#include <GUSIDescriptor.h>
#include <GUSISocket.h>
#include <GUSIPOSIX.h>
#include <GUSITimer.h>
#include <pthread.h>
#include <sys/time.h>
#include <setjmp.h>
#include <sched.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef __cplusplus
extern "C" {
#endif
char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *dirID);
void ssh2_sched();
void ssh2_doevent(EventRecord *theEvent, long sleepTime);
#ifdef __cplusplus
}
#endif
/*
* getprefsd return the full path of prefs directory
*/
char *getprefsd(char *name, char *buf, size_t size, short *vRefNum, long *dirID)
{
GUSIFileSpec prefs(kPreferencesFolderType, kOnSystemDisk);
char * res;
char * out = buf;
const GUSICatInfo *info;
if (prefs.Error())
return GUSISetMacError(prefs.Error()), static_cast<char *>(nil);
prefs.SetName(name);
res = prefs.FullPath();
if (size < strlen(res)+1)
return GUSISetPosixError(size > 0 ? ERANGE : EINVAL),
static_cast<char *>(nil);
if (!out && !(out = (char *) malloc(size)))
return GUSISetPosixError(ENOMEM), static_cast<char *>(nil);
strcpy(out, res);
if ( (access( out, R_OK ) == 0 || mkdir( out ) == 0) && (info = prefs.CatInfo()) != nil ) {
*vRefNum = info->DirInfo().ioVRefNum;
*dirID = info->DirInfo().ioDrDirID;
} else {
if (!buf)
free(out);
return static_cast<char *>(nil);
}
return out;
}
// [[select]] is quite complex, so we break it up. [[select_once]] polls all
// file descriptors once.
//
// <Socket function wrappers>=
static int select_once(int width,
fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
fd_set *readres, fd_set *writeres, fd_set *exceptres)
{
bool r, w, e;
bool * canRead;
bool * canWrite;
bool * canExcept;
int count = 0;
for (int s = 0; s < width ; ++s) {
canRead = (readfds && FD_ISSET(s,readfds)) ? &r : nil;
canWrite = (writefds && FD_ISSET(s,writefds)) ? &w : nil;
canExcept = (exceptfds && FD_ISSET(s,exceptfds)) ? &e : nil;
if (canRead || canWrite || canExcept) {
GUSISocket * sock = GUSIDescriptorTable::LookupSocket(s);
if (!GUSI_ASSERT_EXTERNAL(sock, ("Socket %d closed in select\n", s)))
return count ? count : -1;
r = w = e = false;
if (sock->select(canRead, canWrite, canExcept))
count += (canRead && *canRead)+(canWrite && *canWrite)+(canExcept && *canExcept);
if (r)
FD_SET(s,readres);
if (w)
FD_SET(s,writeres);
if (e)
FD_SET(s,exceptres);
}
}
return count;
}
// [[select_sleep]] sleeps as long as [[canSleep]] allows.
//
// <Socket function wrappers>=
static bool select_sleep(bool canSleep)
{
if (canSleep) {
return GUSIContext::Yield(kGUSIBlock);
} else {
return GUSIContext::Yield(kGUSIPoll);
}
}
// [[select_forever]] keeps calling [[select_once]] until one of the file
// descriptors triggers.
//
// <Socket function wrappers>=
static int select_forever(bool canSleep, int width,
fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
fd_set *readres, fd_set *writeres, fd_set *exceptres)
{
int count;
for (;;) {
count =
select_once(width,
readfds, writefds, exceptfds,
readres, writeres, exceptres);
if (count)
break;
if (select_sleep(canSleep))
return GUSISetPosixError(EINTR);
}
return count;
}
extern "C" jmp_buf *getexitbuf();
extern "C" void *setexitbuf(jmp_buf *exitbuf);
// [[select_timed]] keeps calling [[select_once]] until one of the file
// descriptors triggers or the timer runs out.
//
// <Socket function wrappers>=
static int select_timed(bool canSleep, int width,
fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
fd_set *readres, fd_set *writeres, fd_set *exceptres,
struct timeval *timeout)
{
int count;
// we must delete the timer before exiting current thread
// otherwise, bad things occur.
jmp_buf *oldexitbuf = getexitbuf();
jmp_buf exitbuf;
setexitbuf(&exitbuf);
int result;
{
GUSITimer timer;
if ( !(result = setjmp(exitbuf)) ) {
timer.MicroSleep(GUSITime(*timeout).Get(GUSITime::usecs));
for (;;) {
count =
select_once(width,
readfds, writefds, exceptfds,
readres, writeres, exceptres);
if (count || timer.Expired())
break;
if (select_sleep(canSleep))
return GUSISetPosixError(EINTR);
}
}
}
setexitbuf(oldexitbuf);
if ( result ) {
longjmp( *oldexitbuf, result );
}
/*
GUSITimer timer;
timer.MicroSleep(GUSITime(*timeout).Get(GUSITime::usecs));
for (;;) {
count =
select_once(width,
readfds, writefds, exceptfds,
readres, writeres, exceptres);
if (count || timer.Expired())
break;
if (select_sleep(canSleep))
return GUSISetPosixError(EINTR);
}
*/
return count;
}
// Even so, [[select]] is still a heavyweight.
//
// <Socket function wrappers>=
int select(int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
{
bool canSleep = true;
int count = 0;
fd_set readres; FD_ZERO(&readres);
fd_set writeres; FD_ZERO(&writeres);
fd_set exceptres; FD_ZERO(&exceptres);
// <Check that all specified file descriptors are valid or [[return -1]]>=
for (int s = 0; s < width ; ++s)
if ( (readfds && FD_ISSET(s,readfds))
|| (writefds && FD_ISSET(s,writefds))
|| (exceptfds && FD_ISSET(s,exceptfds))
)
if (!GUSIDescriptorTable::LookupSocket(s))
return -1;
// <Call [[pre_select]] for all file descriptors and determine [[canSleep]]>=
for (int s = 0; s < width ; ++s)
if (GUSISocket * sock = GUSIDescriptorTable::LookupSocket(s)) {
bool r = readfds && FD_ISSET(s,readfds);
bool w = writefds && FD_ISSET(s,writefds);
bool e = exceptfds && FD_ISSET(s,exceptfds);
if (r || w || e)
canSleep = sock->pre_select(r, w, e) && canSleep;
}
// we must call post_select before exiting current thread
// to remove the contexts. otherwise, bad things occur.
jmp_buf *oldexitbuf = getexitbuf();
jmp_buf exitbuf;
setexitbuf(&exitbuf);
int result;
if ( !(result = setjmp(exitbuf)) ) {
if (!timeout) {
count =
select_forever(canSleep, width,
readfds, writefds, exceptfds,
&readres, &writeres, &exceptres);
} else if (timeout->tv_sec || timeout->tv_usec) {
count =
select_timed(canSleep, width,
readfds, writefds, exceptfds,
&readres, &writeres, &exceptres,
timeout);
} else {
count =
select_once(width,
readfds, writefds, exceptfds,
&readres, &writeres, &exceptres);
GUSIContext::Yield(kGUSIYield);
}
}
// <Call [[post_select]] for all file descriptors>=
// this is needed because next loop always exits with errno = EBADF
// which overwrite potential EINTR signal.
int saveErrno = errno;
for (int s = 0; s < width ; ++s)
if (GUSISocket * sock = GUSIDescriptorTable::LookupSocket(s)) {
bool r = readfds && FD_ISSET(s,readfds);
bool w = writefds && FD_ISSET(s,writefds);
bool e = exceptfds && FD_ISSET(s,exceptfds);
if (r || w || e)
sock->post_select(r, w, e);
}
errno = saveErrno;
setexitbuf(oldexitbuf);
if ( result ) {
longjmp( *oldexitbuf, result );
}
// <Copy internal descriptor sets to parameters>=
if (readfds)
*readfds = readres;
if (writefds)
*writefds = writeres;
if (exceptfds)
*exceptfds = exceptres;
return count;
}
/*
* ssh2_sched
*/
void ssh2_sched()
{
sched_yield();
}
/*
* GUSIHandleNextEvent
*/
void GUSIHandleNextEvent(long sleepTime)
{
ssh2_doevent(NULL, sleepTime);
}

View File

@ -1,173 +0,0 @@
/*
* lsh_dll.h
* (c) 2000 Jean-Pierre Stierlin.
*
* 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
*/
#ifndef LSH_DLL_H_
#define LSH_DLL_H_
#include <Events.h>
typedef void *lshctx;
typedef void (*hdlevtfunc)(long userData, EventRecord *userEvent, long sleepTime);
typedef void (*logfunc)(long userData, const char *message);
typedef char *(*getpassfunc)(long userData, const char *prompt);
typedef int (*yesornofunc)(long userData, const char *prompt, int def);
enum {
kLSHConvertLFs = 0x1,
kLSHStripCRs = 0x2
};
#ifdef __cplusplus
extern "C" {
#endif
/*
* lsh_new
*
* input:
*
* - argstr: argument string (see Usage below).
* - hdlevt callback to main event handler
* - log: callback for lsh logs
* - getpass: called upon password request
* - yes_or_no: called upon new host keys confirmation request
*
* returns:
*
* - opaque lshctx struct to use for further calls
*
* --------------------------------------------------------------------------------
*
* Usage: lsh [OPTION...] host
* or: lsh [OPTION...] host command ...
* Connects to a remote machine
*
* --capture-to=File When a new hostkey is received, append an ACL
* expressing trust in the key. In sloppy mode, the
* default is captured_keys.
* --dh-keyexchange Enable DH support (default, unless SRP is being
* used).
* --host-db=Filename By default, known_hosts
* -i, --identity=Identity key Use this key to authenticate.
* --no-dh-keyexchange Disable DH support.
* --no-publickey Don't try publickey user authentication.
* --no-srp-keyexchange Disable experimental SRP support (default).
* --no-userauth Request the ssh-userauth service (default if SRP
* is used).
* --publickey Try publickey user authentication (default).
* --sloppy-host-authentication
* Allow untrusted hostkeys.
* --srp-keyexchange Enable experimental SRP support.
* --strict-host-authentication
* Never, never, ever trust an unknown hostkey.
* (default)
* --userauth Request the ssh-userauth service (default, unless
* SRP is being used).
* --debug Print huge amounts of debug information
* -q, --quiet Suppress all warnings and diagnostic messages
* --trace Detailed trace
* -v, --verbose Verbose diagnostic messages
*
* Algorithm selection:
* -c, --crypto=Algorithm
* --hostkey-algorithm=Algorithm
* --list-algorithms List supported algorithms.
* -m, --mac=Algorithm
* -z, --compression[=Algorithm] Default is zlib.
*
* -l, --user=User name Login as this user.
* -p, --port=Port Connect to this port.
*
* Actions:
* -E, --execute=command Execute a command on the remote machine
* -L, --forward-local-port=local-port:target-host:target-port
* -N, --nop No operation (suppresses the default action, which
* is to spawn a remote shell)
* -S, --shell=command Spawn a remote shell
*
* Universal not:
* -n, --no Inverts the effect of the next modifier
*
* Modifiers that apply to port forwarding:
* -g, --remote-peers Allow remote access to forwarded ports
* --no-remote-peers Disallow remote access to forwarded ports
* (default).
*
* Modifiers that apply to remote execution:
* --no-pty Don't request a remote pty.
* --no-stderr Redirect stderr to /dev/null
* --no-stdin Redirect stdin from /dev/null
* --no-stdout Redirect stdout to /dev/null
* --stderr=Filename Redirect stderr
* --stdin=Filename Redirect stdin
* --stdout=Filename Redirect stdout
* -t, --pty Request a remote pty (default).
*
* -R, --forward-remote-port=remote-port:target-host:target-port
*
* -?, --help Give this help list
* --usage Give a short usage message
* -V, --version Print program version
*
* Mandatory or optional arguments to long options are also mandatory or optional
* for any corresponding short options.
*
* Connects to the remote machine, and then performs one or more actions, i.e.
* command execution, various forwarding services. The default action is to start
* a remote interactive shell or execute a given command on the remote machine.
*
* --------------------------------------------------------------------------------
* Sample argstr:
*
* lsh -lusername -iidentityfile --sloppy-host-authentication 192.168.1.41
*
* *IMPORTANT* all the data after the first argument (i.e. the hostname)
* are passed as a command to launch on the server.
*/
lshctx *lsh_new(char *argstr, hdlevtfunc hdlevt, logfunc log, getpassfunc getpass,
yesornofunc yes_or_no, unsigned long flags, long userData);
void lsh_delete(lshctx *ctx);
void lsh_yield();
int lsh_read(lshctx *ctx, void *buffer, long inbytes);
long lsh_write(lshctx *ctx, const void *buffer, long inbytes);
int lsh_canread(lshctx *ctx);
int lsh_canwrite(lshctx *ctx);
char *lsh_getprefsd();
lshctx *lsh_current();
Boolean lsh_running(lshctx *ctx);
void lsh_init(void);
void lsh_terminate(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,34 +0,0 @@
/*
* lsh_evt.c
* (c) 2000 Jean-Pierre Stierlin.
*
* 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
*/
#include "lshprefix.h"
#include "lsh_context.h"
#include <Events.h>
/*
* SIOUXHandleOneEvent
*/
short SIOUXHandleOneEvent(EventRecord *userEvent)
{
ssh2_doevent(userEvent, 0L);
return 1;
}

View File

@ -1,62 +0,0 @@
/*
* GUSIPatches.cp
*/
#include "lshprefix.h"
#include "lsh_context.h"
#include <pthread.h>
#include <console.h>
#include <sched.h>
#include "GUSIMSLSetup.h"
#ifdef __cplusplus
extern "C" {
#endif
void GUSIwithTTYSockets();
void GUSIwithoutTTYSockets();
void ssh2_init();
void ssh2_terminate();
#ifdef __cplusplus
}
#endif
/*
* - This project is intended to work with MacCvs (http://www.cvsgui.org)
* - It exports the lsh program as a shared library, thanks to Jean-Pierre.
* - The lsh API is hooked up to the cvs shared library of cvs and provide
* the SSH2 authentication.
*
* Questions : alexandre parenteau (aubonbeurre@hotmail.com)
*/
/*
* ssh2_init
*/
static Boolean sGUSISetup = false;
void ssh2_init()
{
if ( !sGUSISetup ) {
GUSIwithTTYSockets();
sGUSISetup = true;
}
}
void ssh2_terminate()
{
if ( sGUSISetup ) {
GUSIwithoutTTYSockets();
sGUSISetup = false;
}
}

View File

@ -1,2 +0,0 @@
#include <MSLCarbonPrefix.h>
#include "lshprefix.h"

View File

@ -1,375 +0,0 @@
/* prefix.h */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to support non-standard packets of ssh2 */
#define DATAFELLOWS_WORKAROUNDS 1
/* Define to enable sanity checking on memory allocation and casting */
#define DEBUG_ALLOC 0
/* Define to enable tracing */
#define DEBUG_TRACE 1
/* Define if the `getpgrp' function takes no argument. */
/* #undef GETPGRP_VOID */
/* Define if AI_NUMERICHOST exists */
/* #undef HAVE_AI_NUMERICHOST */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#define HAVE_ALLOCA_H 1
/* Define if you have the <argp.h> header file. */
/* #undef HAVE_ARGP_H */
/* Define if you have the cfmakeraw function. */
/* #undef HAVE_CFMAKERAW */
/* Define if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the gai_strerror function. */
/* #undef HAVE_GAI_STRERROR */
/* Define if the compiler understands __attribute__ */
/* #undef HAVE_GCC_ATTRIBUTE */
/* Define if the compiler understands __FUNCTION__ */
/* #define HAVE_GCC_FUNCTION 1 */
/* Define if you have the getaddrinfo function. */
/* #undef HAVE_GETADDRINFO */
/* Define if you have the getnameinfo function. */
/* #undef HAVE_GETNAMEINFO */
/* Define if you have the getrusage function. */
/* #undef HAVE_GETRUSAGE */
/* Define if you have the getspnam function. */
/* #undef HAVE_GETSPNAM */
/* Define if you have the gettimeofday function. */
#define HAVE_GETTIMEOFDAY 1
/* Define if you have the <gmp2/gmp.h> header file. */
/* #undef HAVE_GMP2_GMP_H */
/* Define if you have the <gmp.h> header file. */
#define HAVE_GMP_H 1
/* Define if you have the inet_aton function. */
#define HAVE_INET_ATON 1
/* Define if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
/* Define if you have the <krb5.h> header file. */
/* #undef HAVE_KRB5_H */
/* Define if you have the crypt library (-lcrypt). */
/* #undef HAVE_LIBCRYPT */
/* Define if you have the nsl library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define if you have the socket library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define if you have the util library (-lutil). */
/* #undef HAVE_LIBUTIL */
/* Define if you have the <libutil.h> header file. */
/* #undef HAVE_LIBUTIL_H */
/* Define if you have the `Xau' library (-lXau). */
/* #undef HAVE_LIBXAU */
/* Define if you have the `xnet' library (-lxnet). */
/* #undef HAVE_LIBXNET */
/* Define if you have the z library (-lz). */
/* #undef HAVE_LIBZ */
/* Define if you have the login function. */
/* #undef HAVE_LOGIN */
/* Define if you have the logout function. */
/* #undef HAVE_LOGOUT */
/* Define if you have the logwtmp function. */
/* #undef HAVE_LOGWTMP */
/* Define if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define if you have the memxor function. */
/* #undef HAVE_MEMXOR */
/* Define if you have the openpty function. */
/* #undef HAVE_OPENPTY */
/* Define if you have the poll function. */
/* #undef HAVE_POLL */
/* Define if you have the <poll.h> header file. */
/* #undef HAVE_POLL_H */
/* Define if you have the <pty.h> header file. */
/* #undef HAVE_PTY_H */
/* Define if you have the select function. */
#define HAVE_SELECT 1
/* Define if you have the <shadow.h> header file. */
/* #undef HAVE_SHADOW_H */
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
/* Define if you have the strerror function. */
/* #undef HAVE_STDLIB_H */
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the <strings.h> header file. */
/* #undef HAVE_STRINGS_H */
/* Define if you have the <string.h> header file. */
/* #undef HAVE_STRING_H */
/* Define if you have the <stropts.h> header file. */
/* #undef HAVE_STROPTS_H */
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
/* Define if you have the strtol function. */
#define HAVE_STRTOL 1
/* Define if `ut_addr' is member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_ADDR */
/* Define if `ut_addr_v6' is member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_ADDR_V6 */
/* Define if `ut_host' is member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_HOST */
/* Define if `ut_name' is member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_NAME */
/* Define if `ut_user' is member of `struct utmp'. */
/* #undef HAVE_STRUCT_UTMP_UT_USER */
/* syslog() available? */
#define HAVE_SYSLOG 1
/* Define if you have the <syslog.h> header file. */
/* #define HAVE_SYSLOG_H 1 */
/* Define if you have the <sys/poll.h> header file. */
/* #undef HAVE_SYS_POLL_H */
/* Define if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if a we have working UNIX98 pty handling */
/* #undef HAVE_UNIX98_PTYS */
/* Define if you have the <utmpx.h> header file. */
/* #undef HAVE_UTMPX_H */
/* Define if you have the <utmp.h> header file. */
/* #undef HAVE_UTMP_H */
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the vsnprintf function. */
#define HAVE_VSNPRINTF 1
/* Define if you have the <X11/Xauth.h> header file. */
/* #undef HAVE_X11_XAUTH_H */
/* Define if you have the <zlib.h> header file. */
#define HAVE_ZLIB_H 1
/* Name of package */
#define PACKAGE "lsh"
/* The installation prefix. */
/* #undef PREFIX */
/* Traditional BSD pty handling */
/* #undef PTY_BSD_SCHEME */
/* Possible first characters in a /dev/ptyXX name */
/* #undef PTY_BSD_SCHEME_FIRST_CHARS */
/* Possible second characters in a /dev/ptyXX name */
/* #undef PTY_BSD_SCHEME_SECOND_CHARS */
/* sbin directory */
/* #undef SBINDIR */
/* Define to indicate that shutdown seems to work properly */
#define SHUTDOWN_WORKS_WITH_UNIX_SOCKETS 1
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* Location of the SSH1 daemon */
/* #undef SSHD1 */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Version number of package */
#define VERSION "1.3.4"
/* Define to enable authentication agent forwarding */
/* #undef WITH_AGENT_FORWARD */
/* Use gcov */
/* #undef WITH_GCOV */
/* Define if IDEA should be used */
/* #define WITH_IDEA 1 */
/* For Ipv6 support */
/* #undef WITH_IPV6 */
/* For kerberos */
/* #undef WITH_KERBEROS */
/* Define to enable pty support */
#define WITH_PTY_SUPPORT 1
/* Define if SRP should be supported */
#define WITH_SRP 1
/* Define to enable fallback to SSH1 */
/* #undef WITH_SSH1_FALLBACK */
/* Define to enable tcp forwarding */
#define WITH_TCP_FORWARD 1
/* For utmp support */
/* #undef WITH_UTMP */
/* Define to enable x11 forwarding */
#define WITH_X11_FORWARD 1
/* Define if zlib should be used */
#define WITH_ZLIB 1
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#define WORDS_BIGENDIAN 1
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Length type used by getsockopt */
/* #undef socklen_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* MacOS Specific */
#define MACOS 1
#define LSH 1
/*#define HAVE_STDTTY_FILENO 1*/
/*#define STDTTY_FILENO 0*/
#define SIOUX_USE_WASTE 1
#define exit macosexit
#define abort macosabort
#define zlib_alloc ssh_xcalloc
#define zlib_free ssh_xfree
#include <sys/types.h>
#include <string.h>
#include "version.h"
/*
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
#define WORDS_BIGENDIAN 1
#endif
*/
extern char *strsignal(int signo);
/* bug in metrowerks 68k alloca function */
#ifndef powerc
#define ALLOCA_68K_BUG 1
//#if __MWERKS__
#if __MC68K__ /* begin mm 980512 */
#include <stddef.h>
extern void *__alloca(size_t size:__d0) : __d0;
#endif /* end mm 980512 */
//#endif
#endif
#if ALLOCA_68K_BUG
inline asm long GetSP() {
move.l sp,d0
}
#define ALLOCA_START(x) register long x = GetSP()
#define ALLOCA_FREE(x) asm { move.l x,sp }
#else
#define ALLOCA_START(x)
#define ALLOCA_FREE(x)
#endif

View File

@ -1,288 +0,0 @@
/* unix_random.c
*
* $Id$
*
* Randomness polling on unix, using ideas from Peter Gutmann's
* cryptlib. */
/* lsh, an implementation of the ssh protocol
*
* Copyright (C) 2000 Niels Möller
*
* 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
*/
#include "randomness.h"
#include "crypto.h"
#include "reaper.h"
#include "xalloc.h"
#include "werror.h"
#include <assert.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#ifdef HAVE_POLL
# if HAVE_POLL_H
# include <poll.h>
# elif HAVE_SYS_POLL_H
# include <sys/poll.h>
# endif
#else
# include "jpoll.h"
#endif
/* Workaround for some version of FreeBSD. */
#ifdef POLLRDNORM
# define MY_POLLIN (POLLIN | POLLRDNORM)
#else /* !POLLRDNORM */
# define MY_POLLIN POLLIN
#endif /* !POLLRDNORM */
#include <sys/time.h>
enum poll_status { POLL_NO_POLL, POLL_RUNNING, POLL_FINISHED, POLL_FAILED };
#include "unix_random.c.x"
#ifdef MACOS
#include <Events.h>
#include <LowMem.h>
#include <Processes.h>
#include <Timer.h>
#include <Windows.h>
#ifdef __powerc
// The timebase is available through mfspr on 601, mftb on later chips.
// Motorola recommends that an 601 implementation map mftb to mfspr
// through an exception, but I haven't tested to see if MacOS actually
// does this. We only sample the lower 32 bits of the timer (i.e. a
// few minutes of resolution)
unsigned long GetPPCTimer();
asm unsigned long GetPPCTimer()
{
mftb r3 // Available on 603 and later.
}
#endif
#endif
#define HASH_OBJECT(h, x) HASH_UPDATE((h), sizeof(x), (UINT8 *) &(x))
static unsigned long
GetUSecLow()
{
#ifdef __powerc
return GetPPCTimer();
#else
UnsignedWide usec;
Microseconds(&usec);
return usec.lo;
#endif
}
#if TARGET_API_MAC_CARBON
typedef struct
{
unsigned *count;
struct hash_instance *hash;
} flattenTravInfos;
static pascal OSErr collectionFlattenProc(SInt32 size, void *data, void *refCon)
{
flattenTravInfos *infos = (flattenTravInfos *)refCon;
HASH_UPDATE(infos->hash, size, (UINT8 *)data);
*infos->count += size / 8;
return noErr;
}
#endif
static unsigned
do_unix_random_slow(struct random_poll *s, struct hash_instance *hash)
{
CAST(unix_random, self, s);
unsigned count;
time_t now;
unsigned long tick;
Point mouseLoc;
ProcessSerialNumber psn;
ProcessInfoRec pinfo;
Str255 pname;
FSSpec pfspec;
#if TARGET_API_MAC_CARBON
WindowPtr window;
Collection collection = NewCollection();
CollectionFlattenUPP coltraversal = NewCollectionFlattenUPP(collectionFlattenProc);
flattenTravInfos flattenInfos;
#else
const WindowRecord *window;
const VCB *vcb;
#endif
now = time( NULL );
tick = GetUSecLow();
GetMouse( &mouseLoc );
count = 0;
HASH_OBJECT(hash, now);
HASH_OBJECT(hash, tick);
HASH_OBJECT(hash, mouseLoc);
count += 12;
psn.highLongOfPSN = 0;
psn.lowLongOfPSN = kNoProcess;
if ( GetNextProcess( &psn ) == noErr ) {
do {
pinfo.processInfoLength = sizeof(ProcessInfoRec);
pinfo.processName = pname;
pinfo.processAppSpec = &pfspec;
if ( GetProcessInformation(&psn, &pinfo) == noErr ) {
HASH_OBJECT(hash, pinfo);
HASH_UPDATE(hash, *pname + 1, (UINT8 *)pname);
HASH_OBJECT(hash, pfspec);
count += (sizeof(pinfo) + *pname + 1 + sizeof(pfspec)) / 8;
}
} while ( GetNextProcess(&psn) == noErr );
}
#if TARGET_API_MAC_CARBON
flattenInfos.count = &count;
flattenInfos.hash = hash;
window = GetWindowList();
while ( window && collection && coltraversal ) {
EmptyCollection(collection);
StoreWindowIntoCollection(window, collection);
FlattenCollection(collection, coltraversal, &flattenInfos);
window = GetNextWindow(window);
}
if(collection)
DisposeCollection(collection);
if(coltraversal)
DisposeCollectionFlattenUPP(coltraversal);
#else
window = (const WindowRecord *)LMGetWindowList();
while ( window ) {
HASH_OBJECT(hash, *window);
count += sizeof(WindowRecord) / 8;
window = window->nextWindow;
}
vcb = (const VCB *) GetVCBQHdr()->qHead;
while ( vcb ) {
HASH_OBJECT(hash, *vcb);
count += sizeof(VCB) / 8;
vcb = (const VCB *)vcb->qLink;
}
#endif
return count;
}
static unsigned
do_unix_random_fast(struct random_poll *s, struct hash_instance *hash)
{
CAST(unix_random, self, s);
unsigned count = 0;
#if HAVE_GETRUSAGE
{
struct rusage rusage;
if (getrusage(RUSAGE_SELF, &rusage) < 0)
fatal("do_unix_random_fast: getrusage() failed: (errno = %i) %z\n",
errno, STRERROR(errno));
HASH_OBJECT(hash, rusage);
count += 1;
}
#endif /* HAVE_GETRUSAGE */
#if HAVE_GETTIMEOFDAY
{
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0)
fatal("do_unix_random_fast: gettimeofday failed(errno = %i) %z\n",
errno, STRERROR(errno));
HASH_OBJECT(hash, tv);
}
#endif /* HAVE_GETTIMEOFDAY */
{
/* Fallback that is useful if nothing else works. Count the number
* of slow polls between time() ticks, and count one bit of
* entropy if we have more than 2 calls or more than two seconds
* between calls. */
time_t now = time(NULL);
unsigned long tick = GetUSecLow();
self->time_count++;
if (now != self->previous_time)
{
if ( (self->time_count > 2) || ((now - self->previous_time) > 2))
count++;
HASH_OBJECT(hash, now);
HASH_OBJECT(hash, tick);
HASH_OBJECT(hash, self->time_count);
self->time_count = 0;
self->previous_time = now;
}
}
return count;
}
static void do_unix_random_background(struct random_poll *s)
{
CAST(unix_random, self, s);
}
/* Using a NULL reaper argument is ok. It must be supplied only if the
* application is using a reaper, as that may get to our child process
* before we can waitpid it. */
struct random_poll *
make_unix_random(struct reap *reaper)
{
NEW(unix_random, self);
self->super.slow = do_unix_random_slow;
self->super.fast = do_unix_random_fast;
self->super.background = do_unix_random_background;
self->reaper = reaper;
self->status = POLL_NO_POLL;
self->previous_time = time(NULL);
self->time_count = 0;
return &self->super;
}

View File

@ -1,956 +0,0 @@
/* macosmain.c
*
*/
#include "lshprefix.h"
#include "lsh_context.h"
#include "format.h"
#include "io.h"
#include "tty.h"
#include "xalloc.h"
#include "werror.h"
#include <assert.h>
#include <console.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <SIOUX.h>
#include <unistd.h>
#include <sys/errno.h>
#include <stdarg.h>
#include <setjmp.h>
#include <termios.h>
#include <Events.h>
#include <Fonts.h>
#include <LowMem.h>
#include <OSUtils.h>
#include "PasswordDialog.h"
#include "MemPool.h"
// we need atEOF to re-enable stdin after ctrl-d
extern Boolean atEOF;
extern Boolean gSIOUXTerminalMode;
extern Boolean SIOUXQuitting;
Boolean gLogStdIO = 0;
extern int appl_main(int argc, char **argv);
extern char *applname;
extern char *defargstr;
extern void ssh2_init();
extern void close_all_files();
extern const struct exception *
write_raw(int fd, UINT32 length, const UINT8 *data);
const struct termios defaulttermios = {
0x00000300, /* c_iflag; input mode flags */
0x00000003, /* c_oflag; output mode flags */
0x00000b0d, /* c_cflag; control mode flags */
0x000005cf, /* c_lflag; local mode flags */
0, /* c_line; line discipline (== c_cc[19]) */
{
0x03,0x1c,0x7f,0x15,0x04,0x01,0x00,0x00,
0x00,0x00,0x17,0x12,0x1a,0x11,0x13,0x16,
0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
}, /* c_cc[NCCS]; control characters */
0, /* c_ispeed; input speed */
0 /* c_ospeed; output speed */
};
static char *envp[] = {
"HOME",
"LOGNAME",
"TERM"
};
static char *envv[] = {
"",
"",
"vt220"
};
static char *tabargv[128];
static char argstr[1024];
static char currentdir[1024];
pthread_key_t ssh2threadkey = NULL;
/*
* getenv
*/
char *getenv(const char *var)
{
int i;
for (i = 0; i < sizeof(envp) / sizeof(char *); i++) {
if (strcmp(var, envp[i]) == 0) {
return envv[i];
}
}
return NULL;
}
/*
* openlog
*/
void openlog(const char *id, int flags, int type)
{
}
#define BUF_SIZE 1024
/*
* syslog
*/
void syslog( int priority, const char *format, ...)
{
va_list args;
char string_buf[BUF_SIZE];
int len;
va_start(args, format);
len = vsnprintf(string_buf, BUF_SIZE - 2, format, args);
assert(len < BUF_SIZE - 1);
va_end(args);
if ( len > 0 ) {
#if TRACE_IT
// add CR if string is not finished
if (string_buf[len - 1] != '\r' && string_buf[len - 1] != '\n') {
string_buf[len++] = '\r';
}
plnt_putbuf(string_buf, len, 'TEXT', NULL, 0);
#else
string_buf[len++] = 0;
printf("%s", string_buf);
#endif
}
}
/*
* strerror
*/
char * strerror(int errnum)
{
static char errstr[64];
return(__strerror(errnum, errstr));
}
/*
* __strerror
*/
char * __strerror(int errnum, char * str)
{
switch (errnum)
{
//123456789_123456789_123456789_123456789_123456789_
case EPERM: strcpy(str, "Operation not permitted"); break;
case ENOENT: strcpy(str, "No such file or directory"); break;
case ESRCH: strcpy(str, "No such process"); break;
case EINTR: strcpy(str, "Interrupted system call"); break;
case EIO: strcpy(str, "Input/output error"); break;
case ENXIO: strcpy(str, "Device not configured"); break;
case E2BIG: strcpy(str, "Argument list too long"); break;
case ENOEXEC: strcpy(str, "Exec format error"); break;
case EBADF: strcpy(str, "Bad file descriptor"); break;
case ECHILD: strcpy(str, "No child processes"); break;
case EDEADLK: strcpy(str, "Resource deadlock avoided"); break;
/* 11 was EAGAIN */
case ENOMEM: strcpy(str, "Cannot allocate memory"); break;
case EACCES: strcpy(str, "Permission denied"); break;
case EFAULT: strcpy(str, "Bad address"); break;
case ECANCELED: strcpy(str, "Operation cancelled"); break;
case EBUSY: strcpy(str, "Device busy"); break;
case EEXIST: strcpy(str, "File exists"); break;
case EXDEV: strcpy(str, "Cross-device link"); break;
case ENODEV: strcpy(str, "Operation not supported by device"); break;
case ENOTDIR: strcpy(str, "Not a directory"); break;
case EISDIR: strcpy(str, "Is a directory"); break;
case EINVAL: strcpy(str, "Invalid argument"); break;
case ENFILE: strcpy(str, "Too many open files in system"); break;
case EMFILE: strcpy(str, "Too many open files"); break;
case ENOTTY: strcpy(str, "Inappropriate ioctl for device"); break;
case EFBIG: strcpy(str, "File too large"); break;
case ENOSPC: strcpy(str, "No space left on device"); break;
case ESPIPE: strcpy(str, "Illegal seek"); break;
case EROFS: strcpy(str, "Read-only file system"); break;
case EMLINK: strcpy(str, "Too many links"); break;
case EPIPE: strcpy(str, "Broken pipe"); break;
/* math software */
case EDOM: strcpy(str, "Numerical argument out of domain"); break;
case ERANGE: strcpy(str, "Result too large"); break;
/* non-blocking and interrupt i/o */
case EAGAIN: strcpy(str, "Resource temporarily unavailable"); break;
/*case EWOULDBLOCK: strcpy(str, "Operation would block"); break;*/
case EINPROGRESS: strcpy(str, "Operation now in progress"); break;
case EALREADY: strcpy(str, "Operation already in progress"); break;
/* ipc/network software -- argument errors */
case ENOTSOCK: strcpy(str, "Socket operation on non-socket"); break;
case EDESTADDRREQ: strcpy(str, "Destination address required"); break;
case EMSGSIZE: strcpy(str, "Message too long"); break;
case EPROTOTYPE: strcpy(str, "Protocol wrong type for socket"); break;
case ENOPROTOOPT: strcpy(str, "Protocol not available"); break;
case EPROTONOSUPPORT: strcpy(str, "Protocol not supported"); break;
case ESOCKTNOSUPPORT: strcpy(str, "Socket type not supported"); break;
case EOPNOTSUPP: strcpy(str, "Operation not supported"); break;
case EPFNOSUPPORT: strcpy(str, "Protocol family not supported"); break;
case EAFNOSUPPORT: strcpy(str, "Address family not supported by protocol family"); break;
case EADDRINUSE: strcpy(str, "Address already in use"); break;
case EADDRNOTAVAIL: strcpy(str, "Can't assign requested address"); break;
/* ipc/network software -- operational errors */
case ENETDOWN: strcpy(str, "Network is down"); break;
case ENETUNREACH: strcpy(str, "Network is unreachable"); break;
case ENETRESET: strcpy(str, "Network dropped connection on reset"); break;
case ECONNABORTED: strcpy(str, "Software caused connection abort"); break;
case ECONNRESET: strcpy(str, "Connection reset by peer"); break;
case ENOBUFS: strcpy(str, "No buffer space available"); break;
case EISCONN: strcpy(str, "Socket is already connected"); break;
case ENOTCONN: strcpy(str, "Socket is not connected"); break;
case ESHUTDOWN: strcpy(str, "Can't send after socket shutdown"); break;
case ETOOMANYREFS: strcpy(str, "Too many references: can't splice"); break;
case ETIMEDOUT: strcpy(str, "Operation timed out"); break;
case ECONNREFUSED: strcpy(str, "Connection refused"); break;
case ELOOP: strcpy(str, "Too many levels of symbolic links"); break;
case ENAMETOOLONG: strcpy(str, "File name too long"); break;
/* should be rearranged */
case EHOSTDOWN: strcpy(str, "Host is down"); break;
case EHOSTUNREACH: strcpy(str, "No route to host"); break;
case ENOTEMPTY: strcpy(str, "Directory not empty"); break;
case ENOLCK: strcpy(str, "No locks available"); break;
case ENOSYS: strcpy(str, "Function not implemented"); break;
#ifndef _POSIX_SOURCE
/*case ELAST: strcpy(str, "Must be equal largest errno"); break;*/
#endif /* _POSIX_SOURCE */
default: sprintf(str, "Unknown Error (%d)", errnum); break;
}
return(str);
}
/*
* __assertion_failed
*/
void __assertion_failed(char const *condition, char const *filename, int lineno)
{
fprintf(stderr, "Assertion (%s) failed in \"%s\" on line %d\n", condition, filename, lineno);
if ( pthread_getspecific(ssh2threadkey) ) {
abort();
} else {
#undef abort
abort();
#define abort macosabort
}
}
/*
* __msl_assertion_failed
*/
void __msl_assertion_failed(char const *condition, char const *filename, char const *funcname, int lineno)
{
fprintf(stderr, "Assertion (%s) failed in \"%s\" on line %d\n", condition, filename, lineno);
if ( pthread_getspecific(ssh2threadkey) ) {
abort();
} else {
#undef abort
abort();
#define abort macosabort
}
}
/*
* strsignal
*/
char * strsignal(int signo)
{
static char errstr[__max_errstr];
sprintf(errstr, "Signal no (%d)", signo);
}
/*
* get_context_listener
*/
int get_context_listener()
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context ) {
return context->_listener;
}
return -1;
}
/*
* getexitbuf
*/
void setexitbuf(jmp_buf *exitbuf)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context && context->_self == context ) {
context->_pexitbuf = exitbuf;
}
}
/*
* getexitbuf
*/
jmp_buf *getexitbuf()
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( context && context->_self == context ) {
return context->_pexitbuf;
}
return NULL;
}
/*
* exit
*/
void exit(int result UNUSED)
{
extern Boolean SIOUXQuitting;
jmp_buf *exitbuf;
fflush(stdout);
trace("*** exit ***\n");
fflush(stdout);
if ( !SIOUXQuitting && (exitbuf = getexitbuf()) != NULL ) {
longjmp( *exitbuf, 1 );
}
ExitToShell();
}
/*
* abort
*/
void abort(void)
{
/*
extern int __aborting;
raise(SIGABRT);
__aborting = 1;
*/
exit(EXIT_FAILURE);
}
/*
* random
*/
long random()
{
return rand();
}
#pragma mark -
void ssh2_sched()
{
sched_yield();
}
#pragma mark -
#undef malloc
#undef calloc
#undef realloc
#undef free
extern void *malloc(unsigned long size);
extern void *calloc(unsigned long items, unsigned long size);
extern void *realloc(void *addr, unsigned long size);
extern void free(void *addr);
/*
* lshmalloc
*/
void *lshmalloc(unsigned long size)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context && context->_gMemPool ) {
return MPmalloc(context->_gMemPool, size);
} else {
return malloc(size);
}
}
/*
* lshcalloc
*/
void *lshcalloc(unsigned long items, unsigned long size)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context && context->_gMemPool ) {
size_t tsize;
void *p;
assert(context->_self == context);
tsize = items * size;
p = MPmalloc( context->_gMemPool, tsize );
if ( p ) {
memset(p, '\0', tsize);
}
return p;
} else {
return calloc(items, size);
}
return NULL;
}
/*
* lshrealloc
*/
void *lshrealloc(void *addr, unsigned long size)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context && context->_gMemPool ) {
size_t orig_size;
void* p;
if (addr == 0)
return MPmalloc(context->_gMemPool, size);
orig_size = MPsize(context->_gMemPool, addr);
p = MPmalloc(context->_gMemPool, size);
orig_size = orig_size < size ? orig_size : size;
memcpy(p, addr, orig_size);
MPfree(context->_gMemPool, addr);
return p;
} else {
return realloc(addr, size);
}
return NULL;
}
/*
* lshfree
*/
void lshfree(void *addr)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context && context->_gMemPool ) {
MPfree(context->_gMemPool, addr);
} else {
free(addr);
}
}
#pragma mark -
/*
* we need to track open()/close()/socket() calls to close files/sockets
* upon abort/exit
*/
void add_one_file(int fd)
{
if ( fd != -1 ) {
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context ) {
int i;
for (i = 0; i < MAXFILESCOUNT; i++) {
if (context->_filesTable[i] == -1) {
context->_filesTable[i] = fd;
break;
}
}
}
}
}
void remove_one_file(int fd)
{
if ( fd != -1 ) {
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context ) {
int i;
for (i = 0; i < MAXFILESCOUNT; i++) {
if (context->_filesTable[i] == fd) {
context->_filesTable[i] = -1;
break;
}
}
}
}
}
void close_all_files()
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if ( context ) {
int i;
for (i = 0; i < MAXFILESCOUNT; i++) {
if (context->_filesTable[i] != -1) {
close(context->_filesTable[i]);
}
}
}
}
#pragma mark -
/*
* my PLstrcpy
*/
pascal StringPtr PLstrcpy(StringPtr d, ConstStr255Param s)
{
int size;
size = s[0] + 1;
while (size--) {
d[size] = s[size];
}
return d;
}
/*
* my PLstrrchr in CWPro6 (last MPTP release) crashes in 68k ???
*/
pascal Ptr PLstrrchr(ConstStr255Param s, short c)
{
int size;
size = s[0];
while ( size > 0 ) {
if ( s[size] == (unsigned char)c ) {
return (char *)s + size;
}
size--;
}
return NULL;
}
#pragma mark -
/*
* InstallTTY
*/
int InstallTTY(int id, void *context)
{
#pragma unused (id, context)
return 0;
}
/*
* RemoveTTY
*/
void RemoveTTY(int id, void *context)
{
#pragma unused (id, context)
}
/*
* WriteCharsToTTY
*/
int WriteCharsToTTY(int id, void *context, char *buffer, int n)
{
#pragma unused (id, context)
return WriteCharsToConsole(buffer, n);
}
/*
* ReadCharsFromTTY
*/
int ReadCharsFromTTY(int id, void *context, char *buffer, int n)
{
#pragma unused (id, context)
return ReadCharsFromConsole(buffer, n);
}
/*
* AvailableFromTTY
*/
int AvailableFromTTY(int id, void *context)
{
#pragma unused (id, context)
extern short gSIOUXBufSize;
if ( !gSIOUXBufSize ) {
QHdrPtr eventQueue = LMGetEventQueue();
EvQElPtr element = (EvQElPtr)eventQueue->qHead;
// now, count the number of pending keyDown events.
while (element != nil) {
if (element->evtQWhat == keyDown || element->evtQWhat == autoKey)
return true;
element = (EvQElPtr)element->qLink;
}
return false;
}
return true;
}
#pragma mark -
/*
* tty_getwinsize : replaces tty_getwinsize from liblsh
*/
int
tty_getwinsize(int fd, struct terminal_dimensions *dims)
{
FontInfo info;
dims->char_width = SIOUXSettings.columns;
dims->char_height = SIOUXSettings.rows;
dims->pixel_width = 0;
dims->pixel_height = 0;
/*
if (!FetchFontInfo(SIOUXSettings.fontid,SIOUXSettings.fontsize,SIOUXSettings.fontface, &info)) {
dims->pixel_width = info.widMax;
dims->pixel_height = info.ascent + info.descent;
} else {
// just guess...
dims->pixel_width = 12;
dims->pixel_height = 16;
}
*/
return 1;
}
/*
* tcgetattr : replaces tty_getattr from liblsh
*/
int
tcgetattr(int fd, struct termios *ios)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if (context) {
memcpy(ios, &context->_mactermios, sizeof(struct termios));
}
return 1;
}
/*
* tcsetattr : replaces tty_setattr from liblsh
*/
int
tcsetattr(int fd, int optional_actions, const struct termios *ios)
{
lshcontext *context = pthread_getspecific(ssh2threadkey);
if (context) {
memcpy(&context->_mactermios, ios, sizeof(struct termios));
}
return 1;
}
/*
* getpass
*/
char *getpass( const char *prompt )
{
Str255 pprompt;
Str255 ppassword;
static char password[128];
pprompt[0] = strlen(prompt);
memcpy(pprompt + 1, prompt, pprompt[0]);
ppassword[0] = 0;
InternalBufferDialog(pprompt, ppassword);
memcpy(password, ppassword + 1, ppassword[0]);
password[ppassword[0]] = '\0';
}
/*
* yes_or_no
*/
int yes_or_no(const struct lsh_string *s, int def, int free)
{
if (!quiet_flag) {
const char *prompt = lsh_get_cstring(s);
if (prompt) {
Str255 pprompt;
int i;
pprompt[0] = strlen(prompt);
memcpy(pprompt + 1, prompt, pprompt[0]);
for (i = 1; i <= pprompt[0]; i++) {
if (pprompt[i] == 0x0a) {
pprompt[i] = 0x0d;
}
}
def = YesNoDialog( pprompt );
}
}
return def;
}
#pragma mark -
/*
* make_args
*/
void make_args( char *argstr, int *argc, char ***argv )
{
int i = 0;
int j = 0;
int quoted1 = 0;
int quoted2 = 0;
tabargv[i++] = argstr;
#define SEPARATOR(x) ((x) == ' ' || (x) == '\t' || (x) == 10 || (x) == 13 || (x) == 0)
#define QUOTE1(x) ((x) == '"')
#define QUOTE2(x) ((x) == '\'')
while (argstr[j]) {
if (!quoted1 && !quoted2 && SEPARATOR(argstr[j])) {
argstr[j++] = 0;
if (!SEPARATOR(argstr[j])) {
tabargv[i++] = argstr + j;
}
} else if (!quoted2 && QUOTE1(argstr[j])) {
strcpy(argstr + j, argstr + j + 1);
if (!QUOTE1(argstr[j]))
quoted1 = !quoted1;
else
j++;
} else if (!quoted1 && QUOTE2(argstr[j])) {
strcpy(argstr + j, argstr + j + 1);
if (!QUOTE2(argstr[j]))
quoted2 = !quoted2;
else
j++;
} else {
j++;
}
}
#undef SEPARATOR
#undef QUOTE
tabargv[i] = NULL;
*argc = i;
*argv = tabargv;
getcwd(currentdir, 1024); // set home pathname
}
/*
* run_app
*/
static void run_app()
{
lshcontext *context;
jmp_buf exitbuf;
extern Boolean SIOUXQuitting;
char moreargs[1024];
char *pmoreargs;
int argc;
char **argv;
OSErr err;
context = (lshcontext *)NewPtr(sizeof(lshcontext));
if (context == NULL) {
printf("### main_thread, NewPtr lshcontext failed\n");
return;
}
if (pthread_setspecific(ssh2threadkey, context)) {
printf("### main_thread, pthread_setspecific failed\n");
DisposePtr((Ptr)context);
return;
}
/* allocate memory pool */
err = MPInit(65564, &context->_gMemPool, NULL);
if (err != noErr) {
printf("### main_thread, MPInit failed\n");
DisposePtr((Ptr)context);
return;
}
context->_port = -1;
context->_userdata = NULL;
context->_thread = pthread_self();
context->_forward = 0;
context->_localport = 0;
context->_listener = -1;
context->_socket = -1;
//context->_exitbuf = 0;
//context->_gMemPool = NULL;
memset(context->_filesTable, 0xff, sizeof(context->_filesTable));
memcpy(&context->_mactermios, &defaulttermios, sizeof(struct termios));
context->_gConsoleInEOF = 0;
context->_convertLFs = 0;
context->_stripCRs = 0;
context->_lastCR = 0;
context->_insock = NULL;
context->_gConsoleInBufLen = 0;
context->_gConsoleInBufMax = CONSOLEBUFSIZE;
context->_gConsoleOutBufLen = 0;
context->_gConsoleOutBufMax = CONSOLEBUFSIZE;
context->_all_objects = NULL;
context->_number_of_objects = 0;
context->_number_of_strings = 0;
context->_live_objects = 0;
context->_quiet_flag = 0;
context->_verbose_flag = 0;
context->_trace_flag = 0;
context->_debug_flag = 0;
context->_error_fd = STDERR_FILENO;
context->_error_pos = 0;
context->_error_write = write_raw;
context->_tracing = 0;
context->_verbosing = 0;
context->_debugging = 0;
context->_window_changed = 0;
context->_kpassword[0] = 0;
context->_kindex = 0;
context->_self = context;
context->_pexitbuf = &exitbuf;
if (!setjmp(&exitbuf)) {
printf("\n\nlsh shell application\nargs (--help for info): ");
fflush(stdout);
strcpy(argstr, applname);
strcat(argstr, " ");
atEOF = false;
gSIOUXTerminalMode = false;
fgets(moreargs, sizeof(moreargs), stdin);
gSIOUXTerminalMode = true;
moreargs[strlen(moreargs) - 1] = '\0';
pmoreargs = moreargs;
if ( moreargs[0] == '+' || !moreargs[0] ) {
strcat(argstr, defargstr);
if ( moreargs[0] ) {
strcat(argstr, " ");
pmoreargs++;
}
}
strcat(argstr, pmoreargs);
make_args( argstr, &argc, &argv );
//set_error_syslog(applname);
appl_main(argc, argv);
}
close_all_files();
MPDispose(context->_gMemPool);
DisposePtr((Ptr)context);
}
/*
* main_thread
*/
void *main_thread()
{
while (!SIOUXQuitting) {
run_app();
}
}
void KeyDestructor(void *)
{
}
/*
* main
*/
int main()
{
char moreargs[1024];
char *pmoreargs;
int argc;
char **argv;
pthread_attr_t attr;
pthread_t mainthread;
#if TARGET_CPU_68K
SetApplLimit(GetApplLimit() - 128000); /* We need more stack */
MaxApplZone();
#endif
SIOUXSettings.autocloseonquit = 1;
SIOUXSettings.asktosaveonclose = 0;
SIOUXSettings.showstatusline = 1;
SIOUXSettings.columns = 80;
SIOUXSettings.rows = 48;
SIOUXSettings.toppixel = 50;
SIOUXSettings.leftpixel = 20;
SIOUXSettings.tabspaces = 8;
srand(time(NULL));
ssh2_init();
#if 1
// need to flush stdout to open the window from the main thread
printf("\n");
fflush(stdout);
if (pthread_attr_init(&attr)) {
printf("### main, pthread_attr_init failed\n");
return 2;
}
if (pthread_key_create(&ssh2threadkey, KeyDestructor)) {
printf("### main, pthread_key_create failed\n");
return 2;
}
if (pthread_attr_setstacksize(&attr, 64*1024)) {
printf("### main, pthread_attr_setstacksize failed\n");
return 2;
}
if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)) {
printf("### main, pthread_attr_setdetachstate failed\n");
return 2;
}
if (pthread_create(&mainthread, &attr, (GUSIPThreadProc)main_thread, NULL)) {
printf("### main, pthread_create failed\n");
return 2;
}
pthread_attr_destroy(&attr);
while (!SIOUXQuitting) {
sched_yield();
}
#else
while (!SIOUXQuitting) {
run_app();
}
#endif
return 0;
}

View File

@ -1,177 +0,0 @@
/* Metrowerks Standard Library */
/*
* strcase.c
*
*
* Routines
* --------
* strcasecmp
* strncasecmp
*
*
*/
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#pragma ANSI_strict off
int strcasecmp(const char * str1, const char * str2)
{
#if !__POWERPC__ && !__MIPS__
const unsigned char * p1 = (unsigned char *) str1;
const unsigned char * p2 = (unsigned char *) str2;
unsigned char c1, c2;
while (toupper((c1 = *p1++)) == toupper((c2 = *p2++)))
if (!c1)
return(0);
return(toupper(c1) - toupper(c2));
#elif __PPC_EABI__ || __MIPS__
/*
* strcmp routine designed to minimized the number of
* loads and stores. We make sure that all the loads and
* stores are properly aligned.
*
*/
register unsigned char *left = (unsigned char *)str1;
register unsigned char *right = (unsigned char *)str2;
unsigned int k1, k2, align, l1, r1, x;
/* Check the simple case of the first byte being different. */
l1 = toupper(*left);
r1 = toupper(*right);
if (l1 - r1) {
return (l1 - r1);
}
/*
* If either the destination or the source are not
* aligned on the same boundary, we do a byte copy.
* Otherwise we align them to a word boundary.
*/
if ((align = ((int)left & 3)) != ((int)right & 3)) {
goto bytecopy;
}
if (align) {
/* Continuation of test of first byte. */
if (l1 == 0) {
return (0);
}
for (align = 3 - align; align; align--) {
l1 = toupper(*(++left));
r1 = toupper(*(++right));
if (l1 - r1) {
return (l1 - r1);
}
if (l1 == 0) {
return (0);
}
}
left++;
right++;
}
/* Strings are word aligned */
k1 = K1;
k2 = K2;
<<IzNoGood>>
/* Load a word from each string. */
l1 = *(int*)left;
r1 = *(int*)right;
/* See comments in strcpy function. */
x = l1 + k2;
if (x & k1) {
goto adjust;
}
while(l1 == r1) {
/* Load a word and increment strings. */
l1 = *(++((int*)(left)));
r1 = *(++((int*)(right)));
x = l1 + k2;
if (x & k1) {
goto adjust;
}
}
/* l1 and r1 are not equal. */
if (l1 > r1)
return (1);
return (-1);
adjust:
l1 = *left;
r1 = *right;
if (l1 - r1) {
return (l1 - r1);
}
bytecopy:
if (l1 == 0) {
return (0);
}
do {
l1 = toupper(*(++left));
r1 = toupper(*(++right));
if (l1 - r1) {
return (l1 - r1);
}
if (l1 == 0) {
return (0);
}
} while (1);
#else
const unsigned char * p1 = (unsigned char *) str1 - 1;
const unsigned char * p2 = (unsigned char *) str2 - 1;
unsigned long c1, c2;
while (toupper(c1 = *++p1) == toupper(c2 = *++p2))
if (!c1)
return(0);
return(toupper(c1) - toupper(c2));
#endif
}
#pragma ANSI_strict reset
int strncasecmp(const char * str1, const char * str2, size_t n)
{
#if !__POWERPC__
const unsigned char * p1 = (unsigned char *) str1;
const unsigned char * p2 = (unsigned char *) str2;
unsigned char c1, c2;
n++;
while (--n)
if (toupper(c1 = *p1++) != toupper(c2 = *p2++))
return(toupper(c1) - toupper(c2));
else if (!c1)
break;
#else
const unsigned char * p1 = (unsigned char *) str1 - 1;
const unsigned char * p2 = (unsigned char *) str2 - 1;
unsigned long c1, c2;
n++;
while (--n)
if (toupper(c1 = *++p1) != toupper(c2 = *++p2))
return(toupper(c1) - toupper(c2));
else if (!c1)
break;
#endif
return(0);
}

View File

@ -1,759 +0,0 @@
/* werror.c
*
*
*
* $Id$ */
/* lsh, an implementation of the ssh protocol
*
* Copyright (C) 1998 Niels Möller
*
* 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
*/
#include "lshprefix.h"
#include "lsh_context.h"
#include "werror.h"
#include "charset.h"
/* For format_size_in_decimal */
#include "format.h"
#include "gc.h"
#include "io.h"
#include "parse.h"
#include "xalloc.h"
#include <assert.h>
#include <ctype.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#if HAVE_SYSLOG_H
#include <syslog.h>
#endif
#ifdef MACOS
extern void abort();
#if !HAVE_SYSLOG_H
extern void openlog( const char *id, int flags, int type );
extern void syslog( int priority, const char *format, ... );
#define LOG_NOTICE 1
#define LOG_PID 1
#define LOG_CONS 2
#define LOG_DAEMON 1
#endif
#endif
/* Global flags */
#ifndef MACOS
int trace_flag = 0;
int debug_flag = 0;
int quiet_flag = 0;
int verbose_flag = 0;
int syslog_flag = 0;
#else
extern Boolean gLogStdIO;
#endif
static const char *program_name = NULL;
#define WERROR_TRACE -1
#define WERROR_DEBUG -2
#define WERROR_LOG -3
static const struct argp_option
werror_options[] =
{
{ "quiet", 'q', NULL, 0, "Suppress all warnings and diagnostic messages", 0 },
{ "verbose", 'v', NULL, 0, "Verbose diagnostic messages", 0},
{ "trace", WERROR_TRACE, NULL, 0, "Detailed trace", 0 },
{ "debug", WERROR_DEBUG, NULL, 0, "Print huge amounts of debug information", 0 },
{ "log-file", WERROR_LOG, "File name", 0,
"Append messages to this file.", 0},
{ NULL, 0, NULL, 0, NULL, 0 }
};
static error_t
werror_argp_parser(int key, char *arg,
struct argp_state *state)
{
switch(key)
{
default:
return ARGP_ERR_UNKNOWN;
case ARGP_KEY_END:
case ARGP_KEY_INIT:
program_name = state->name;
break;
case 'q':
quiet_flag = 1;
break;
case 'v':
verbose_flag = 1;
break;
case WERROR_TRACE:
trace_flag = 1;
break;
case WERROR_DEBUG:
debug_flag = 1;
break;
case WERROR_LOG:
{
/* FIXME: For clients, this is right: We only get lsh-related
* messages to the log file, and child processes are not
* affected. But for the server, perhaps we should also dup
* the logfile over stderr? */
int fd = open(arg, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd < 0)
argp_error(state, "Failed to open log file `%s'.", arg);
else
set_error_stream(fd);
}
}
return 0;
}
const struct argp werror_argp =
{
werror_options,
werror_argp_parser,
NULL, NULL, NULL, NULL, NULL
};
#ifndef MACOS
static int error_fd = STDERR_FILENO;
#define BUF_SIZE 500
static UINT8 error_buffer[BUF_SIZE];
static UINT32 error_pos = 0;
static const struct exception *
(*error_write)(int fd, UINT32 length, const UINT8 *data) = write_raw;
#else
#define BUF_SIZE ERROR_BUF_SIZE
#endif
#if HAVE_SYSLOG
static const struct exception *
write_syslog(int fd UNUSED, UINT32 length, const UINT8 *data)
{
struct lsh_string *s;
/* Data must not contain any NUL:s */
assert(!memchr(data, '\0', length));
/* NUL-terminate the string. */
s = ssh_format("%ls", length, data);
/* FIXME: Should we use different log levels for werror, verbose and
* debug? */
syslog(LOG_NOTICE, "%s", lsh_get_cstring(s));
lsh_string_free(s);
return NULL;
}
/* FIXME: Delete argument and use program_name. */
void
set_error_syslog(const char *id)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
openlog(id, LOG_PID | LOG_CONS, LOG_DAEMON);
error_write = write_syslog;
error_fd = -1;
}
#endif /* HAVE_SYSLOG */
static const struct exception *
write_ignore(int fd UNUSED,
UINT32 length UNUSED, const UINT8 *data UNUSED)
{ return NULL; }
void
set_error_stream(int fd)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
error_fd = fd;
error_write = write_raw;
}
void
set_error_nonblocking(int fd)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (error_fd == fd)
error_write = write_raw_with_poll;
}
int
dup_error_stream(void)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return -1;
}
if (error_fd < 0)
/* We're not writing error messages on any file; there's no
* problem. */
return 1;
else
{
int fd = dup(error_fd);
/* This function is used to get stderr away from the stdio fd
* range. In the unlikely event that dup returns an fd <=
* STDERR_FILENO, we treat that as an error. */
if (fd > STDERR_FILENO)
{
io_set_close_on_exec(fd);
error_fd = fd;
return 1;
}
if (fd >= 0)
close(fd);
return 0;
}
}
void
set_error_ignore(void)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
context->_error_write = write_ignore;
context->_error_fd = -1;
}
/*#define WERROR(c, l, d) (c->_error_write(c->_error_fd, (l), (d)))*/
static void
WERROR(lshcontext *context, int l, const UINT8 *d)
{
int oldConvertLFs = context->_convertLFs;
if (gLogStdIO || (!context->_tracing && !context->_verbosing && !context->_debugging))
context->_convertLFs = true;
context->_error_write(context->_error_fd, l, d);
if (gLogStdIO || (!context->_tracing && !context->_verbosing && !context->_debugging))
context->_convertLFs = oldConvertLFs;
}
static void
werror_flush(void)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_error_pos)
{
WERROR(context, context->_error_pos, context->_error_buffer);
context->_error_pos = 0;
}
}
static void
werror_putc(UINT8 c)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_error_pos == BUF_SIZE)
werror_flush();
context->_error_buffer[context->_error_pos++] = c;
}
static void
werror_write(UINT32 length, const UINT8 *msg)
{
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_error_pos + length <= BUF_SIZE)
{
memcpy(context->_error_buffer + context->_error_pos, msg, length);
context->_error_pos += length;
}
else
{
werror_flush();
WERROR(context, length, msg);
}
}
static void
werror_cstring(char *s) { werror_write(strlen(s), (const unsigned char *)s); }
static void
werror_bignum(mpz_t n, int base)
{
#if ALLOCA_68K_BUG
ALLOCA_START(alloca_ref);
#endif
char *s = alloca(mpz_sizeinbase(n, base) + 2);
mpz_get_str(s, 16, n);
werror_cstring(s);
#if ALLOCA_68K_BUG
ALLOCA_FREE(alloca_ref);
#endif
}
static void
werror_decimal(UINT32 n)
{
#if ALLOCA_68K_BUG
ALLOCA_START(alloca_ref);
#endif
unsigned length = format_size_in_decimal(n);
UINT8 *buffer = alloca(length);
format_decimal(length, buffer, n);
werror_write(length, buffer);
#if ALLOCA_68K_BUG
ALLOCA_FREE(alloca_ref);
#endif
}
static unsigned format_size_in_hex(UINT32 n);
static void
werror_hex_digit(unsigned digit)
{
werror_putc("0123456789abcdef"[digit]);
}
static void
werror_hex_putc(UINT8 c)
{
werror_hex_digit(c / 16);
werror_hex_digit(c % 16);
}
static void
werror_hex(UINT32 n)
{
unsigned left = 8;
while ( (left > 1)
&& !(n & 0xf0000000UL))
{
left --;
n <<= 4;
}
while (left--)
{
werror_hex_digit((n >> 28) & 0xf);
n <<= 4;
}
}
static void
werror_hexdump(UINT32 length, UINT8 *data)
{
UINT32 i = 0;
werror("(size %i = 0x%xi)\n", length, length);
for (i = 0; i<length; i+= 16)
{
unsigned j = format_size_in_hex(i);
unsigned r = length - i;
for ( ; j < 8; j++)
werror_putc('0');
werror_hex(i);
werror_cstring(": ");
if (r > 16)
r = 16;
for (j = 0; j<r; j++)
werror_hex_putc(data[i+j]);
for (; j<17; j++)
werror_cstring(" ");
for (j = 0; j<r; j++)
{
UINT8 c = data[i+j];
if ( (c < 32) || (c > 126) )
c = '.';
werror_putc(c);
}
werror_cstring("\n");
}
}
static void
werror_paranoia_putc(UINT8 c)
{
switch (c)
{
case '\\':
werror_cstring("\\\\");
break;
case '\r':
/* Ignore */
break;
default:
if (!isprint(c))
{
werror_putc('\\');
werror_hex_putc(c);
break;
}
/* Fall through */
case '\n':
werror_putc(c);
break;
}
}
void
werror_vformat(const char *f, va_list args)
{
if (program_name)
{
werror_write(strlen(program_name), program_name);
werror_write(2, ": ");
}
while (*f)
{
if (*f == '%')
{
int do_hex = 0;
int do_free = 0;
int do_paranoia = 0;
int do_utf8 = 0;
while (*++f)
switch (*f)
{
case 'x':
do_hex = 1;
break;
case 'f':
do_free = 1;
break;
case 'p':
do_paranoia = 1;
break;
case 'u':
do_utf8 = 1;
break;
default:
goto end_options;
}
end_options:
switch(*f++)
{
case '%':
werror_putc(*f);
break;
case 'i':
(do_hex ? werror_hex : werror_decimal)(va_arg(args, UINT32));
break;
case 'c':
(do_paranoia ? werror_paranoia_putc : werror_putc)(va_arg(args, int));
break;
case 'n':
werror_bignum(va_arg(args, MP_INT *), do_hex ? 16 : 10);
break;
case 'a':
{
int atom = va_arg(args, int);
assert(atom);
werror_write(get_atom_length(atom), get_atom_name(atom));
break;
}
case 's':
{
UINT32 length = va_arg(args, UINT32);
UINT8 *s = va_arg(args, UINT8 *);
struct lsh_string *u = NULL;
if (do_utf8 && !local_is_utf8())
{
u = low_utf8_to_local(length, s, 0);
if (!u)
{
werror_cstring("<Invalid utf-8 string>");
break;
}
length = u->length;
s = u->data;
}
if (do_hex)
{
assert(!do_paranoia);
werror_hexdump(length, s);
}
else if (do_paranoia)
{
UINT32 i;
for (i=0; i<length; i++)
werror_paranoia_putc(*s++);
}
else
werror_write(length, s);
if (u)
lsh_string_free(u);
}
break;
case 'S':
{
struct lsh_string *s = va_arg(args, struct lsh_string *);
if (do_utf8)
{
s = utf8_to_local(s, 0, do_free);
if (!s)
{
werror_cstring("<Invalid utf-8 string>");
break;
}
do_free = 1;
}
if (do_hex)
{
assert(!do_paranoia);
werror_hexdump(s->length, s->data);
}
else if (do_paranoia)
{
UINT32 i;
for (i=0; i<s->length; i++)
werror_paranoia_putc(s->data[i]);
}
else
werror_write(s->length, s->data);
if (do_free)
lsh_string_free(s);
break;
}
case 't':
{
struct lsh_object *o = va_arg(args, struct lsh_object *);
const char *type;
if (!o)
type = "<NULL>";
else if (o->isa)
type = o->isa->name;
else
type = "<STATIC>";
werror_write(strlen(type), type);
break;
}
case 'z':
{
char *s = va_arg(args, char *);
if (do_hex)
werror_hexdump(strlen(s), s);
else if (do_paranoia)
while (*s)
werror_paranoia_putc(*s++);
else
werror_write(strlen(s), s);
break;
}
default:
fatal("werror_vformat: bad format string!\n");
break;
}
}
else
werror_putc(*f++);
}
}
void
werror(const char *format, ...)
{
va_list args;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
/* It is somewhat reasonable to use both -q and -v. In this case
* werror()-messages should be displayed. */
if (context->_verbose_flag || !context->_quiet_flag)
{
if (gLogStdIO || (!context->_tracing && !context->_verbosing && !context->_debugging)) {
if (!gLogStdIO) {
werror_flush();
set_error_stream(STDERR_FILENO);
}
}
va_start(args, format);
werror_vformat(format, args);
va_end(args);
werror_flush();
if (gLogStdIO || (!context->_tracing && !context->_verbosing && !context->_debugging)) {
if (!gLogStdIO) {
set_error_syslog("lsh");
}
}
}
}
void
trace(const char *format, ...)
{
va_list args;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_trace_flag)
{
werror_flush();
context->_tracing = true;
va_start(args, format);
werror_vformat(format, args);
va_end(args);
werror_flush();
context->_tracing = false;
}
}
void
debug(const char *format, ...)
{
va_list args;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_debug_flag)
{
werror_flush();
context->_debugging = true;
va_start(args, format);
werror_vformat(format, args);
va_end(args);
werror_flush();
context->_debugging = false;
}
}
void
verbose(const char *format, ...)
{
va_list args;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if ( !context ) {
return;
}
if (context->_verbose_flag)
{
werror_flush();
context->_verbosing = true;
va_start(args, format);
werror_vformat(format, args);
va_end(args);
werror_flush();
context->_verbosing = false;
}
}
void
fatal(const char *format, ...)
{
va_list args;
lshcontext *context = (lshcontext *)pthread_getspecific(ssh2threadkey);
if (context)
{
werror_flush();
set_error_stream(STDERR_FILENO);
va_start(args, format);
werror_vformat(format, args);
va_end(args);
werror_flush();
set_error_syslog("lsh");
}
abort();
}
static unsigned
format_size_in_hex(UINT32 n)
{
int i;
int e;
/* Table of 16^(2^n) */
static const UINT32 powers[] = { 0x10UL, 0x100UL, 0x10000UL };
#define SIZE (sizeof(powers) / sizeof(powers[0]))
/* Determine the smallest e such that n < 16^e */
for (i = SIZE - 1 , e = 0; i >= 0; i--)
{
if (n >= powers[i])
{
e += 1UL << i;
n /= powers[i];
}
}
#undef SIZE
return e+1;
}

View File

@ -1,49 +0,0 @@
## Automatically generated by make_am, Wed Aug 29 23:52:04 CEST 2001
## Process this file with automake to produce Makefile.in
SUBDIRS = src doc misc contrib
AUTOMAKE_OPTIONS = foreign
# We must run make the .dist_classes and various .dist_headers after
# recompiling, but before making a dist, as they uses dependency information to
# figure out which header files should be included in the dist.
DOTDISTS = src/.dist_classes src/.dist_headers
MAKEFILESAM = Makefile.am doc/Makefile.am src/Makefile.am \
src/scm/Makefile.am
# FIXME: Use the BASH variable to execute the script. The problem is
# that the script attempts to start itselt with "$0 args".
$(MAKEFILESAM): $(addsuffix .in,$(MAKEFILESAM))
(cd $(srcdir) && BASH=$(BASH) \
SELF="$(BASH) ./make_am" $(BASH) ./make_am)
$(DOTDISTS): depend
(cd $(srcdir) && BASH=$(BASH) \
SELF="$(BASH) ./make_am" $(BASH) ./make_am --rethink)
.PHONY: dotdists
dotdists: $(DOTDISTS)
.PHONY: bootstrap
bootstrap:
(cd src && $(MAKE) bootstrap)
# FIXME: Have to figure out how to create dependency files recursively.
# dist-hook: $(DOTDISTS)
MAINTAINERCLEANFILES += aclocal.m4 configure \
config.status config.log config.cache \
$(DOTDISTS) $(MAKEFILESAM)
# Is this rule needed?
all-recursive check-recursive: config.h
EXTRA_DIST = ANNOUNCE AUTHORS FAQ README COPYING ChangeLog ChangeLog.1 NEWS FAQ \
Makefile.am.in make_am distribution-key.gpg
include $(top_srcdir)/misc/ctags.mk

Binary file not shown.

View File

@ -1,425 +0,0 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# ctags support. Automake only supports etags. We base our ctags support on
# automake's etags support.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
BASH = @BASH@
CC = @CC@
GROFF = @GROFF@
KRB_LIBS = @KRB_LIBS@
KRB_PROGRAM = @KRB_PROGRAM@
LIBARGP = @LIBARGP@
M4 = @M4@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SCHEME_NAME = @SCHEME_NAME@
SCHEME_PROGRAM = @SCHEME_PROGRAM@
SRP_PROGRAM = @SRP_PROGRAM@
VERSION = @VERSION@
SUBDIRS = src doc misc contrib
AUTOMAKE_OPTIONS = foreign
# We must run make the .dist_classes and various .dist_headers after
# recompiling, but before making a dist, as they uses dependency information to
# figure out which header files should be included in the dist.
DOTDISTS = src/.dist_classes src/.dist_headers
MAKEFILESAM = Makefile.am doc/Makefile.am src/Makefile.am src/scm/Makefile.am
# FIXME: Have to figure out how to create dependency files recursively.
# dist-hook: $(DOTDISTS)
MAINTAINERCLEANFILES = aclocal.m4 configure config.status config.log config.cache $(DOTDISTS) $(MAKEFILESAM)
EXTRA_DIST = ANNOUNCE AUTHORS FAQ README COPYING ChangeLog ChangeLog.1 NEWS FAQ Makefile.am.in make_am distribution-key.gpg
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog Makefile.am \
Makefile.in NEWS acconfig.h acinclude.m4 aclocal.m4 config.h.in \
configure configure.in install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/misc/ctags.mk
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
install-data-recursive uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# FIXME: Use the BASH variable to execute the script. The problem is
# that the script attempts to start itselt with "$0 args".
$(MAKEFILESAM): $(addsuffix .in,$(MAKEFILESAM))
(cd $(srcdir) && BASH=$(BASH) \
SELF="$(BASH) ./make_am" $(BASH) ./make_am)
$(DOTDISTS): depend
(cd $(srcdir) && BASH=$(BASH) \
SELF="$(BASH) ./make_am" $(BASH) ./make_am --rethink)
.PHONY: dotdists
dotdists: $(DOTDISTS)
.PHONY: bootstrap
bootstrap:
(cd src && $(MAKE) bootstrap)
# Is this rule needed?
all-recursive check-recursive: config.h
.PHONY: ctags-recursive ctags
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) ctags); \
done
ctags: ctags-recursive $(HEADERS) $(SOURCES) $(CONFIG_HEADER) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/tags && tags="$$tags $$here/$$subdir/tags"; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$(CONFIG_HEADER)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && ctags --langmap=c:.c.x -o $$here/tags $(CTAGS_ARGS) $$tags $(CONFIG_HEADER) $$unique $(LISP))
# This treats .h.x files as C files rather than headers, but we can't
# distinguish them from .c.x files with ctags.
# Override the standard distclean-tags target, as this doesn't support `tags'
distclean-tags:
-rm -f TAGS ID tags
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

655
lsh/NEWS
View File

@ -1,655 +0,0 @@
News for the 1.3.3 release:
Server suport for subsystems, and a new experimental command
line option --subsystems for lshd. An sftp-server included in
the dist, but it's mostly untested.
Better messages when the initial handshake fails.
Support for AES (formely known only as rijndael).
Simplified the internal command definition machinery.
Fixed bug in lshg; it crashed if given a host name argument
with strange characters.
Updates to SRP support, to get it closer to the latest draft.
New client option -B, which is like -N but also puts the
process in the background.
News for the 1.3.2 release:
Suspend works better, and is bound to the escape sequence
RET ~ ^Z.
News for the 1.3.1 release:
Repackaged the low-level crypto functions as the "nettle"
library. Bugfixes for serpent.
News for the 1.3.0 release:
Bugfixes (same as in 1.2.2).
constness fixes.
Deleted the complex streamed sexp-parser.
Verbose messages at KEXINIT and NEWKEYS.
Tolerate empty atoms (like in "3des-cbs,,aes256-cbc,").
If compiled with --debug-alloc, all strings are counted and
leaks detected. Fixed some minor leaks.
Changed conventions for packet handlers, all packets are freed
by connection_handle_packet, so individual packet handlers
shouldn't do that.
Handle the TSTP signal. Backgrounding still doesn't work quite
right, though.
Rewrote parts of the gaba.scm preprocessor.
News for the 1.2.0 release:
Added the lcp copying script to the distribution (although it
isn't installed automatically). No other changes.
News for the 1.1.9 release:
Some code cleanup. Removed a dozen files, four classes and
about 1k lines of code. Useful tools are make class-map and
./configure --enable-gcov.
To get gcov to work properly when running several processes in
parallell, you may also want to apply misc/libgcc2.c-patch to
gcc. The patch adds locking for the output *.da files.
News for the 1.1.8 release:
Updated the scsh support for scsh-0.5.2. Note that scsh is now
free software; the "non-commercial use" restrictions were
removed in the 0.5.2 release.
Updated the channel close logic to be compatible with other
ssh implementations.
Handle POLLERR; the previous version went into a busy loop if
poll set the POLLERR flag on any fd.
--cvs-workaround=e is now on by default. New option
--no-cvs-workaround to disable it.
News for the 1.1.7 release:
More bug fixes, most of them related to the EOF handling.
Added testcase for lshg -L, fixed the exposed bugs.
Don't output the "Userauth successful" message unless in
verbose mode.
News for the 1.1.6 release:
Fixed a bug in the testsuite framework, and discovered and
fixed a few new and old bugs (mostly related to the EOF and
channel close logic).
Improved handling of POLLHUP on Linux.
Fixed bug in lshd password authentication, which sometimes
crashed lshd.
Support for RSA keys, according to
draft-ietf-secsh-transport-09.txt. Wrote a test case for RSA
hostkeys, and fixed a bug in the ssh-rsa public key decoder.
Added support for OpenSSH style RSA keys to ssh-conv.
Changed unix_random.c to be more quiet.
Changed tcpip forwarding code to call shutdown() when it
receives an SSH_MSG_CHANNEL_EOF.
Updated the manual.
News for the 1.1.5 release:
Fixed bug in random generator seeding (spotted by jps).
More argp fixes.
Work on rsync, but still not used.
News for the 1.1.4 release:
Fixes for encrypted private keys (thanks to jps).
Updated argp, and ripped out its dependencies on getopt.
News for the 1.1.3 release:
Support for encrypted private keys (not tested).
The lshg gateway client works.
News for the 1.1.2 release:
New experimental option to lsh: --cvs-workaround. Using this
option causes lsh to fork off a few extra processes to handle
its stdio file descriptors, and avoid setting them in
nonblocking mode. One can also use for instance
--cvs-workaround=o to fork only for stdout; the optional
argument can be any combination of the characters 'i' (stdin),
'o' (stdout) and 'e' (stderr). If this turns out to be useful,
the option will probably be renamed and perhaps made the
default.
Implemented window change messages in the client.
Added signal handlers to io_backend.
Reorganized the code a little to make the lshg binary smaller.
Some work on an "interactive" class, encapsulating the
oparations one may want to do on the user's tty, including
subscription for window change events.
News for the 1.1.1 release:
First try for the gateway mode. New option -G for lsh, and a
new program lshg for talking to the gateway.
lshd forks of a new process and changes its uid for reading
user files. The only file read in this way, so far, is
~/.lsh/srp-verifier.
Improved randomness framework.
News for the 1.1.0 release:
First, note that the 1.1.x series should be considered
experimental.
New program lsh-export-key (contributed by jps, and then
hacked some more by me).
Some of the methods for public-key operations have been
improved and generalized.
News for the 1.0.6 release
Fixed bug in ssh-dss bug-compatibility.
Experimental kerberos support. New lshd option
--kerberos-passwords. Compiles with heimdal, MIT kerberos not yet
tested.
Improved handling of serialized userauth requests (not yet
used by kerberos password functions).
Hacked serpent code to support variable size keys.
Added rijndael test cases. No working serpent testcases yet.
News for the 1.0.5 release
Experimental support for RSA, using spki-style keys and
signatures.
Some reorganization of signature algorithms, to support
spki-style signatures (including rsa) properly.
Fix for key renegotiation bug reported by jps.
New algorithms bulk encryption algorithms: serpent and
rijndael. Rijndael implementation and lsh glue code
contributed by Rafael R. Sevilla. Serpent implementation by
Ross Anderson, Eli Biham, and Lars Knudsen.
New option -call to use any supported bulk encryption
algorithm; the default preference list is quite conservative.
New option --hostkey-algorithm, to tune the hostkey algorithm
preference list.
Renamed lsh_keygen and lsh_writekey to lsh-keygen and
lsh-writekey, respectively (actually happened in 1.0.4, but I
forgot to mention that).
News for the 1.0.4 release
Fixed yet another bug in the userauth logic.
Some RSA support (so far, only lsh-keygen and lsh-writekey
support RSA). 408 hours left...
Support for the transport spki format in sexp_parser.c.
News for the 1.0.3 release
Fixed bug in client userauth logic.
Configure fix: put -L and -R flags in LDFLAGS, not LIBS.
Portability fixes and some signed/unsigned cleanup.
News for the 1.0.2 release
Fixed bug in lsh_writekey, and improved the error message when
the outputfile already exists.
Fixed bug in the poll emulation in jpoll.c (noticed by
Jean-Pierre Stierlin).
Portability bugs reported by Jean-Pierre Stierlin, for
compiling on MacOS.
News for the 1.0.1 release
Various bug fixes. Spelling and grammar fixes in the manual,
contributed by Johan Myreen.
Hacked lsh user authentication to stop asking for a password
if the empty password is entered twice.
News for the 0.9.15 release
Portability fixes. Fixed 32-bit bug in the memory allocation
that appeared on alpha-linux. Fixes for HPUX compiler. Fixed
make distclean, which failed when cleaning in src/symmetric.
News for the 0.9.14 release
Added --stdin, --stdout and --stderr options to lsh.
Implemented pretty-printing of s-expressions when using the
advanced syntax.
Renamed sexp_conv to sexp-conv.
Fixed bug preventing forwarded connections from being closed
properly. Reported by Daniel Prevett and Joseph Galbraith.
New Getting Started chapter in the manual, and other
documentation updates.
News for the 0.9.13 release
New program lsh-decode-key and script ssh-conv, for converting
OpenSSH/ssh2 keys to sexp format.
Updated SRP support to the draft doc/srp-spec.txt.
Made it possible to skip the userauth sub-protocol when using
SRP. The proxy program was probably broken in the process.
Fixed lsh-authorize, to use the right options to sexp_conv.
Let $HOME override the home directory in the passwd database,
when running as non-root.
News for the 0.9.10 release
Fixed bug that caused buffered output to be lost at channel
close.
Experimental SRP support.
New program srp-gen.
Improved the hex dumps in debug output.
News for the 0.9.9 release
autoconf fixes. Add -R-flags when appropriate. Recognize
gmp-3.x. Added --with-lib-path option.
Portability fixes.
News for the 0.9.7 release
Experimental IPv6 support.
Experimental support for encrypted private keys (for now, only
in lsh_writekey).
wtmp logging.
Improved behaviour of --port and -z options.
News for the 0.9.2 release
Improved support for shadow passwords.
Some preparations for gateway mode.
News for the 0.9.1 release
Support for remote commands directly on the lsh command line.
New options -S and -E. More features in the proxy.
News for the 0.2.9 release
Fixed bugs in the length checking of incoming packets.
News for the 0.2.8 release
Reworked i/o and the CHANNEL_OPEN mechanism. Seems to fix the
crash when requesting forwarding to a port that doesn't
answer.
Also close ports for local and remote forwarding properly.
Updated the proxy code.
News for the 0.2.7 release
Bug fixes for compialtion on Solaris.
News for the 0.2.6 release
Bugfixes for tcp forwarding functions.
Some more tests for testsuite. To try them, you must first
setup lsh so that you can login with no password. Then type
"make check-more" in the testsuite subdirectory.
News for the 0.2.5 release
Bugfixes.
News for the 0.2.3 release
Added lshd options --password, --no-password, --publickey and
--no-publickey, for configuring the set of supported userauth
methods.
Changes to the proxy program (Bazsi).
News for the 0.2.2 release
Bug fixes. Verbose messages on algorithm selection.
News for the 000.2 release
Bugfixes. New --pty-support and --no-pty-support options for
lshd.
News for the lsh-0.1.20 release
Bugfixes. New test script for lsh_writekey.
News for the lsh-0.1.19 release
Lots of bugfixes. Reading of ~/.lsh/known_hosts and
~/.lsh/identity seems to work.
New contrib sub-directory.
News for the lsh-0.1.18 release
lsh now reads ACL:s from the ~/.lsh/known_hosts file.
First attempt at a m4-based testsuite. It depends on m4 being
able to handle the eight-bit quote characters » and «. If your
m4 doesn't do that, get the latest beta of GNU m4 or recompile
GNU m4-1.4 with CFLAGS=-funsigned-char.
News for the lsh-0.1.17 release
More support for host authentication and SPKI.
First version that includes Bazsi's work on an ssh-proxy (i.e.
a program that implements the traditional Man-in-the-middle
attack on the ssh2 protocol). Could be useful for people
running firewalls, and also for those of us who want to point
out that it's a bad idea to use unauthenticated hostkeys.
News for the lsh-0.1.16 release
Some preparations for real host authentication.
News for the lsh-0.1.15 release
Support for publickey user authentication.
A new script lsh-authorize.
News for the lsh-0.1.14 release
First try on daemonization support.
Better tracing; try --trace to get some more information than
with -v, but without all the boring information generated by
--debug.
Generally nicer options and help mesasges, thanks to argp.
Better handling of i/o exceptions. lshd should no longer crash
when connections behave unexpectedly.
News for the lsh-0.1.12 release
Tried to fix bugs related to channel close. In the process,
improved the resource mechanism, and let each channel
have it's own list of resources.
Fixed configure.in to handle systems with neither scsh or
guile installed.
News for the lsh-0.1.11 release
Support for other scheme implementations in the build process,
in particular guile.
News for the lsh-0.1.10 release
Fixed bug in sexp parser and lsh_writekey.
Merged more of bazsis patches.
News for the lsh-0.1.9 release
Lot's of bug fixes. This version actually seems to work.
Bazsi's public key patches is in, although I haven't been able
to test them.
The SEXP parser is rewritten to use the new exception
framework. The program that makes the most of of this right
now is lsh_writekey. Its core reads like
(params
(private object io_write_file_info)
(public object io_write_file_info))
(lambda (backend)
(let ((key (read (stdin backend))))
(prog1 (transport (open backend public) (private2public key))
; FIXME: Add encryption here
(canonical (open backend private) key))))))
The sexptest program has been renamed to sexp_conv. It reads
an sexp (for now, only canonical and transport syntax are
supported) on stdin, and prints it using advanced, transport
or canonical syntax. More features could be added.
The --debug option now dumps both sent and received packets,
and it includes a human readable name of the packet type.
Packets of type SSH_MSG_USERAUTH_REQUEST are suppressed,
however, because they typically contains user passwords.
There is one known bug: Running without pty allocation (lsh
-nt) doesn't work, at least not for me.
News for the lsh-0.1.8 release
Reworked all the error handling to use exceptions. No new
features, but lots of new bugs.
There are no official releases numbered 0.1.4 -- 0.1.7. However,
these version numbers are used for Bazsi's unofficial releases during
the summer. The unofficial releases feature public key user
authentication and better compatibility with Datafellow's ssh2
products.
News for the lsh-0.1.3 release
Local forwarding (-L) works. -R is slightly broken.
News for the lsh-0.1.2 release
First user visible tcpforwarding (-L option). Not tested
yet...
Fixed flow control.
DSA signatures should conform better both to the draft andd to
the ssh-2.x implementations.
Better handling of POLLHUP.
News for the lsh-0.1 release
Added compiler.scm to the dist.
Changed the session key generation to comply with the latest
draft (pointed out by Joseph Galbraith).
Added IDEA support (Bazsi).
Fixes to pty handling and flow control (mostly Bazsi).
Fixed the client side handling of userauth failures.
By default, if we are running with a pty, use the same fd for
stdout and stderr. This workaround should make lsh more
friendly to bash and other programs that expect stderr to be a
tty.
NEWS for the 1999-04-25 snapshot:
Fixed a few bugs in pty and eof handling. Should now work
about as well as the 03-17 snapshot. Also removed most old
#if:ed out code.
NEWS for the 1999-04-20 snapshot:
Internal reorganization. Implemented the "control language".
And some bug fixes. See ChangeLog for all the details.
NEWS for the 1999-03-17 snapshot
CAST and TWFOFISH seem to work now.
Includes a lambda->SK compiler.
Bugfixes.
NEWS for the 1999-03-08 snapshot
No user visible changes. Added a instance variable to keep
track of the amount of buffered data in the write_buffer
objects (needed to fix the broken flow control).
Added a generic doubly linked list, currently used by the
write_buffer and resource_list classes, but which will be
needed for more things (see the CONTROL item on the TODO
list).
NEWS for the 1999-03-07 snapshot
Improved CFMAKERAW. Ugly fix for the UNIX98-style pty:s
support.
Twofish support (not quite working).
Started on tcp forwarding (Bazsi).
Some support for broken ssh2 signatures (Baszi). Needs some
more work.
Various bugfixes.
NEWS for the 1999-02-28 snapshot
Portability fixes for Solaris.
NEWS for the 1999-01-28 snapshot
Some PTY support
Integrated support for sshd1 fallback (not tested)
Bug fixes.
NEWS for the 1999-01-14 snapshot
Fixed off-by-one bug in dss_keygen.
Some portability fixes (sys/poll.h, crypt.h, unistd.h).
NEWS for the 1999-01-08 snapshot:
New program lsh_writekey.
NEWS for the 1999-01-05 snapshot:
Command line options to select which algorithms to use.
Various bug fixes. The 3des and blowfish support seems do work
now.
NEWS for the 1999-01-01 snapshot:
ZLIB support. (Bazsi)
Long key support (needed for 3DES) (Bazsi).
Fixed configure test for shutdown().
Various bug fixes (Ray).
NEWS for the 1998-12-26 snapshot:
New lsh_keygen program.
NEWS for the 1998-12-21 snapshot:
Moved most objects in crypto.c and abstract_crypto.c into separate
files.
Added a workaround for Datafellows ssh2 client, which (contrary to the
specification) asks for protocol version 1.99.
Use /dev/urandom, if available.
Collect most object files into liblsh.a.
Started on a key generation program.
TASKLIST and NOTES files now included in the snapshot.
NEWS since the 1998-12-17 snapshot:
Support for md5 (by Balázs Scheidler).
Various bugfixes.
NEWS since the 1998-12-11 snapshot:
A resource mechanism (resource.[ch]) used by the server to cleanup
properly when a connection dies unexpectedly. Can be used to kill
child processes, close files and ports, etc.
Generic code for chaining ciphers (crypto_cbc()) and piping them
together (crypto_cascade()).
Some untested support for blowfish and 3DES. A -c command line option
is needed.
A few bugfixes. Thanks to J.H.M. Dassen (Ray) and Balázs Scheidler.

View File

@ -1,96 +0,0 @@
LSH - a GNU implementation of the Secure Shell protocols.
LSH IS A WORK IN PROGRESS. IT WILL NOT PROVIDE ANY SECURITY ON SYSTEMS
THAT LACK /dev/random. THERE MAY BE OTHER SERIOUS BUGS THAT MAKE IT
TOTALLY INSECURE.
COPYRIGHT
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. See the file COPYING for details.
INSTALLATION
If you have downloaded a release, you should be able to compile it
with
./configure
make
You need GNU make. Some shells have had bugs preventing them from
executing the configure script; if you experience problems, try
running
bash configure
If you want to hack lsh, you need some more tools: autoconf (at least
version 2.50), automake, bash, gcc, gperf (at least version 2.7) and a
scheme implementation. The currently supported schemes are guile and
scsh (at least version 0.5.2). All but scsh can be found at your local
GNU mirror site. scsh, Olin Shiver's Scheme Shell, can be downloaded
from <URL: ftp://ftp-swiss.ai.mit.edu/pub/su/scsh/scsh.tar.gz>. If you
use guile, you also need the slib library, which is usually
distributed separately. It's also available at the GNU mirrors.
If you have checked out lsh from CVS, things are more complicated. You
must first generate Makefile.am files from the corresponding
Makefile.am.in files. Do this by running ./make_am in the top level
directory. Next, you need to run aclocal, autoconf, autoheader and
automake -a. This creates the configure script and a Makefile.in. Now
you can try ./configure ; make. If the compiler complains that it
can't find a file foo.h.x, try creating it with make foo.h.x, and
similarly for missing foo.c.x files. The misc/bootstrap.sh script
tries to do all this.
NEEDED LIBRARIES
GMP (cersion 2.0.2 or better) can be found at ftp.gnu.org, or some of
its mirrors.
ZLIB can be found at ftp://ftp.cdrom.com/pub/infozip/zlib/zlib.html or
http://www.cdrom.com/pub/infozip/zlib/. Latest version is zlib-1.1.3.
GETTING STARTED
Some examples...
Create a new DSS key pair, and save it in NEW_KEY and NEW_KEY.pub:
./lsh-keygen -l 8 | ./lsh-writekey -o NEW_KEY
Start an lshd server on port 4711, using the key created above as the
server host key:
./lshd -p 4711 -h NEW_KEY
Connect to an lshd server running on port 4711 on HOST, and attempt to
log in as USER:
./lsh -p 4711 -l USER HOST
MORE INFORMATION
For more information on using LSH, read the LSH manual, doc/lsh.info
or doc/lsh.html.
For an introduction to the inner workings of LSH, see the file
doc/HACKING.
Several people have contributed to LSH, see the AUTHORS file for
details.
If you are interested in lsh, you may want to subscribe to the
psst-list. Subscription address is psst-request@net.lut.ac.uk.
Current snapshots of lsh can be found at
<URL: http://www.lysator.liu.se/~nisse/archive/>.
/Niels Möller <nisse@lysator.liu.se>

View File

Binary file not shown.

558
lsh/aclocal.m4 vendored
View File

@ -1,558 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
AH_TEMPLATE([socklen_t], [Length type used by getsockopt])
# Try to detect the type of the third arg to getsockname() et al
AC_DEFUN([AC_TYPE_SOCKLEN_T],
[AC_CACHE_CHECK([for socklen_t in sys/socket.h], ac_cv_type_socklen_t,
[AC_EGREP_HEADER(socklen_t, sys/socket.h,
[ac_cv_type_socklen_t=yes], [ac_cv_type_socklen_t=no])])
if test $ac_cv_type_socklen_t = no; then
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes, [
#ifdef _AIX
yes
#endif
],[
AC_MSG_RESULT(yes)
AC_DEFINE(socklen_t, size_t)
],[
AC_MSG_RESULT(no)
AC_DEFINE(socklen_t, int)
])
fi
])
# checks for gmp version 2 or later.
# AC_CHECK_LIBGMP(library, [, if-found [, if-not-found]])
AC_DEFUN([AC_CHECK_LIBGMP],
[AC_CACHE_CHECK([for mpz_get_d in -l$1], ac_cv_lib_$1_mpz_get_d,
[ac_save_libs="$LIBS"
LIBS="-l$1 $LIBS"
AC_TRY_LINK(dnl
[#if HAVE_GMP_H
#include <gmp.h>
#elif HAVE_GMP2_GMP_H
#include <gmp2/gmp.h>
#endif
],
[mpz_get_d(0);],
ac_cv_lib_$1_mpz_get_d=yes,
ac_cv_lib_$1_mpz_get_d=no)
LIBS="$ac_save_LIBS"
])
if test x$ac_cv_lib_$1_mpz_get_d = xyes ; then
ifelse([$2], ,
[AC_DEFINE(HAVE_LIBGMP)
LIBS="-l$1 $LIBS"
], [$2])
ifelse([$3], , ,
[else
$3
])dnl
fi
])
# checks for gmp version 2 or later.
# AC_SEARCH_LIBGMP(libraries, [, if-found [, if-not-found]])
AC_DEFUN([AC_SEARCH_LIBGMP],
[AC_CACHE_CHECK([for library containing mpz_get_d], ac_cv_search_mpz_get_d,
[ac_search_save_LIBS="$LIBS"
ac_cv_search_mpz_get_d="no"
for i in $1; do
LIBS="-l$i $ac_search_save_LIBS"
AC_TRY_LINK(dnl
[#if HAVE_GMP_H
#include <gmp.h>
#elif HAVE_GMP2_GMP_H
#include <gmp2/gmp.h>
#endif
],
[mpz_get_d(0);],
[ac_cv_search_mpz_get_d=-l$i
break
])
done
LIBS="$ac_search_save_LIBS"
])
if test "x$ac_cv_search_mpz_get_d" != xno ; then
LIBS="$ac_cv_search_mpz_get_d $LIBS"
ifelse([$2], ,
[AC_DEFINE(HAVE_LIBGMP)
], [$2])
ifelse([$3], , ,
[else
$3
])dnl
fi
])
# LSH_PATH_ADD(path-id, directory)
AC_DEFUN([LSH_PATH_ADD],
[AC_MSG_CHECKING($2)
ac_exists=no
if test -d "$2/." ; then
ac_real_dir=`cd $2 && pwd`
if test -n "$ac_real_dir" ; then
ac_exists=yes
for old in $1_REAL_DIRS ; do
ac_found=no
if test x$ac_real_dir = x$old ; then
ac_found=yes;
break;
fi
done
if test $ac_found = yes ; then
AC_MSG_RESULT(already added)
else
AC_MSG_RESULT(added)
# LDFLAGS="$LDFLAGS -L $2"
$1_REAL_DIRS="$ac_real_dir [$]$1_REAL_DIRS"
$1_DIRS="$2 [$]$1_DIRS"
fi
fi
fi
if test $ac_exists = no ; then
AC_MSG_RESULT(not found)
fi
])
# LSH_RPATH_ADD(dir)
AC_DEFUN([LSH_RPATH_ADD], [LSH_PATH_ADD(RPATH_CANDIDATE, $1)])
# LSH_RPATH_INIT(candidates)
AC_DEFUN([LSH_RPATH_INIT],
[AC_MSG_CHECKING([for -R flag])
RPATHFLAG=''
case `uname -sr` in
OSF1\ V4.*)
RPATHFLAG="-rpath "
;;
IRIX\ 6.*)
RPATHFLAG="-rpath "
;;
IRIX\ 5.*)
RPATHFLAG="-rpath "
;;
SunOS\ 5.*)
if test "$TCC" = "yes"; then
# tcc doesn't know about -R
RPATHFLAG="-Wl,-R,"
else
RPATHFLAG=-R
fi
;;
Linux\ 2.*)
RPATHFLAG="-Wl,-rpath,"
;;
*)
:
;;
esac
if test x$RPATHFLAG = x ; then
AC_MSG_RESULT(none)
else
AC_MSG_RESULT([using $RPATHFLAG])
fi
RPATH_CANDIDATE_REAL_DIRS=''
RPATH_CANDIDATE_DIRS=''
AC_MSG_RESULT([Searching for libraries])
for d in $1 ; do
LSH_RPATH_ADD($d)
done
])
# Try to execute a main program, and if it fails, try adding some
# -R flag.
# LSH_RPATH_FIX
AC_DEFUN([LSH_RPATH_FIX],
[if test $cross_compiling = no -a "x$RPATHFLAG" != x ; then
ac_success=no
AC_TRY_RUN([int main(int argc, char **argv) { return 0; }],
ac_success=yes, ac_success=no, :)
if test $ac_success = no ; then
AC_MSG_CHECKING([Running simple test program failed. Trying -R flags])
dnl echo RPATH_CANDIDATE_DIRS = $RPATH_CANDIDATE_DIRS
ac_remaining_dirs=''
ac_rpath_save_LDFLAGS="$LDFLAGS"
for d in $RPATH_CANDIDATE_DIRS ; do
if test $ac_success = yes ; then
ac_remaining_dirs="$ac_remaining_dirs $d"
else
LDFLAGS="$RPATHFLAG$d $LDFLAGS"
dnl echo LDFLAGS = $LDFLAGS
AC_TRY_RUN([int main(int argc, char **argv) { return 0; }],
[ac_success=yes
ac_rpath_save_LDFLAGS="$LDFLAGS"
AC_MSG_RESULT([adding $RPATHFLAG$d])
],
[ac_remaining_dirs="$ac_remaining_dirs $d"], :)
LDFLAGS="$ac_rpath_save_LDFLAGS"
fi
done
RPATH_CANDIDATE_DIRS=$ac_remaining_dirs
fi
if test $ac_success = no ; then
AC_MSG_RESULT(failed)
fi
fi
])
# Like AC_CHECK_LIB, but uses $KRB_LIBS rather than $LIBS.
# AC_CHECK_KRB_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [,
# ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
AC_DEFUN([AC_CHECK_KRB_LIB],
[AC_CHECK_LIB([$1], [$2],
ifelse([$3], ,
[[ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
AC_DEFINE_UNQUOTED($ac_tr_lib)
KRB_LIBS="-l$1 $KRB_LIBS"
]], [$3]),
ifelse([$4], , , [$4
])dnl
, [$5 $KRB_LIBS])
])
# AC_LIB_ARGP(ACTION-IF-OK, ACTION-IF-BAD)
AC_DEFUN([AC_LIB_ARGP],
[ ac_argp_save_LIBS="$LIBS"
ac_argp_save_LDFLAGS="$LDFLAGS"
ac_argp_ok=no
# First check if we can link with argp.
AC_SEARCH_LIBS(argp_parse, argp,
[ LSH_RPATH_FIX
AC_CACHE_CHECK([for working argp],
lsh_cv_lib_argp_works,
[ AC_TRY_RUN(
[#include <argp.h>
#include <stdlib.h>
static const struct argp_option
options[] =
{
{ NULL, 0, NULL, 0, NULL, 0 }
};
struct child_state
{
int n;
};
static error_t
child_parser(int key, char *arg, struct argp_state *state)
{
struct child_state *input = (struct child_state *) state->input;
switch(key)
{
default:
return ARGP_ERR_UNKNOWN;
case ARGP_KEY_END:
if (!input->n)
input->n = 1;
break;
}
return 0;
}
const struct argp child_argp =
{
options,
child_parser,
NULL, NULL, NULL, NULL, NULL
};
struct main_state
{
struct child_state child;
int m;
};
static error_t
main_parser(int key, char *arg, struct argp_state *state)
{
struct main_state *input = (struct main_state *) state->input;
switch(key)
{
default:
return ARGP_ERR_UNKNOWN;
case ARGP_KEY_INIT:
state->child_inputs[0] = &input->child;
break;
case ARGP_KEY_END:
if (!input->m)
input->m = input->child.n;
break;
}
return 0;
}
static const struct argp_child
main_children[] =
{
{ &child_argp, 0, "", 0 },
{ NULL, 0, NULL, 0}
};
static const struct argp
main_argp =
{ options, main_parser,
NULL,
NULL,
main_children,
NULL, NULL
};
int main(int argc, char **argv)
{
struct main_state input = { { 0 }, 0 };
char *v[2] = { "foo", NULL };
argp_parse(&main_argp, 1, v, 0, NULL, &input);
if ( (input.m == 1) && (input.child.n == 1) )
return 0;
else
return 1;
}
], lsh_cv_lib_argp_works=yes,
lsh_cv_lib_argp_works=no,
lsh_cv_lib_argp_works=no)])
if test x$lsh_cv_lib_argp_works = xyes ; then
ac_argp_ok=yes
else
# Reset link flags
LIBS="$ac_argp_save_LIBS"
LDFLAGS="$ac_argp_save_LDFLAGS"
fi])
if test x$ac_argp_ok = xyes ; then
ifelse([$1],, true, [$1])
else
ifelse([$2],, true, [$2])
fi
])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($am_cv_prog_cc_stdc)
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])

View File

@ -1,322 +0,0 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define if using `alloca.c'. */
#undef C_ALLOCA
/* Define to support non-standard packets of ssh2 */
#undef DATAFELLOWS_WORKAROUNDS
/* Define to enable sanity checking on memory allocation and casting */
#undef DEBUG_ALLOC
/* Define to enable tracing */
#undef DEBUG_TRACE
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define if AI_NUMERICHOST exists */
#undef HAVE_AI_NUMERICHOST
/* Define if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have the <argp.h> header file. */
#undef HAVE_ARGP_H
/* Define if you have the `cfmakeraw' function. */
#undef HAVE_CFMAKERAW
/* Define if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H
/* Define if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the `gai_strerror' function. */
#undef HAVE_GAI_STRERROR
/* Define if the compiler understands __attribute__ */
#undef HAVE_GCC_ATTRIBUTE
/* Define if the compiler understands __FUNCTION__ */
#undef HAVE_GCC_FUNCTION
/* Define if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
/* Define if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
/* Define if you have the `getspnam' function. */
#undef HAVE_GETSPNAM
/* Define if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the <gmp2/gmp.h> header file. */
#undef HAVE_GMP2_GMP_H
/* Define if you have the <gmp.h> header file. */
#undef HAVE_GMP_H
/* Define if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the <krb5.h> header file. */
#undef HAVE_KRB5_H
/* Define if you have the `crypt' library (-lcrypt). */
#undef HAVE_LIBCRYPT
/* Define if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the `util' library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define if you have the `Xau' library (-lXau). */
#undef HAVE_LIBXAU
/* Define if you have the `xnet' library (-lxnet). */
#undef HAVE_LIBXNET
/* Define if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define if you have the `login' function. */
#undef HAVE_LOGIN
/* Define if you have the `logout' function. */
#undef HAVE_LOGOUT
/* Define if you have the `logwtmp' function. */
#undef HAVE_LOGWTMP
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the `memxor' function. */
#undef HAVE_MEMXOR
/* Define if you have the `openpty' function. */
#undef HAVE_OPENPTY
/* Define if you have the `poll' function. */
#undef HAVE_POLL
/* Define if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define if you have the `select' function. */
#undef HAVE_SELECT
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
/* Define if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define if `ut_addr' is member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_ADDR
/* Define if `ut_addr_v6' is member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_ADDR_V6
/* Define if `ut_host' is member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_HOST
/* Define if `ut_name' is member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_NAME
/* Define if `ut_user' is member of `struct utmp'. */
#undef HAVE_STRUCT_UTMP_UT_USER
/* Define if you have the `syslog' function. */
#undef HAVE_SYSLOG
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if a we have working UNIX98 pty handling */
#undef HAVE_UNIX98_PTYS
/* Define if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <X11/Xauth.h> header file. */
#undef HAVE_X11_XAUTH_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* The name of this software distribution */
#undef PACKAGE
/* The installation prefix */
#undef PREFIX
/* Traditional BSD pty handling */
#undef PTY_BSD_SCHEME
/* Possible first characters in a /dev/ptyXX name */
#undef PTY_BSD_SCHEME_FIRST_CHARS
/* Possible second characters in a /dev/ptyXX name */
#undef PTY_BSD_SCHEME_SECOND_CHARS
/* sbin directory */
#undef SBINDIR
/* Define to indicate that shutdown seems to work properly */
#undef SHUTDOWN_WORKS_WITH_UNIX_SOCKETS
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Location of the SSH1 daemon */
#undef SSHD1
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* The version of this software distribution */
#undef VERSION
/* Define to enable authentication agent forwarding */
#undef WITH_AGENT_FORWARD
/* Use gcov */
#undef WITH_GCOV
/* For Ipv6 support */
#undef WITH_IPV6
/* For kerberos */
#undef WITH_KERBEROS
/* Define to enable pty support */
#undef WITH_PTY_SUPPORT
/* Define if SRP should be supported */
#undef WITH_SRP
/* Define to enable fallback to SSH1 */
#undef WITH_SSH1_FALLBACK
/* Define to enable tcp forwarding */
#undef WITH_TCP_FORWARD
/* For utmp support */
#undef WITH_UTMP
/* Define to enable x11 forwarding */
#undef WITH_X11_FORWARD
/* Define if zlib should be used */
#undef WITH_ZLIB
/* Define if your processor stores words with the most significant byte first
(like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Length type used by getsockopt */
#undef socklen_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t

9958
lsh/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,714 +0,0 @@
dnl -*- mode: shell-script; sh-indentation: 2; -*-
dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT([lsh], [1.3.1], [bug-lsh@gnu.org])
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR([src/lsh_types.h])
AM_INIT_AUTOMAKE(lsh, 1.3.4)
AM_CONFIG_HEADER(config.h)
# AC_CONFIG_HEADERS(config.h)
AH_TEMPLATE([PACKAGE], [The name of this software distribution])
AH_TEMPLATE([VERSION], [The version of this software distribution])
# FIXME: Move this to the Makefile, as recommended by the autoconf manual.
AH_TEMPLATE([PREFIX], [The installation prefix])
AC_DEFINE_UNQUOTED(PREFIX, "`echo $prefix | sed "s@^NONE@$ac_default_prefix@"`")
AH_TEMPLATE([SBINDIR], [sbin directory])
# NOTE: The definition below is broken.
AC_DEFINE_UNQUOTED(SBINDIR, "`echo $sbindir | sed "s@^NONE@$prefix/sbin@" | sed "s@^NONE@$ac_default_prefix@"`")
# We want an absolute path to the source-dir.
case "$srcdir" in
/*)
;;
*)
oldsrcdir="$srcdir"
srcdir="`cd \"$srcdir\";pwd`"
AC_MSG_WARN([ Converted $oldsrcdir to $srcdir,
If this does not work, please use an absolute path to the configure script. ])
;;
esac
# echo Replacing CPPFLAGS: $CPPFLAGS
# FIXME: Should be obsoleted by the nettle library
# We want to compile the crypto lib for use with lsh
# CPPFLAGS="$CPPFLAGS -I$srcdir -I$srcdir/src -I$srcdir/src/symmetric/include -DLSH"
# src/rsync relies on lsh's definitions of WRITE_UINT32 etc.
CPPFLAGS="-I$srcdir/src -DLSH"
# GNU libc defaults to supplying the ISO C library functions only.
# initgroups() and strsignal() are extensions; the _GNU_SOURCE define
# enables these extensions.
# Enable it on all systems; no problems have been reported with it so far.
# We can't use AH_VERBATIM for this, as we want _GNU_SOURCE to be defined
# when running configure's test programs.
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
# Check options
AC_ARG_ENABLE(debug_alloc,
AC_HELP_STRING([--enable-debug-alloc], [Enable memory allocation sanity checks]),,
[enable_debug_alloc=no])
AH_TEMPLATE([DEBUG_ALLOC],
[Define to enable sanity checking on memory allocation and casting])
if test x$enable_debug_alloc = xyes ; then
AC_DEFINE(DEBUG_ALLOC)
fi
AC_ARG_ENABLE(debug_trace,
AC_HELP_STRING([--enable-debug-trace], [Enable tracing support]),,
[enable_debug_trace=no])
AH_TEMPLATE([DEBUG_TRACE], [Define to enable tracing])
if test x$enable_debug_trace = xyes ; then
AC_DEFINE(DEBUG_TRACE)
fi
AC_ARG_ENABLE(gcov,
AC_HELP_STRING([--enable-gcov], [Instrument for gcov (requires a modern gcc)]),,
[enable_gcov=no])
AC_ARG_WITH(zlib,
AC_HELP_STRING([--without-zlib], [Don't use zlib compression]),,
[with_zlib=yes])
# Checking this variable is delayed until we have checked if zlib is
# actually available.
AC_ARG_ENABLE(pty,
AC_HELP_STRING([--without-pty], [Disable pty support]),,
[enable_pty=yes])
AH_TEMPLATE([WITH_PTY_SUPPORT], [Define to enable pty support])
if test x$enable_pty = xyes ; then
AC_DEFINE(WITH_PTY_SUPPORT)
fi
AC_ARG_WITH(sshd1,
AC_HELP_STRING([[--with-sshd1[=PROGRAM]]], [support fallback to SSH1 daemon]),,
[with_sshd1=yes])
# Default sshd1 path
if test x$with_sshd1 = xyes ; then
with_sshd1=/usr/local/sbin/sshd1
fi
AH_TEMPLATE([SSHD1], [Location of the SSH1 daemon])
AH_TEMPLATE([WITH_SSH1_FALLBACK], [Define to enable fallback to SSH1])
if test x$with_sshd1 != xno ; then
AC_DEFINE(WITH_SSH1_FALLBACK)
AC_DEFINE_UNQUOTED(SSHD1,"$with_sshd1")
fi
AC_ARG_ENABLE(srp,
AC_HELP_STRING([--disable-srp], [Disable the (experimental) support for SRP]),,
[enable_srp=yes])
AC_ARG_ENABLE(kerberos,
AC_HELP_STRING([--disable-kerberos], [Don't support kerberos]),,
[enable_kerberos=yes])
AH_TEMPLATE([WITH_SRP], [Define if SRP should be supported])
if test x$enable_srp = xyes ; then
AC_DEFINE(WITH_SRP)
SRP_PROGRAM=srp-gen
fi
AC_SUBST(SRP_PROGRAM)
AC_ARG_ENABLE(datafellows_workarounds,
AC_HELP_STRING([--disable-datafellows-workarounds],
[Disable bug-compatibility with SSH Inc's clients and servers]),,
[enable_datafellows_workarounds=yes])
AH_TEMPLATE([DATAFELLOWS_WORKAROUNDS],
[Define to support non-standard packets of ssh2])
if test x$enable_datafellows_workarounds = xyes ; then
AC_DEFINE(DATAFELLOWS_WORKAROUNDS)
fi
AC_ARG_ENABLE(tcp_forward,
AC_HELP_STRING([--disable-tcp-forward], [Disable tcp forwarding]),,
[enable_tcp_forward=yes])
AH_TEMPLATE([WITH_TCP_FORWARD], [Define to enable tcp forwarding])
if test x$enable_tcp_forward = xyes ; then
AC_DEFINE(WITH_TCP_FORWARD)
fi
AC_ARG_ENABLE(x11_forward,
AC_HELP_STRING([--disable-x11-forward], [Disable x11 forwarding (proxy only)]),,
[eanble_x11_forward=yes])
AH_TEMPLATE([WITH_X11_FORWARD], [Define to enable x11 forwarding])
if test x$enable_x11_forward = xyes ; then
AC_DEFINE(WITH_X11_FORWARD)
fi
AC_ARG_ENABLE(agent_forward,
AC_HELP_STRING([--disable-agent-forward], [Disable auth-agent forwarding (proxy only)]),,
[with_agent_forward=yes])
AH_TEMPLATE([WITH_AGENT_FORWARD],
[Define to enable authentication agent forwarding])
if test x$disable_agent_forward = xyes ; then
AC_DEFINE(WITH_AGENT_FORWARD)
fi
AC_ARG_WITH(scheme,
AC_HELP_STRING([[--with-scheme[=PROGRAM]]], [Use a particular scheme implementation]),,
[with_scheme=])
AC_ARG_WITH(system-argp,
AC_HELP_STRING([--without-system-argp], [Don't use the system's argp]),,
[with_system_argp=yes])
# IPv6 support
AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support]),,
[enable_ipv6=yes])
# utmp/wtmp logging
AC_ARG_ENABLE(utmp,
AC_HELP_STRING([--disable-utmp], [Disable utmp and wtmp support]),,
[enable_utmp=yes])
AH_TEMPLATE([WITH_UTMP], [For utmp support])
if test x$enable_utmp = xyes ; then
AC_DEFINE(WITH_UTMP)
fi
AC_ARG_WITH(include-path,
AC_HELP_STRING([--with-include-path], [A colon-separated list of directories to search for include files]),,
[with_include_path=''])
if test x$with_include_path != x ; then
CPPFLAGS="$CPPFLAGS -I `echo $with_include_path | sed 's/:/ -I /g'`"
fi
AC_ARG_WITH(lib-path,
AC_HELP_STRING([--with-lib-path], [A colon-separated list of directories to search for libraries]),,
[with_lib_path=''])
if test x$with_lib_path != x ; then
LDFLAGS="-L `echo $with_lib_path | sed 's/:/ -L /g'`"
fi
LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \
`echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
/usr/local/lib /sw/local/lib /sw/lib \
/usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib /usr/pkg/lib])
dnl echo RPATH_CANDIDATE_DIRS = $RPATH_CANDIDATE_DIRS
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_PROG_CC_STDC
if test "x$am_cv_prog_cc_stdc" = xno ; then
AC_MSG_ERROR([the C compiler doesn't handle ANSI-C])
fi
# Use a particular scheme implementation?
if test x$with_scheme != x ; then
AC_PATH_PROG(SCHEME_PROGRAM, $with_scheme,, $PATH)
else
AC_PATH_PROGS(SCHEME_PROGRAM, guile scsh,, $PATH)
fi
if test x$SCHEME_PROGRAM = x ; then
AC_MSG_WARN([No scheme implementation found.
This is fine as long as you don't modify the source files.])
SCHEME_PROGRAM=false
fi
SCHEME_NAME=`basename $SCHEME_PROGRAM`
AC_SUBST(SCHEME_NAME)
AC_PATH_PROG(BASH, bash,, $PATH)
AC_PATH_PROG(GROFF, groff,, $PATH)
AC_PATH_PROG(M4, m4, m4)
AC_CACHE_CHECK([if m4 can handle eight-bit quote characters],
lsh_cv_prog_m4_quote_8bit,
[ if test xfoo = x`echo 'change''quote(»,«)»foo«' | $M4`; then
lsh_cv_prog_m4_quote_8bit=yes
else
lsh_cv_prog_m4_quote_8bit=no
fi])
if test x$lsh_cv_prog_m4_quote_8bit = xno; then
AC_MSG_WARN(
[To get the testsuite to work properly, you may need to
upgrade to a better version than GNU m4 1.4, or recompile
it with CFLAGS=-funsigned-char.
Latest version is available at <URL: http://www.seindal.dk/rene/gnu/>])
M4="false --"
fi
# Checks for header files.
AC_HEADER_STDC
# Some debian systems have both gmp and gmp2.
# This will probably not work right if both gmp.h and gmp2/gmp.h exists,
# and gmp.h is too old (i.e GMP-1.x).
gmp_header_found=no
AC_CHECK_HEADERS(gmp.h gmp2/gmp.h, [gmp_header_found=yes; break])
if test "$gmp_header_found" = no; then
AC_MSG_ERROR([Neither gmp.h nor gmp2/gmp.h found])
fi
AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h)
AC_CHECK_HEADERS(shadow.h)
if test x$with_zlib = xyes; then
AC_CHECK_HEADERS(zlib.h,, [with_zlib=no])
fi
AC_CHECK_HEADERS(poll.h sys/poll.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(argp.h)
AC_CHECK_HEADERS(utmp.h, [have_utmp_h=yes], [have_utmp_h=no])
if test x$have_utmp_h = xyes; then
AC_CHECK_MEMBERS([struct utmp.ut_host,
struct utmp.ut_name,
struct utmp.ut_user,
struct utmp.ut_addr,
struct utmp.ut_addr_v6],,,
[# if HAVE_UTMP_H
# include <utmp.h>
# endif
# if HAVE_UTMPX_H
# include <utmpx.h>
# endif
])
fi
AC_CHECK_HEADERS(utmpx.h)
if test x$enable_kerberos = xyes; then
AC_CHECK_HEADERS(krb5.h,, [enable_kerberos=no])
fi
# Some systems (in particular, Unixware) doesn't have socklen_t, but
# uses size_t. Falling back to int will cause some warnings.
# AC_CHECK_TYPE doesn't work, probably because the type in
# question is not defined in sys/types.h.
AC_TYPE_SOCKLEN_T
AC_SEARCH_LIBGMP(gmp gmp2,
[LSH_RPATH_FIX],
[AC_MSG_ERROR([GMP is missing. Get gmp-2.0.2 or better from ftp://ftp.gnu.org/pub/gnu/gmp]) ])
if test x$with_zlib = xyes; then
AC_CHECK_LIB(z, inflate,, [with_zlib=no])
fi
if test x$with_zlib = xyes; then
LSH_RPATH_FIX
fi
# X11 stuff. We only need libXau.
AC_PATH_X
if test -z "$no_x" ; then
CPPFLAGS="$CPPFLAGS -I$x_includes"
LDFLAGS="$LDFLAGS -L$x_libraries"
LSH_RPATH_ADD($x_libraries)
fi
AC_CHECK_HEADERS(X11/Xauth.h)
AC_CHECK_LIB(Xau, XauGetAuthByAddr)
LSH_RPATH_FIX
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(xnet, inet_addr)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, setsockopt)
# logwtmp is also in libutil
AC_CHECK_LIB(util, openpty)
# This macro is new in autoconf-2.13
AC_SEARCH_LIBS(syslog, bsd socket inet, [AC_DEFINE(HAVE_SYSLOG)])
AH_TEMPLATE([WITH_ZLIB], [Define if zlib should be used])
# Should we use zlib?
if test x$with_zlib = xyes ; then
AC_DEFINE(WITH_ZLIB)
fi
# The kerberos libraries are needed only to support the
# krb-check-passwd program, so we put them $KRB_LIBS, not in the
# ordinary $LIBS.
if test x$enable_kerberos = xyes; then
AC_CHECK_KRB_LIB(roken, strlcpy)
AC_CHECK_KRB_LIB(resolv, dn_expand)
AC_CHECK_KRB_LIB(des, des_cbc_encrypt)
AC_CHECK_KRB_LIB(asn1, der_get_octet_string)
AC_CHECK_KRB_LIB(krb5, krb5_cc_gen_new,, [enable_kerberos=no])
fi
AH_TEMPLATE([WITH_KERBEROS], [For kerberos])
if test x$enable_kerberos = xyes; then
AC_DEFINE(WITH_KERBEROS)
KRB_PROGRAM=lsh-krb-checkpw
fi
AC_SUBST(KRB_LIBS)
AC_SUBST(KRB_PROGRAM)
AH_TEMPLATE([WITH_GCOV], [Use gcov])
if test "x$enable_gcov" = "xyes"; then
CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
AC_DEFINE(WITH_GCOV)
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Needed by the supplied memcmp.c
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
# FIXME: We should check that a pid_t fits in an int
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(select socket strerror strsignal strtol)
AC_CHECK_FUNCS(getrusage gettimeofday)
AC_CHECK_FUNCS(getspnam)
AC_CHECK_FUNCS(vsnprintf inet_aton)
AC_CHECK_FUNCS(openpty)
AC_CHECK_FUNCS(cfmakeraw)
AC_CHECK_FUNCS(logwtmp login logout)
AC_CHECK_FUNCS(getaddrinfo getnameinfo gai_strerror)
AC_FUNC_GETPGRP
AC_CHECK_FUNCS(syslog)
AC_REPLACE_FUNCS(memxor)
# FIXME: Is there a better way in autoconf 2.50?
AC_CACHE_CHECK([if netdb.h defines AI_NUMERICHOST],
lsh_cv_sys_ai_numerichost,
[AC_EGREP_CPP(yes,
[#include <netdb.h>
#ifdef AI_NUMERICHOST
yes
#endif
], lsh_cv_sys_ai_numerichost=yes,
lsh_cv_sys_ai_numerichost=no)])
AH_TEMPLATE([HAVE_AI_NUMERICHOST], [Define if AI_NUMERICHOST exists])
if test x$lsh_cv_sys_ai_numerichost = xyes ; then
AC_DEFINE(HAVE_AI_NUMERICHOST)
fi
AC_CHECK_FUNCS(poll,,[LIBOBJS="jpoll.o $LIBOBJS"])
# Test if the libc includes a good enough argp.
if test x$with_system_argp = xyes ; then
AC_LIB_ARGP(,with_system_argp=no)
fi
# We don't use LIBOBJS for this, as the LIBOBJS are added to
# liblsh.a, and we can't add an archive to an archive.
LIBARGP=""
if test x$with_system_argp = xno ; then
# FIXME: Perhaps it's better to use an absolute path?
LIBARGP="argp/libargp.a"
fi
AC_SUBST(LIBARGP)
# Check for broken shutdown
AC_CACHE_CHECK(for working shutdown on AF_UNIX sockets,
lsh_cv_func_shutdown_works_on_unix_sockets,
[
AC_TRY_RUN([
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
/* Creates a one-way socket connection. Returns 1 on success, 0 on
* failure. fds[0] is for reading, fds[1] for writing (like for the
* pipe() system call). */
static int make_pipe(int *fds)
{
#ifndef SHUT_RD
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
#endif
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0)
{
fprintf(stderr, "socketpair() failed: %s\n", strerror(errno));
return 0;
}
fprintf(stderr, "Created socket pair. Using fd:s %d <-- %d\n", fds[0], fds[1]);
if(shutdown(fds[0], SHUT_WR) < 0)
{
fprintf(stderr, "shutdown(%d, SHUT_WR) failed: %s\n",
fds[0], strerror(errno));
return 0;
}
if (shutdown(fds[1], SHUT_RD) < 0)
{
fprintf(stderr, "shutdown(%d, SHUT_RD) failed: %s\n",
fds[1], strerror(errno));
return 0;
}
return 1;
}
int main(int argc, char **argv)
{
int fds[2];
if (!make_pipe(fds))
exit(1);
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
{
fprintf(stderr, "signal failed.\n");
exit(1);
}
if ( (write(fds[1], "foo", 3) < 0)
&& (errno == EPIPE))
exit(1);
exit(0);
}
], lsh_cv_func_shutdown_works_on_unix_sockets=yes,
lsh_cv_func_shutdown_works_on_unix_sockets=no,
lsh_cv_func_shutdown_works_on_unix_sockets=yes)])
AH_TEMPLATE([SHUTDOWN_WORKS_WITH_UNIX_SOCKETS],
[Define to indicate that shutdown seems to work properly])
if test x$lsh_cv_func_shutdown_works_on_unix_sockets = xyes ; then
AC_DEFINE(SHUTDOWN_WORKS_WITH_UNIX_SOCKETS)
fi
AC_CACHE_CHECK(
[for working UNIX98 ptys],
lsh_cv_sys_unix98_ptys,
AC_TRY_RUN([
/* Try to obtain a working UNIX98-style pty master and slave */
/* Based on example code from the GNU C library documentation */
#include <stdlib.h> /* EXIT_FAILURE, EXIT_SUCCESS, ptsname */
#include <unistd.h> /* close(2) */
#include <sys/types.h> /* open(2) */
#include <sys/stat.h> /* - " - */
#ifdef HAVE_FCNTL_H
# include <fcntl.h> /* - " - */
#endif
#ifdef HAVE_STROPTS_H
# include <stropts.h> /* isastream() */
#endif
int main(int argc, char* argv[]) {
int master, slave;
char *name;
master = open("/dev/ptmx", O_RDWR); /* PTY master multiplex */
if (master < 0) {
exit(EXIT_FAILURE);
}
if (grantpt(master) < 0 || unlockpt(master) < 0)
goto close_master;
name = ptsname(master);
if (name == NULL)
goto close_master;
slave = open(name, O_RDWR);
if (slave == -1)
goto close_master;
#ifdef HAVE_STROPTS_H
if (isastream(slave))
{
if (ioctl(slave, I_PUSH, "ptem") < 0
|| ioctl(slave, I_PUSH, "ldterm") < 0)
goto close_slave;
}
#endif
exit(0);
close_slave:
close (slave);
close_master:
close (master);
exit(1);
}
],
[lsh_cv_sys_unix98_ptys=yes],
[lsh_cv_sys_unix98_ptys=no],
# Pessimistic default for cross compilation.
[lsh_cv_sys_unix98_ptys=no]))
AH_TEMPLATE([HAVE_UNIX98_PTYS],
[Define if a we have working UNIX98 pty handling])
if test x$lsh_cv_sys_unix98_ptys = xyes; then
AC_DEFINE(HAVE_UNIX98_PTYS)
fi
# Check for gcc's __attribute__ construction
AC_CACHE_CHECK(for __attribute__,
lsh_cv_c_attribute,
[ AC_TRY_COMPILE([
#include <stdlib.h>
],
[
static void foo(void) __attribute__ ((noreturn));
static void __attribute__ ((noreturn))
foo(void)
{
exit(1);
}
],
lsh_cv_c_attribute=yes,
lsh_cv_c_attribute=no)])
AH_TEMPLATE([HAVE_GCC_ATTRIBUTE], [Define if the compiler understands __attribute__])
if test "x$lsh_cv_c_attribute" = "xyes"; then
AC_DEFINE(HAVE_GCC_ATTRIBUTE)
fi
# Check for gcc's __FUNCTION__ variable
AC_CACHE_CHECK(for __FUNCTION__,
lsh_cv_c_FUNCTION,
[ AC_TRY_COMPILE(,
[ void foo(void) { char c = __FUNCTION__[0]; } ],
lsh_cv_c_FUNCTION=yes,
lsh_cv_c_FUNCTION=no)])
AH_TEMPLATE([HAVE_GCC_FUNCTION],
[Define if the compiler understands __FUNCTION__])
if test "x$lsh_cv_c_FUNCTION" = "xyes"; then
AC_DEFINE(HAVE_GCC_FUNCTION)
fi
AC_MSG_CHECKING(for BSD pty names)
AH_TEMPLATE([PTY_BSD_SCHEME_FIRST_CHARS],
[Possible first characters in a /dev/ptyXX name])
AH_TEMPLATE([PTY_BSD_SCHEME_SECOND_CHARS],
[Possible second characters in a /dev/ptyXX name])
# FIXME: What is most portable, tr -d '\n' or tr -d '\012' ?
AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_FIRST_CHARS, "`ls /dev/pty* | cut -c 9-9 | uniq | tr -d '\n'`")
AC_DEFINE_UNQUOTED(PTY_BSD_SCHEME_SECOND_CHARS, "`ls /dev/pty* | cut -c 10-10 | sort | uniq | tr -d '\n'`")
# FIXME: How can we test if the bsd scheme is likely to work?
AH_TEMPLATE([PTY_BSD_SCHEME], [Traditional BSD pty handling])
AC_DEFINE(PTY_BSD_SCHEME)
AC_MSG_RESULT([done])
# IPv6 support
if test x$enable_ipv6 = xyes ; then
AC_CACHE_CHECK([if IPv6 is supported],
lsh_cv_sys_ipv6,
[AC_TRY_RUN([/* AF_INET6 avalable check */
#include <sys/types.h>
#include <sys/socket.h>
int main(int argc, char **argv)
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
}
], lsh_cv_sys_ipv6=yes,
lsh_cv_sys_ipv6=no,
lsh_cv_sys_ipv6=no)])
if test x$lsh_cv_sys_ipv6 != xyes ; then
enable_ipv6=no
elif test x$ac_cv_func_getaddrinfo != xyes ; then
AC_MSG_WARN([getaddrinfo not found. Disabling IPv6 support])
enable_ipv6=no
elif test x$ac_cv_func_gai_strerror != xyes ; then
AC_MSG_WARN([gai_strerror not found. Disabling IPv6 support])
enable_ipv6=no
elif test x$lsh_cv_sys_ai_numerichost != xyes ; then
AC_MSG_WARN([AI_NUMERICHOST not defined. Disabling IPv6 support])
enable_ipv6=no
fi
fi
AH_TEMPLATE([WITH_IPV6], [For Ipv6 support])
if test x$enable_ipv6 = xyes ; then
AC_DEFINE(WITH_IPV6)
fi
AC_CONFIG_SUBDIRS(src/argp)
AC_CONFIG_SUBDIRS(src/nettle)
AC_CONFIG_SUBDIRS(src/sftp)
# Set these flags *last*, or else the test programs won't compile
if test x$GCC = xyes ; then
CFLAGS="$CFLAGS -ggdb3 -Wall -W \
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
-Waggregate-return \
-Wpointer-arith -Wbad-function-cast -Wnested-externs"
# Don't enable -Wcast-align as it results in tons of warnings in the
# DES code. And when using stdio.
fi
AC_CONFIG_FILES([Makefile doc/Makefile misc/Makefile
src/Makefile src/scm/Makefile
src/testsuite/Makefile src/rsync/Makefile
src/nettle/Makefile
contrib/Makefile contrib/lsh.spec])
AC_OUTPUT

Binary file not shown.

View File

@ -1,179 +0,0 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Process this file with automake to create Makefile.in
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
BASH = @BASH@
CC = @CC@
GROFF = @GROFF@
KRB_LIBS = @KRB_LIBS@
KRB_PROGRAM = @KRB_PROGRAM@
LIBARGP = @LIBARGP@
M4 = @M4@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SCHEME_NAME = @SCHEME_NAME@
SCHEME_PROGRAM = @SCHEME_PROGRAM@
SRP_PROGRAM = @SRP_PROGRAM@
VERSION = @VERSION@
EXTRA_DIST = README lsh.spec.in lsh.spec lshd.rhlinux.init lshd.debian.init
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = contrib
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,50 +0,0 @@
## Automatically generated by make_am, Wed Aug 29 23:52:14 CEST 2001
## Process this file with automake to produce Makefile.in
Makefile.am: Makefile.am.in
(cd $(top_srcdir); ./make_am)
# FIXME: Make this less GNU-make specific
man_MANS=DSA.5 SHA.5 SPKI.5 secsh.5 \
lsh.1 lsh_keygen.1 lsh_writekey.1 lshd.8
# MANPAGES = $(wildcard *.[1-9])
info_TEXINFOS = lsh.texinfo
EXTRA_DIST = HACKING NOTES PORTS TASKLIST \
configuration.txt gateway-mode.txt \
Makefile.am.in $(man_MANS) lsh.html \
srp-spec.nroff srp-spec.txt fixff.sh fixff.pl
# DVIS = $(addsuffix .dvi, $(man_MANS))
# PSS = $(addsuffix .ps, $(man_MANS))
# all: dvi ps
# dvi: $(DVIS)
#
# ps: $(PSS)
all-local: srp-spec.txt lsh.html
%.dvi: %
$(GROFF) -Tdvi -mandoc $< > $@
%.ps: %
$(GROFF) -Tps -mandoc $< > $@
%.txt : %.nroff
$(GROFF) -ms -Tlatin1 $< | perl $(srcdir)/fixff.pl >$@T
test -s $@T && mv -f $@T $@
%.html : %.texinfo
(cd $(srcdir) \
&& $(MAKEINFO) --html --no-split --output $@T $(<F) \
; test -s $@T && mv -f $@T $@)
DISTCLEANFILES = $(DVIS) $(PSS)
include $(top_srcdir)/misc/ctags.mk

Binary file not shown.

View File

@ -1,487 +0,0 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# ctags support. Automake only supports etags. We base our ctags support on
# automake's etags support.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
BASH = @BASH@
CC = @CC@
GROFF = @GROFF@
KRB_LIBS = @KRB_LIBS@
KRB_PROGRAM = @KRB_PROGRAM@
LIBARGP = @LIBARGP@
M4 = @M4@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SCHEME_NAME = @SCHEME_NAME@
SCHEME_PROGRAM = @SCHEME_PROGRAM@
SRP_PROGRAM = @SRP_PROGRAM@
VERSION = @VERSION@
# FIXME: Make this less GNU-make specific
man_MANS = DSA.5 SHA.5 SPKI.5 secsh.5 lsh.1 lsh_keygen.1 lsh_writekey.1 lshd.8
# MANPAGES = $(wildcard *.[1-9])
info_TEXINFOS = lsh.texinfo
EXTRA_DIST = HACKING NOTES PORTS TASKLIST configuration.txt gateway-mode.txt Makefile.am.in $(man_MANS) lsh.html srp-spec.nroff srp-spec.txt fixff.sh fixff.pl
DISTCLEANFILES = $(DVIS) $(PSS)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
TEXI2DVI = texi2dvi
INFO_DEPS = lsh.info
DVIS = lsh.dvi
TEXINFOS = lsh.texinfo
man1dir = $(mandir)/man1
man5dir = $(mandir)/man5
man8dir = $(mandir)/man8
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = Makefile.am Makefile.in TODO texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/misc/ctags.mk
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
lsh.info: lsh.texinfo
lsh.dvi: lsh.texinfo
DVIPS = dvips
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
uninstall-info:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
list='$(INFO_DEPS)'; \
for file in $$list; do \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
d=$(srcdir); \
for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
mostlyclean-aminfo:
-rm -f lsh.aux lsh.cp lsh.cps lsh.dvi lsh.fn lsh.fns lsh.ky lsh.kys \
lsh.ps lsh.log lsh.pg lsh.toc lsh.tp lsh.tps lsh.vr lsh.vrs \
lsh.op lsh.tr lsh.cv lsh.cn
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
cd $(srcdir) && for i in $(INFO_DEPS); do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
rm -f $$i-[0-9]*; \
fi; \
done
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
uninstall-man1:
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
install-man5:
$(mkinstalldirs) $(DESTDIR)$(man5dir)
@list='$(man5_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
done
uninstall-man5:
@list='$(man5_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
rm -f $(DESTDIR)$(man5dir)/$$inst; \
done
install-man8:
$(mkinstalldirs) $(DESTDIR)$(man8dir)
@list='$(man8_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
done
uninstall-man8:
@list='$(man8_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
rm -f $(DESTDIR)$(man8dir)/$$inst; \
done
install-man: $(MANS)
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-man1 install-man5 install-man8
uninstall-man:
@$(NORMAL_UNINSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1 uninstall-man5 uninstall-man8
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info-am: $(INFO_DEPS)
info: info-am
dvi-am: $(DVIS)
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am: install-info-am install-man
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-info uninstall-man
uninstall: uninstall-am
all-am: Makefile $(INFO_DEPS) $(MANS) all-local
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 \
$(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-aminfo clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-aminfo distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \
uninstall-man1 install-man5 uninstall-man5 install-man8 uninstall-man8 \
install-man uninstall-man tags distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-local all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
Makefile.am: Makefile.am.in
(cd $(top_srcdir); ./make_am)
# DVIS = $(addsuffix .dvi, $(man_MANS))
# PSS = $(addsuffix .ps, $(man_MANS))
# all: dvi ps
# dvi: $(DVIS)
#
# ps: $(PSS)
all-local: srp-spec.txt lsh.html
%.dvi: %
$(GROFF) -Tdvi -mandoc $< > $@
%.ps: %
$(GROFF) -Tps -mandoc $< > $@
%.txt : %.nroff
$(GROFF) -ms -Tlatin1 $< | perl $(srcdir)/fixff.pl >$@T
test -s $@T && mv -f $@T $@
%.html : %.texinfo
(cd $(srcdir) \
&& $(MAKEINFO) --html --no-split --output $@T $(<F) \
; test -s $@T && mv -f $@T $@)
.PHONY: ctags-recursive ctags
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) ctags); \
done
ctags: ctags-recursive $(HEADERS) $(SOURCES) $(CONFIG_HEADER) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/tags && tags="$$tags $$here/$$subdir/tags"; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$(CONFIG_HEADER)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && ctags --langmap=c:.c.x -o $$here/tags $(CTAGS_ARGS) $$tags $(CONFIG_HEADER) $$unique $(LISP))
# This treats .h.x files as C files rather than headers, but we can't
# distinguish them from .c.x files with ctags.
# Override the standard distclean-tags target, as this doesn't support `tags'
distclean-tags:
-rm -f TAGS ID tags
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More