diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2002-03-21 22:50:03 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2002-03-21 22:50:03 +0000 |
commit | 7d0310ea40213e1fe5eebeddadeedca89a2e98f7 (patch) | |
tree | aade70b2dd68f6156916710c66e320b31a53e247 | |
parent | cfb697297a38a88a32644685eeda18579af8c09e (diff) |
This commit was manufactured by cvs2svn to create tagvendor/opie/2.4
'opie-vendor-v2_4'.
Notes
Notes:
svn path=/vendor/opie/dist/; revision=92906
svn path=/vendor/opie/2.4/; revision=92908; tag=vendor/opie/2.4
-rw-r--r-- | contrib/opie/config.h | 379 | ||||
-rw-r--r-- | contrib/opie/libmissing/alloca.c | 494 | ||||
-rw-r--r-- | contrib/opie/libmissing/env.c | 141 | ||||
-rw-r--r-- | contrib/opie/libmissing/getcwd.c | 23 | ||||
-rw-r--r-- | contrib/opie/libmissing/getusershell.c | 67 | ||||
-rw-r--r-- | contrib/opie/libmissing/initgroups.c | 129 | ||||
-rw-r--r-- | contrib/opie/libmissing/memcmp.c | 25 | ||||
-rw-r--r-- | contrib/opie/libmissing/memcpy.c | 25 | ||||
-rw-r--r-- | contrib/opie/libmissing/memset.c | 21 | ||||
-rw-r--r-- | contrib/opie/libmissing/sigaddset.c | 36 | ||||
-rw-r--r-- | contrib/opie/libmissing/sigemptyset.c | 23 | ||||
-rw-r--r-- | contrib/opie/libmissing/sigprocmask.c | 68 | ||||
-rw-r--r-- | contrib/opie/libmissing/strchr.c | 24 | ||||
-rw-r--r-- | contrib/opie/libmissing/strerror.c | 34 | ||||
-rw-r--r-- | contrib/opie/libmissing/strncasecmp.c | 30 | ||||
-rw-r--r-- | contrib/opie/libmissing/strrchr.c | 25 | ||||
-rw-r--r-- | contrib/opie/libmissing/sysconf.c | 30 | ||||
-rw-r--r-- | contrib/opie/libmissing/uname.c | 42 | ||||
-rw-r--r-- | contrib/opie/logwtmp.c | 154 | ||||
-rw-r--r-- | contrib/opie/options.h | 85 |
20 files changed, 0 insertions, 1855 deletions
diff --git a/contrib/opie/config.h b/contrib/opie/config.h deleted file mode 100644 index 0f6fd1c51533..000000000000 --- a/contrib/opie/config.h +++ /dev/null @@ -1,379 +0,0 @@ -/* config.h. Generated automatically by configure. */ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* #undef _ALL_SOURCE */ -#endif - -/* 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 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). */ -/* #undef HAVE_ALLOCA_H */ - -/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 - -/* Define if on MINIX. */ -/* #undef _MINIX */ - -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define if you need to in order for stat and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* 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 want the FTP daemon to support anonymous logins. */ -/* #undef DOANONYMOUS */ - -/* The default value of the PATH environment variable */ -#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin" - -/* Defined if the file /etc/default/login exists - (and, presumably, should be looked at by login) */ -/* #undef HAVE_ETC_DEFAULT_LOGIN */ - -/* Defined to the name of a file that contains a list of files whose - permissions and ownerships should be changed on login. */ -/* #undef HAVE_LOGIN_PERMFILE */ - -/* Defined to the name of a file that contains a list of environment - values that should be set on login. */ -/* #undef HAVE_LOGIN_ENVFILE */ - -/* Defined if the file /etc/securetty exists - (and, presumably, should be looked at by login) */ -/* #undef HAVE_SECURETTY */ - -/* Defined if the file /etc/shadow exists - (and, presumably, should be looked at for shadow passwords) */ -/* #undef HAVE_ETC_SHADOW */ - -/* The path to the access file, if we're going to use it */ -/* #undef PATH_ACCESS_FILE */ - -/* The path to the mail spool, if we know it */ -#define PATH_MAIL "/var/mail" - -/* The path to the utmp file, if we know it */ -#define PATH_UTMP_AC "/var/run/utmp" - -/* The path to the wtmp file, if we know it */ -#define PATH_WTMP_AC "/var/log/wtmp" - -/* The path to the wtmpx file, if we know it */ -/* #undef PATH_WTMPX_AC */ - -/* Defined if the system's profile (/etc/profile) displays - the motd file */ -/* #undef HAVE_MOTD_IN_PROFILE */ - -/* Defined if the system's profile (/etc/profile) informs the - user of new mail */ -/* #undef HAVE_MAILCHECK_IN_PROFILE */ - -/* Define if you have a nonstandard gettimeofday() that takes one argument - instead of two. */ -/* #undef HAVE_ONE_ARG_GETTIMEOFDAY */ - -/* Define if the system has the getenv function */ -#define HAVE_GETENV 1 - -/* Define if the system has the setenv function */ -#define HAVE_SETENV 1 - -/* Define if the system has the /var/adm/sulog file */ -/* #undef HAVE_SULOG */ - -/* Define if the system has the unsetenv function */ -#define HAVE_UNSETENV 1 - -/* Define if the compiler can handle ANSI-style argument lists */ -#define HAVE_ANSIDECL 1 - -/* Define if the compiler can handle ANSI-style prototypes */ -#define HAVE_ANSIPROTO 1 - -/* Define if the system has an ANSI-style printf (returns int instead of char *) */ -#define HAVE_ANSISPRINTF 1 - -/* Define if the compiler can handle ANSI-style variable argument lists */ -#define HAVE_ANSISTDARG 1 - -/* Define if the compiler can handle void argument lists to functions */ -#define HAVE_VOIDARG 1 - -/* Define if the compiler can handle void return "values" from functions */ -#define HAVE_VOIDRET 1 - -/* Define if the compiler can handle void pointers to our liking */ -#define HAVE_VOIDPTR 1 - -/* Define if the /bin/ls command seems to support the -g flag */ -/* #undef HAVE_LS_G_FLAG */ - -/* Define if there is a ut_pid field in struct utmp */ -/* #undef HAVE_UT_PID */ - -/* Define if there is a ut_type field in struct utmp */ -/* #undef HAVE_UT_TYPE */ - -/* Define if there is a ut_name field in struct utmp */ -#define HAVE_UT_NAME 1 - -/* Define if there is a ut_host field in struct utmp */ -#define HAVE_UT_HOST 1 - -/* Define if the system has getutline() */ -/* #undef HAVE_GETUTLINE */ - -/* Defined if the system has SunOS C2 security shadow passwords */ -/* #undef HAVE_SUNOS_C2_SHADOW */ - -/* Defined if you want to disable utmp support */ -/* #undef DISABLE_UTMP */ - -/* Defined if you want to allow users to override the insecure checks */ -/* #undef INSECURE_OVERRIDE */ - -/* Defined to the default hash value, always defined */ -#define MDX 5 - -/* Defined if new-style prompts are to be used */ -#define NEW_PROMPTS 1 - -/* Defined to the path of the OPIE lock directory */ -#define OPIE_LOCK_DIR "/etc/opielocks" - -/* Defined if users are to be asked to re-type secret pass phrases */ -/* #undef RETYPE */ - -/* Defined if su should not switch to disabled accounts */ -/* #undef SU_STAR_CHECK */ - -/* Defined if user locking is to be used */ -#define USER_LOCKING 1 - -/* Define if you have the bcopy function. */ -/* #undef HAVE_BCOPY */ - -/* Define if you have the bzero function. */ -/* #undef HAVE_BZERO */ - -/* Define if you have the endspent function. */ -/* #undef HAVE_ENDSPENT */ - -/* Define if you have the fpurge function. */ -#define HAVE_FPURGE 1 - -/* Define if you have the getdtablesize function. */ -/* #undef HAVE_GETDTABLESIZE */ - -/* Define if you have the getgroups function. */ -#define HAVE_GETGROUPS 1 - -/* Define if you have the gethostname function. */ -/* #undef HAVE_GETHOSTNAME */ - -/* 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 getttynam function. */ -#define HAVE_GETTTYNAM 1 - -/* Define if you have the getusershell function. */ -#define HAVE_GETUSERSHELL 1 - -/* Define if you have the getutxline function. */ -/* #undef HAVE_GETUTXLINE */ - -/* Define if you have the getwd function. */ -/* #undef HAVE_GETWD */ - -/* Define if you have the index function. */ -/* #undef HAVE_INDEX */ - -/* Define if you have the lstat function. */ -#define HAVE_LSTAT 1 - -/* Define if you have the on_exit function. */ -/* #undef HAVE_ON_EXIT */ - -/* Define if you have the pututxline function. */ -/* #undef HAVE_PUTUTXLINE */ - -/* Define if you have the rindex function. */ -/* #undef HAVE_RINDEX */ - -/* Define if you have the setgroups function. */ -#define HAVE_SETGROUPS 1 - -/* Define if you have the setlogin function. */ -#define HAVE_SETLOGIN 1 - -/* Define if you have the setpriority function. */ -#define HAVE_SETPRIORITY 1 - -/* Define if you have the setregid function. */ -/* #undef HAVE_SETREGID */ - -/* Define if you have the setresgid function. */ -/* #undef HAVE_SETRESGID */ - -/* Define if you have the setresuid function. */ -/* #undef HAVE_SETRESUID */ - -/* Define if you have the setreuid function. */ -/* #undef HAVE_SETREUID */ - -/* Define if you have the setvbuf function. */ -#define HAVE_SETVBUF 1 - -/* Define if you have the sigaddset function. */ -#define HAVE_SIGADDSET 1 - -/* Define if you have the sigblock function. */ -/* #undef HAVE_SIGBLOCK */ - -/* Define if you have the sigemptyset function. */ -#define HAVE_SIGEMPTYSET 1 - -/* Define if you have the sigsetmask function. */ -/* #undef HAVE_SIGSETMASK */ - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have the strncasecmp function. */ -#define HAVE_STRNCASECMP 1 - -/* Define if you have the strstr function. */ -#define HAVE_STRSTR 1 - -/* Define if you have the ttyslot function. */ -#define HAVE_TTYSLOT 1 - -/* Define if you have the usleep function. */ -#define HAVE_USLEEP 1 - -/* Define if you have the <crypt.h> header file. */ -/* #undef HAVE_CRYPT_H */ - -/* Define if you have the <dirent.h> header file. */ -#define HAVE_DIRENT_H 1 - -/* Define if you have the <fcntl.h> header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the <lastlog.h> header file. */ -/* #undef HAVE_LASTLOG_H */ - -/* Define if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the <ndir.h> header file. */ -/* #undef HAVE_NDIR_H */ - -/* Define if you have the <paths.h> header file. */ -#define HAVE_PATHS_H 1 - -/* Define if you have the <pwd.h> header file. */ -#define HAVE_PWD_H 1 - -/* Define if you have the <shadow.h> header file. */ -/* #undef HAVE_SHADOW_H */ - -/* Define if you have the <signal.h> header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the <sys/dir.h> header file. */ -/* #undef HAVE_SYS_DIR_H */ - -/* Define if you have the <sys/file.h> header file. */ -#define HAVE_SYS_FILE_H 1 - -/* Define if you have the <sys/ioctl.h> header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define if you have the <sys/ndir.h> header file. */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define if you have the <sys/param.h> header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define if you have the <sys/select.h> header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define if you have the <sys/signal.h> header file. */ -#define HAVE_SYS_SIGNAL_H 1 - -/* Define if you have the <sys/time.h> header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define if you have the <sys/utsname.h> header file. */ -#define HAVE_SYS_UTSNAME_H 1 - -/* Define if you have the <syslog.h> header file. */ -#define HAVE_SYSLOG_H 1 - -/* Define if you have the <termios.h> header file. */ -#define HAVE_TERMIOS_H 1 - -/* Define if you have the <unistd.h> header file. */ -#define HAVE_UNISTD_H 1 - -/* Define if you have the <utmpx.h> header file. */ -/* #undef HAVE_UTMPX_H */ - -/* Define if you have the crypt library (-lcrypt). */ -#define HAVE_LIBCRYPT 1 - -/* Define if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define if you have the posix library (-lposix). */ -/* #undef HAVE_LIBPOSIX */ - -/* Define if you have the socket library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ diff --git a/contrib/opie/libmissing/alloca.c b/contrib/opie/libmissing/alloca.c deleted file mode 100644 index 61f2eeb9d96d..000000000000 --- a/contrib/opie/libmissing/alloca.c +++ /dev/null @@ -1,494 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant <jot@cray.com> contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifdef emacs -#include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. */ -#if !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -#ifndef alloca - -#ifdef emacs -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -#else -#define ADDRESS_FUNCTION(arg) &(arg) -#endif - -#if __STDC__ -typedef void *pointer; -#else -typedef char *pointer; -#endif - -#define NULL 0 - -/* Different portions of Emacs need to call different versions of - malloc. The Emacs executable needs alloca to call xmalloc, because - ordinary malloc isn't protected from input signals. On the other - hand, the utilities in lib-src need alloca to call malloc; some of - them are very simple, and don't have an xmalloc routine. - - Non-Emacs programs expect this to call use xmalloc. - - Callers below should use malloc. */ - -#if 0 -#ifndef emacs -#define malloc xmalloc -#endif -extern pointer malloc (); -#endif /* 0 */ - -/* Define STACK_DIRECTION 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 */ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* Direction unknown. */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -#else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -#define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -#endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - unsigned size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -#ifdef emacs - BLOCK_INPUT; -#endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -#ifdef emacs - UNBLOCK_INPUT; -#endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = malloc (sizeof (header) + size); - /* Address of header. */ - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) - -#ifdef DEBUG_I00AFUNC -#include <stdio.h> -#endif - -#ifndef CRAY_STACK -#define CRAY_STACK -#ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -#else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -#endif /* CRAY2 */ -#endif /* not CRAY_STACK */ - -#ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -#else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -#endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -#endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -#endif /* not CRAY2 */ -#endif /* CRAY */ - -#endif /* no alloca */ -#endif /* not GCC version 2 */ diff --git a/contrib/opie/libmissing/env.c b/contrib/opie/libmissing/env.c deleted file mode 100644 index 9a445a084931..000000000000 --- a/contrib/opie/libmissing/env.c +++ /dev/null @@ -1,141 +0,0 @@ -/* env.c: Replacement environment handling functions. - -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights -Reserved. The Inner Net License Version 2 applies to these portions of -the software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - -Portions of this software are Copyright 1995 by Randall Atkinson and Dan -McDonald, All Rights Reserved. All Rights under this copyright are assigned -to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and -License Agreement applies to this software. - - History: - - Modified by cmetz for OPIE 2.2. Changed ifdefs for libmissing. - Combined all env functions and made _findenv static. - Including headers is a good idea, though. Add more headers. - Modified at NRL for OPIE 2.0. - Originally from BSD. -*/ -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include "opie_cfg.h" -#include <stdio.h> -#if HAVE_UNISTD_H -#include <unistd.h> -#endif /* HAVE_UNISTD_H */ -#if HAVE_STDLIB_H -#include <stdlib.h> -#endif /* HAVE_STDLIB_H */ -#include "opie.h" - -static char *_findenv FUNCTION((name, offset), register char *name AND int *offset) -{ - extern char **environ; - register int len; - register char **P, *C; - - for (C = name, len = 0; *C && *C != '='; ++C, ++len); - for (P = environ; *P; ++P) - if (!strncmp(*P, name, len)) - if (*(C = *P + len) == '=') { - *offset = P - environ; - return (++C); - } - return (NULL); -} - -#if !HAVE_GETENV -char *getenv FUNCTION((name), char *name) -{ - int offset; - char *_findenv(); - - return (_findenv(name, &offset)); -} -#endif /* !HAVE_GETENV */ - -#if !HAVE_SETENV -int setenv FUNCTION((name, value, rewrite), char *name AND char *value AND int rewrite) -{ - extern char **environ; - static int alloced; /* if allocated space before */ - register char *C; - int l_value, offset; - - if (*value == '=') /* no `=' in value */ - ++value; - l_value = strlen(value); - if ((C = _findenv(name, &offset))) { /* find if already exists */ - if (!rewrite) - return (0); - if (strlen(C) >= l_value) { /* old larger; copy over */ - while (*C++ = *value++); - return (0); - } - } else { /* create new slot */ - register int cnt; - register char **P; - - for (P = environ, cnt = 0; *P; ++P, ++cnt); - if (alloced) { /* just increase size */ - environ = (char **) realloc((char *) environ, - (u_int) (sizeof(char *) * (cnt + 2))); - - if (!environ) - return (-1); - } else { /* get new space */ - alloced = 1; /* copy old entries into it */ - P = (char **) malloc((u_int) (sizeof(char *) * - (cnt + 2))); - - if (!P) - return (-1); - strncpy(P, environ, cnt * sizeof(char *)); - - environ = P; - } - environ[cnt + 1] = NULL; - offset = cnt; - } - for (C = name; *C && *C != '='; ++C); /* no `=' in name */ - if (!(environ[offset] = /* name + `=' + value */ - malloc((u_int) ((int) (C - name) + l_value + 2)))) - return (-1); - for (C = environ[offset]; (*C = *name++) && *C != '='; ++C); - for (*C++ = '='; *C++ = *value++;); - return (0); -} -#endif /* !HAVE_SETENV */ - -#if !HAVE_UNSETENV -VOIDRET unsetenv FUNCTION((name), char *name) -{ - extern char **environ; - register char **P; - int offset; - - while (_findenv(name, &offset)) /* if set multiple times */ - for (P = &environ[offset];; ++P) - if (!(*P = *(P + 1))) - break; -} -#endif /* !HAVE_UNSETENV */ diff --git a/contrib/opie/libmissing/getcwd.c b/contrib/opie/libmissing/getcwd.c deleted file mode 100644 index 30ccdc0486dd..000000000000 --- a/contrib/opie/libmissing/getcwd.c +++ /dev/null @@ -1,23 +0,0 @@ -/* getcwd.c: A replacement for the getcwd function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.3. -*/ -#include "opie_cfg.h" -#include "opie.h" - -char *getcwd FUNCTION((c, l), char *c AND int l) -{ -#if HAVE_GETWD - return getwd(c); -#else /* HAVE_INDEX */ -#error Need getwd() to build a replacement getcwd() -#endif /* HAVE_INDEX */ -} diff --git a/contrib/opie/libmissing/getusershell.c b/contrib/opie/libmissing/getusershell.c deleted file mode 100644 index 885aa04ffa5f..000000000000 --- a/contrib/opie/libmissing/getusershell.c +++ /dev/null @@ -1,67 +0,0 @@ -/* getusershell.c: minimal implementation of the getusershell() and - endusershell() library routines for systems that don't have them. - -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights -Reserved. The Inner Net License Version 2 applies to these portions of -the software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - -Portions of this software are Copyright 1995 by Randall Atkinson and Dan -McDonald, All Rights Reserved. All Rights under this copyright are assigned -to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and -License Agreement applies to this software. - - History: - - Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. - Modified at NRL for OPIE 2.1. Remove trailing newlines from - /etc/shells entries. Fixed infinite loop. Fixed a bug - where second invocation on would fail. - Written at NRL for OPIE 2.0. -*/ -#include "opie_cfg.h" -#include <stdio.h> -#if HAVE_STRING_H -#include <string.h> -#endif /* HAVE_STRING_H */ -#include "opie.h" - -static FILE *fh = NULL; -static char *internal[] = {"/bin/sh", "/bin/csh", NULL}; -static int i = 0; -static char buffer[1024]; - -char *getusershell FUNCTION_NOARGS -{ - char *c; - - if (!fh) - fh = fopen("/etc/shells", "r"); - - if (fh) { - if (fgets(buffer, sizeof(buffer), fh)) { - if (c = strchr(buffer, '\n')) - *c = 0; - return buffer; - } else { - fclose(fh); - return NULL; - } - } else { - if (internal[i]) - return internal[i++]; - else - return NULL; - } -} - -VOIDRET endusershell FUNCTION_NOARGS -{ - if (fh) { - fclose(fh); - fh = NULL; - } - i = 0; -} diff --git a/contrib/opie/libmissing/initgroups.c b/contrib/opie/libmissing/initgroups.c deleted file mode 100644 index 2306a0c2e922..000000000000 --- a/contrib/opie/libmissing/initgroups.c +++ /dev/null @@ -1,129 +0,0 @@ -/* initgroups.c: Replacement for the initgroups() function. - -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights -Reserved. The Inner Net License Version 2 applies to these portions of -the software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Modified by cmetz for OPIE 2.2. Removed useless string. - Ifdef around headers. Use FUNCTION declarations. - Not everyone has multiple groups. Work around - lack of NGROUPS. - Originally from 4.3BSD Net/2. -*/ -/* - * Copyright (c) 1983 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. - */ - -/* - * initgroups - */ -#include "opie_cfg.h" - -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif /* HAVE_SYS_PARAM_H */ -#include <stdio.h> -#if HAVE_STRING_H -#include <string.h> -#endif /* HAVE_STRING */ -#if HAVE_UNISTD_H -#include <unistd.h> -#endif /* HAVE_UNISTD_H */ -#include <grp.h> - -#include "opie.h" - -struct group *getgrent(); - -int initgroups FUNCTION((uname, agroup), const char *uname AND int agroup) -{ -#if HAVE_SETGROUPS && HAVE_GETGROUPS -#if NGROUPS - int groups[NGROUPS]; -#else /* NGROUPS */ -#define STARTING_NGROUPS 32 - int groups[STARTING_NGROUPS]; -#endif /* NGROUPS */ - int ngroups; - register struct group *grp; - register int i; - - /* - * If installing primary group, duplicate it; - * the first element of groups is the effective gid - * and will be overwritten when a setgid file is executed. - */ - if (agroup >= 0) { - groups[ngroups++] = agroup; - groups[ngroups++] = agroup; - } - setgrent(); - while (grp = getgrent()) { - if (grp->gr_gid == agroup) - continue; - for (i = 0; grp->gr_mem[i]; i++) - if (!strcmp(grp->gr_mem[i], uname)) { -#if NGROUPS - if (ngroups == NGROUPS) { -#else /* NGROUPS */ - if (ngroups == STARTING_NGROUPS) { -#endif /* NGROUPS */ -fprintf(stderr, "initgroups: %s is in too many groups\n", uname); - goto toomany; - } - groups[ngroups++] = grp->gr_gid; - } - } -toomany: - endgrent(); -#if NGROUPS - if (setgroups(ngroups, groups) < 0) { - perror("setgroups"); - return (-1); - } -#else /* NGROUPS */ - ngroups++; - do { - if ((i = setgroups(--ngroups, groups) < 0) && (i != EINVAL)) { - perror("setgroups"); - return (-1); - } - } while ((i < 0) && (ngroups > 0)); -#endif /* NGROUPS */ -#endif /* HAVE_SETGROUPS && HAVE_GETGROUPS */ - return (0); -} diff --git a/contrib/opie/libmissing/memcmp.c b/contrib/opie/libmissing/memcmp.c deleted file mode 100644 index e19beafcdb95..000000000000 --- a/contrib/opie/libmissing/memcmp.c +++ /dev/null @@ -1,25 +0,0 @@ -/* strncasecmp.c: A replacement for the strncasecmp function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ -#include "opie_cfg.h" -#include "opie.h" - -int memcmp FUNCTION((s1, s2, n), unsigned char *s1 AND unsigned char *s2 AND int n) -{ - while(n--) { - if (*s1 != *s2) - return (*s1 > *s2) ? 1 : -1; - s1++; - s2++; - } - return 0; -} diff --git a/contrib/opie/libmissing/memcpy.c b/contrib/opie/libmissing/memcpy.c deleted file mode 100644 index 6d386c2d3242..000000000000 --- a/contrib/opie/libmissing/memcpy.c +++ /dev/null @@ -1,25 +0,0 @@ -/* memcpy.c: A replacement for the memcpy function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ -#include "opie_cfg.h" -#include "opie.h" - -VOIDPTR *memcpy FUNCTION((d, s, n), unsigned char *d AND unsigned char *s AND int n) -{ -#if HAVE_BCOPY - bcopy(s, d, n); -#else /* HAVE_BCOPY */ - char *d2 = d; - while(n--) (*d2++) = (*s++); -#endif /* HAVE_BCOPY */ - return d; -} diff --git a/contrib/opie/libmissing/memset.c b/contrib/opie/libmissing/memset.c deleted file mode 100644 index 678c4411e64f..000000000000 --- a/contrib/opie/libmissing/memset.c +++ /dev/null @@ -1,21 +0,0 @@ -/* memcpy.c: A replacement for the memcpy function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ -#include "opie_cfg.h" -#include "opie.h" - -VOIDPTR *memset FUNCTION((d, v, n), unsigned char *d AND int v AND int n) -{ - unsigned char *d2 = d; - while(n--) (*d2++) = (unsigned char)v; - return d; -} diff --git a/contrib/opie/libmissing/sigaddset.c b/contrib/opie/libmissing/sigaddset.c deleted file mode 100644 index 56a613bf68c9..000000000000 --- a/contrib/opie/libmissing/sigaddset.c +++ /dev/null @@ -1,36 +0,0 @@ -/* sigaddset.c: A replacement for the sigaddset function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ - -#include "opie_cfg.h" - -#ifndef _NSIG -#ifdef NSIG -#define _NSIG NSIG -#else /* NSIG */ -#define _NSIG 32 -#endif /* NSIG */ -#endif /* _NSIG */ - -#include "opie.h" - -int sigaddset FUNCTION((set, signum), sigset_t *set AND int signum) -{ -#if sizeof(sigset_t) != sizeof(int) -Sorry, we don't currently support your system. -#else /* sizeof(sigset_t) != sizeof(int) */ - if (set && (signum > 0) && (signum < _NSIG)) - *set |= 1 << (signum - 1); -#endif /* sizeof(sigset_t) != sizeof(int) */ - - return 0; -} diff --git a/contrib/opie/libmissing/sigemptyset.c b/contrib/opie/libmissing/sigemptyset.c deleted file mode 100644 index fc083f50ddc8..000000000000 --- a/contrib/opie/libmissing/sigemptyset.c +++ /dev/null @@ -1,23 +0,0 @@ -/* sigemptyset.c: A replacement for the sigemptyset function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ - -#include "opie_cfg.h" -#include "opie.h" - -int sigemptyset FUNCTION((set), sigset_t *set) -{ - if (set) - memset(set, 0, sizeof(sigset_t)) - - return 0; -} diff --git a/contrib/opie/libmissing/sigprocmask.c b/contrib/opie/libmissing/sigprocmask.c deleted file mode 100644 index 4af1559cbe71..000000000000 --- a/contrib/opie/libmissing/sigprocmask.c +++ /dev/null @@ -1,68 +0,0 @@ -/* sigprocmask.c: A replacement for the sigprocmask() function - -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights -Reserved. The Inner Net License Version 2 applies to these portions of -the software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - -Portions of this software are Copyright 1995 by Randall Atkinson and Dan -McDonald, All Rights Reserved. All Rights under this copyright are assigned -to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and -License Agreement applies to this software. - - History: - - Created by cmetz for OPIE 2.2 from popen.c. Use FUNCTION - declaration et al. Include opie.h. -*/ - -#include "opie_cfg.h" - -#include <sys/types.h> -#if HAVE_SIGNAL_H -#include <signal.h> -#endif /* HAVE_SIGNAL_H */ -#if HAVE_SYS_SIGNAL_H -#include <sys/signal.h> -#endif /* HAVE_SYS_SIGNAL_H */ - -#if !HAVE_SIGBLOCK || !HAVE_SIGSETMASK -Without sigblock and sigsetmask, we can't build a replacement sigprocmask. -#endif /* !HAVE_SIGBLOCK || !HAVE_SIGSETMASK */ - -#include "opie.h" - -#ifndef sigset_t -#define sigset_t int -#endif /* sigset_t */ - -int sigprocmask FUNCTION((how, set, oset), int how AND sigset_t *set AND sigset_t *oset) -{ - int old, new; - - if (set && (set != (sigset_t *)SIG_IGN) && (set != (sigset_t *)SIG_ERR)) - new = *set; - else - new = 0; - - switch(how) { - case SIG_BLOCK: - old = sigblock(new); - if (oset && (oset != (sigset_t *)SIG_IGN) && (oset != (sigset_t *)SIG_ERR)) - *oset = old; - return 0; - - case SIG_SETMASK: - old = sigsetmask(new); - if (oset && (oset != (sigset_t *)SIG_IGN) && (oset != (sigset_t *)SIG_ERR)) - *oset = old; - return 0; - - case SIG_UNBLOCK: - /* not implemented */ - default: - return 0; - } -} diff --git a/contrib/opie/libmissing/strchr.c b/contrib/opie/libmissing/strchr.c deleted file mode 100644 index 2903bc4a61f2..000000000000 --- a/contrib/opie/libmissing/strchr.c +++ /dev/null @@ -1,24 +0,0 @@ -/* strchr.c: A replacement for the strchr function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.3. -*/ -#include "opie_cfg.h" -#include "opie.h" - -char *strchr FUNCTION((s, c), char *s AND int c) -{ -#if HAVE_INDEX - return index(s, c); -#else /* HAVE_INDEX */ - while(*s && (*s != c)) s++; - return *s ? s : (char *)0; -#endif /* HAVE_INDEX */ -} diff --git a/contrib/opie/libmissing/strerror.c b/contrib/opie/libmissing/strerror.c deleted file mode 100644 index 89632f9fe816..000000000000 --- a/contrib/opie/libmissing/strerror.c +++ /dev/null @@ -1,34 +0,0 @@ -/* strerror.c: A replacement for the strerror function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ - -#include "opie_cfg.h" -#include "opie.h" - -char *strerror FUNCTION((errnum), int errnum) -{ -#if HAVE_SYS_ERRLIST - extern char *sys_errlist[]; - return sys_errlist[errnum]; -#else /* NEED_STRERROR */ -#if HAVE__SYS_ERRLIST - extern char *_sys_errlist[]; - return sys_errlist[errnum]; -#else /* HAVE__SYS_ERRLIST */ - static char hexdigits[] = "0123456789abcdef"; - static char buffer[] = "System error 0x42"; - buffer[15] = hexdigits[(errnum >> 4) & 0x0f]; - buffer[16] = hexdigits[errnum & 0x0f]; - return buffer; -#endif /* HAVE__SYS_ERRLIST */ -#endif /* NEED_STRERROR */ -} diff --git a/contrib/opie/libmissing/strncasecmp.c b/contrib/opie/libmissing/strncasecmp.c deleted file mode 100644 index e90b4c038c86..000000000000 --- a/contrib/opie/libmissing/strncasecmp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* strncasecmp.c: A replacement for the strncasecmp function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.2. -*/ -#include "opie_cfg.h" -#include "opie.h" - -int strncasecmp FUNCTION((s1, s2, n), unsigned char *s1 AND unsigned char *s2 AND int n) -{ - unsigned char c1, c2; - while(*s1 && *s2 && n--) { - c1 = ((*s1 >= 'A') && (*s1 <= 'Z')) ? (*s1++) + ('a' - 'A') : (*s1++); - c2 = ((*s2 >= 'A') && (*s2 <= 'Z')) ? (*s2++) + ('a' - 'A') : (*s2++); - if (c1 != c2) - return (c1 > c2) ? 1 : -1; - } - if (*s1 && !*s2) - return 1; - if (!*s1 && *s2) - return -1; - return 0; -} diff --git a/contrib/opie/libmissing/strrchr.c b/contrib/opie/libmissing/strrchr.c deleted file mode 100644 index 04d46cef3e08..000000000000 --- a/contrib/opie/libmissing/strrchr.c +++ /dev/null @@ -1,25 +0,0 @@ -/* strrchr.c: A replacement for the strrchr function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.3. -*/ -#include "opie_cfg.h" -#include "opie.h" - -char *strrchr FUNCTION((s, c), char *s AND int c) -{ -#if HAVE_RINDEX - return rindex(s, c); -#else /* HAVE_RINDEX */ - char *s2 = (char *)0; - while(*s) { if (*s == c) s2 = s; s++ }; - return s2; -#endif /* HAVE_RINDEX */ -} diff --git a/contrib/opie/libmissing/sysconf.c b/contrib/opie/libmissing/sysconf.c deleted file mode 100644 index fb3a5bc75a54..000000000000 --- a/contrib/opie/libmissing/sysconf.c +++ /dev/null @@ -1,30 +0,0 @@ -/* sysconf.c: A (partial) replacement for the sysconf function - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.3. -*/ -#include "opie_cfg.h" -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif /* HAVE_SYS_PARAM_H */ -#include "opie.h" - -long sysconf(int name) -{ - switch(name) { - case _SC_OPEN_MAX: -#if HAVE_GETDTABLESIZE - return getdtablesize(); -#else /* HAVE_GETDTABLESIZE */ -#error Need getdtablesize() to build a replacement sysconf() -#endif /* HAVE_GETDTABLESIZE */ - - return -1; -} diff --git a/contrib/opie/libmissing/uname.c b/contrib/opie/libmissing/uname.c deleted file mode 100644 index 5b51fa55122a..000000000000 --- a/contrib/opie/libmissing/uname.c +++ /dev/null @@ -1,42 +0,0 @@ -/* uname.c: A replacement for the uname function (sort of) - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Modified by cmetz for OPIE 2.3. Ifdef around gethostname(). - Created by cmetz for OPIE 2.2. -*/ -#include "opie_cfg.h" -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif /* HAVE_SYS_PARAM_H */ -#include "opie.h" - -int uname FUNCTION(struct utsname *buf) -{ -#if HAVE_GETHOSTNAME - char hostname[MAXHOSTNAMELEN], *c; - - memset(buf, 0, sizeof(buf)); - - if (gethostname(hostname, sizeof(hostname)-1) < 0) - return -1; - - hostname[sizeof(hostname) - 1] = 0; - - if (c = strchr(hostname, '.')) { - *c = 0; - } - - strncpy(buf->nodename, hostname, sizeof(buf->nodename) - 1); - return 0; -#else /* HAVE_GETHOSTNAME */ - strncpy(buf->nodename, "unknown", sizeof(buf->nodename) - 1); - return 0; -#endif /* HAVE_GETHOSTNAME */ -} diff --git a/contrib/opie/logwtmp.c b/contrib/opie/logwtmp.c deleted file mode 100644 index 4d9dcbf82146..000000000000 --- a/contrib/opie/logwtmp.c +++ /dev/null @@ -1,154 +0,0 @@ -/* logwtmp.c: Put an entry in the wtmp file. - -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights -Reserved. The Inner Net License Version 2 applies to these portions of -the software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - -Portions of this software are Copyright 1995 by Randall Atkinson and Dan -McDonald, All Rights Reserved. All Rights under this copyright are assigned -to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and -License Agreement applies to this software. - - History: - - Modified by cmetz for OPIE 2.22. Call gettimeofday() properly. - Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. - Ifdef around some headers. Added file close hook. - Modified at NRL for OPIE 2.1. Set process type for HPUX. - Modified at NRL for OPIE 2.0. - Originally from BSD. -*/ -/* - * Copyright (c) 1988 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. - * - */ - -#include "opie_cfg.h" - -#include <sys/types.h> -#if HAVE_SYS_TIME_H -#include <sys/time.h> -#endif /* HAVE_SYS_TIME_H */ -#include <sys/stat.h> -#include <fcntl.h> -#include <utmp.h> -#if HAVE_UNISTD_H -#include <unistd.h> -#endif /* HAVE_UNISTD_H */ -#if HAVE_STRING_H -#include <string.h> -#endif /* HAVE_STRING_H */ - -#include "opie.h" - -static int fd = -1; - -#if DOUTMPX -static int fdx = -1; -#include <utmpx.h> -#endif /* DOUTMPX */ - -#ifndef _PATH_WTMP -#define _PATH_WTMP "/usr/adm/wtmp" -#endif - -#ifndef _PATH_WTMPX -#define _PATH_WTMPX "/usr/adm/wtmpx" -#endif /* _PATH_UTMPX */ - -/* - * Modified version of logwtmp that holds wtmp file open - * after first call, for use with ftp (which may chroot - * after login, but before logout). - */ -VOIDRET logwtmp FUNCTION((line, name, host), char *line AND char *name AND char *host) -{ - struct utmp ut; - -#if DOUTMPX - struct utmpx utx; -#endif /* DOUTMPX */ - struct stat buf; - - memset(&ut, 0, sizeof(struct utmp)); - - if (!line) { - close(fd); -#if DOUTMPX - close(fdx); -#endif /* DOUTMPX */ - } - - if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY | O_APPEND, 0)) < 0) - return; - if (fstat(fd, &buf) == 0) { -#if HAVE_UT_TYPE && defined(USER_PROCESS) - ut.ut_type = USER_PROCESS; -#endif /* HAVE_UT_TYPE && defined(USER_PROCESS) */ -#if HAVE_UT_PID - ut.ut_pid = getpid(); -#endif /* HAVE_UT_PID */ - strncpy(ut.ut_line, line, sizeof(ut.ut_line)); - strncpy(ut.ut_name, name, sizeof(ut.ut_name)); -#if !DOUTMPX - strncpy(ut.ut_host, host, sizeof(ut.ut_host)); -#endif /* !DOUTMPX */ - time(&ut.ut_time); - if (write(fd, (char *) &ut, sizeof(struct utmp)) != - sizeof(struct utmp)) - ftruncate(fd, buf.st_size); - } -#if DOUTMPX - memset(&utx, 0, sizeof(struct utmpx)); - - if (fdx < 0 && (fdx = open(WTMPX_FILE, O_WRONLY | O_APPEND, 0)) < 0) - return; - if (fstat(fdx, &buf) == 0) { - strncpy(utx.ut_line, line, sizeof(utx.ut_line)); - strncpy(utx.ut_name, name, sizeof(utx.ut_name)); - strncpy(utx.ut_host, host, sizeof(utx.ut_host)); -#if HAVE_GETTIMEOFDAY -#if HAVE_ONE_ARG_GETTIMEOFDAY - gettimeofday(&utx.ut_tv); -#else /* HAVE_ONE_ARG_GETTIMEOFDAY */ - gettimeofday(&utx.ut_tv, NULL); -#endif /* HAVE_ONE_ARG_GETTIMEOFDAY */ -#endif /* HAVE_GETTIMEOFDAY */ - if (write(fdx, (char *) &utx, sizeof(struct utmpx)) != - sizeof(struct utmpx)) - ftruncate(fdx, buf.st_size); - } -#endif /* DOUTMPX */ -} diff --git a/contrib/opie/options.h b/contrib/opie/options.h deleted file mode 100644 index 05f1e55bbbd0..000000000000 --- a/contrib/opie/options.h +++ /dev/null @@ -1,85 +0,0 @@ -/* options.h: Configuration options the end user might want to tweak. - -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. -The Inner Net License Version 2 applies to this software. -You should have received a copy of the license with this software. If -you didn't get a copy, you may request one from <license@inner.net>. - - History: - - Created by cmetz for OPIE 2.3 using the old Makefile.source as a - guide. -*/ -/* - Which hash should the OPIE server software use? - - We strongly recommend that you use MD5. MD4 is faster, but less secure. -If you are migrating from Bellcore S/Key version 1 and wish to use the -existing key database, you must use MD4. In this case, you should consider -ways to re-key your users using MD5. -*/ - -#define MDX 5 /* Use MD5 */ -/* #define MDX 4 /* Use MD4 */ - -/* - Ask users to re-type their secret pass phrases? - - Doing so helps catch typing mistakes, but some users find it annoying. -*/ - -/* #define RETYPE 1 /* Ask users to re-type their secret pass phrases */ -#define RETYPE 0 /* Don't ask users to re-type their secret pass phrases */ - -/* - Generater lock files to serialize OTP logins? - - There is a potential race attack on OTP when more than one session can -respond to the same challenge at the same time. This locking only allows -one session at a time per principal (user) to attempt to log in using OTP. -The locking, however, creates a denial-of-service attack as a trade-off and -can be annoying if you have a legitimate need for two sessions to attempt -to authenticate as the same principal at the same time. -*/ - -#define USER_LOCKING 1 /* Serialize OTP challenges for a principal */ -/* #define USER_LOCKING 0 /* Don't serialize OTP challenges */ - -/* - Should su(8) refuse to switch to disabled accounts? - - Traditionally, su(8) can switch to any account, even if it is disabled. -In most systems, there is no legitimate need for this capability and it can -create security problems. -*/ - -#define SU_STAR_CHECK 1 /* Refuse to switch to disabled accounts */ -/* #define SU_STAR_CHECK 0 /* Allow switching to disabled accounts */ - -/* - Should OPIE use more informative prompts? - - The new-style, more informative prompts better indicate to the user what -is being asked for. However, some automated login scripts depend on the -wording of some prompts and will fail if you change them. -*/ - -#define NEW_PROMPTS 1 /* Use the more informative prompts */ -/* #define NEW_PROMPTS 0 /* Use the more compatible prompts */ - -/* - Should the user be allowed to override "insecure" terminal checks? - - The "insecure" terminal checks are designed to help make it more clear -to users that they shouldn't disclose their secret over insecure lines -by refusing to accept the secret directly. These checks aren't perfect and -sometimes will cause OPIE to refuse to work when it really should. Allowing -users to override the terminal checks also helps the process of creating -OTP sequences for users. However, allowing users to override the terminal -checks also allows users to shoot themselves in the foot, which isn't usually -what you want. -*/ - -#define INSECURE_OVERRIDE 0 /* Don't allow users to override the checks */ -/* #define INSECURE_OVERRIDE 1 /* Allow users to override the checks */ |