Home | History | Annotate | Line # | Download | only in rpc.pcnfsd
common.h revision 1.2
      1  1.2  gwr /*	$NetBSD: common.h,v 1.2 1995/07/25 22:20:26 gwr Exp $	*/
      2  1.2  gwr 
      3  1.1  jtc /* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.common.h 1.3 91/12/17 14:32:05 SMI */
      4  1.1  jtc /*
      5  1.1  jtc **=====================================================================
      6  1.1  jtc ** Copyright (c) 1986,1987,1988,1989,1990,1991 by Sun Microsystems, Inc.
      7  1.1  jtc **
      8  1.1  jtc **         D I S C L A I M E R   S E C T I O N ,   E T C .
      9  1.1  jtc **
     10  1.1  jtc ** pcnfsd is copyrighted software, but is freely licensed. This
     11  1.1  jtc ** means that you are free to redistribute it, modify it, ship it
     12  1.1  jtc ** in binary with your system, whatever, provided:
     13  1.1  jtc **
     14  1.1  jtc ** - you leave the Sun copyright notice in the source code
     15  1.1  jtc ** - you make clear what changes you have introduced and do
     16  1.1  jtc **   not represent them as being supported by Sun.
     17  1.1  jtc ** - you do not charge money for the source code (unlikely, given
     18  1.1  jtc **   its free availability)
     19  1.1  jtc **
     20  1.1  jtc ** If you make changes to this software, we ask that you do so in
     21  1.1  jtc ** a way which allows you to build either the "standard" version or
     22  1.1  jtc ** your custom version from a single source file. Test it, lint
     23  1.1  jtc ** it (it won't lint 100%, very little does, and there are bugs in
     24  1.1  jtc ** some versions of lint :-), and send it back to Sun via email
     25  1.1  jtc ** so that we can roll it into the source base and redistribute
     26  1.1  jtc ** it. We'll try to make sure your contributions are acknowledged
     27  1.1  jtc ** in the source, but after all these years it's getting hard to
     28  1.1  jtc ** remember who did what.
     29  1.1  jtc **
     30  1.1  jtc ** The main contributors have been (in no special order):
     31  1.1  jtc **
     32  1.1  jtc ** Glen Eustace <G.Eustace (at) massey.ac.nz>
     33  1.1  jtc **    user name caching for b-i-g password files
     34  1.1  jtc ** Paul Emerson <paul (at) sdgsun.uucp>
     35  1.1  jtc **    cleaning up Interactive 386/ix handling, fixing the lp
     36  1.1  jtc **    interface, and generally tidying up the sources
     37  1.1  jtc ** Keith Ericson <keithe (at) sail.labs.tek.com>
     38  1.1  jtc **    more 386/ix fixes
     39  1.1  jtc ** Jeff Stearns <jeff (at) tc.fluke.com>
     40  1.1  jtc **    setuid/setgid for lpr
     41  1.1  jtc ** Peter Van Campen <petervc (at) sci.kun.nl>
     42  1.1  jtc **    fixing setuid/gid stuff, syslog
     43  1.1  jtc ** Ted Nolan <ted (at) usasoc.soc.mil>
     44  1.1  jtc **    /usr/adm/wtmp, other security suggestions
     45  1.1  jtc **
     46  1.1  jtc ** Thanks to everyone who has contributed.
     47  1.1  jtc **
     48  1.1  jtc **    Geoff Arnold, PC-NFS architect <geoff (at) East.Sun.COM>
     49  1.1  jtc **=====================================================================
     50  1.1  jtc */
     51  1.1  jtc /*
     52  1.1  jtc **=====================================================================
     53  1.1  jtc **             C U S T O M I Z A T I O N   S E C T I O N              *
     54  1.1  jtc **                                                                    *
     55  1.1  jtc ** You should not uncomment these #defines in this version of pcnfsd  *
     56  1.1  jtc ** Instead you should edit the makefile CDEFS variable.               *
     57  1.1  jtc **                                                                    *
     58  1.1  jtc **=====================================================================
     59  1.1  jtc */
     60  1.1  jtc 
     61  1.1  jtc /*
     62  1.1  jtc **---------------------------------------------------------------------
     63  1.1  jtc ** Define (via Makefile) the following symbol to enable the use of a
     64  1.1  jtc ** shadow password file
     65  1.1  jtc **---------------------------------------------------------------------
     66  1.1  jtc **/
     67  1.1  jtc 
     68  1.1  jtc /* #define SHADOW_SUPPORT */
     69  1.1  jtc 
     70  1.1  jtc /*
     71  1.1  jtc **---------------------------------------------------------------------
     72  1.1  jtc ** Define (via Makefile) the following symbol to enable the logging
     73  1.1  jtc ** of authentication requests to /usr/adm/wtmp
     74  1.1  jtc **---------------------------------------------------------------------
     75  1.1  jtc **/
     76  1.1  jtc 
     77  1.1  jtc /* #define WTMP */
     78  1.1  jtc 
     79  1.1  jtc /*
     80  1.1  jtc **------------------------------------------------------------------------
     81  1.1  jtc ** Define (via Makefile) the following symbol conform to Interactive
     82  1.1  jtc ** System's 2.0
     83  1.1  jtc **------------------------------------------------------------------------
     84  1.1  jtc */
     85  1.1  jtc 
     86  1.1  jtc /* #define ISC_2_0 */
     87  1.1  jtc 
     88  1.1  jtc /*
     89  1.1  jtc **---------------------------------------------------------------------
     90  1.1  jtc ** Define (via Makefile) the following symbol to use a cache of recently-used
     91  1.1  jtc ** user names. This has certain uses in university and other settings
     92  1.1  jtc ** where (1) the pasword file is very large, and (2) a group of users
     93  1.1  jtc ** frequently logs in together using the same account (for example,
     94  1.1  jtc ** a class userid).
     95  1.1  jtc **---------------------------------------------------------------------
     96  1.1  jtc */
     97  1.1  jtc 
     98  1.1  jtc /* #define USER_CACHE */
     99  1.1  jtc 
    100  1.1  jtc /*
    101  1.1  jtc **---------------------------------------------------------------------
    102  1.1  jtc ** Define (via Makefile) the following symbol to build a System V version
    103  1.1  jtc **---------------------------------------------------------------------
    104  1.1  jtc */
    105  1.1  jtc 
    106  1.1  jtc /* #define SYSV */
    107  1.1  jtc 
    108  1.1  jtc /*
    109  1.1  jtc **---------------------------------------------------------------------
    110  1.1  jtc ** Define (via Makefile) the following symbol to build a version that uses
    111  1.1  jtc ** System V style "lp" instead of BSD-style "lpr" to print
    112  1.1  jtc **---------------------------------------------------------------------
    113  1.1  jtc */
    114  1.1  jtc 
    115  1.1  jtc /* #define USE_LP */
    116  1.1  jtc 
    117  1.1  jtc /*
    118  1.1  jtc **---------------------------------------------------------------------
    119  1.1  jtc ** Define (via Makefile) the following symbol to build a typical
    120  1.1  jtc ** "local feature": in this case recognizing the special printer
    121  1.1  jtc ** names "rotated" and "2column" and using the Adobe "enscript"
    122  1.1  jtc ** command to format the output appropriately.
    123  1.1  jtc **---------------------------------------------------------------------
    124  1.1  jtc */
    125  1.1  jtc 
    126  1.1  jtc /* #define HACK_FOR_ROTATED_TRANSCRIPT */
    127  1.1  jtc 
    128  1.1  jtc /*
    129  1.1  jtc **---------------------------------------------------------------------
    130  1.1  jtc ** Define (via Makefile) the following symbol to build a version that
    131  1.1  jtc ** will use the setusershell()/getusershell()/endusershell() calls
    132  1.1  jtc ** to determine if a password entry contains a legal shell (and therefore
    133  1.1  jtc ** identifies a user who may log in). The default is to check that
    134  1.1  jtc ** the last two characters of the shell field are "sh", which should
    135  1.1  jtc ** cope with "sh", "csh", "ksh", "bash".... See the routine get_pasword()
    136  1.1  jtc ** in pcnfsd_misc.c for more details.
    137  1.1  jtc **
    138  1.1  jtc ** Note: For some reason that I haven't yet figured out, getusershell()
    139  1.1  jtc ** only seems to work when RPC_SVC_FG is defined (for debugging). It doesn't
    140  1.1  jtc ** seem to matter whether /etc/shells exists or not. Tracing
    141  1.1  jtc ** things doesn't throw any light on this....  Geoff Dec.17 '91
    142  1.1  jtc */
    143  1.1  jtc 
    144  1.1  jtc /*
    145  1.1  jtc **---------------------------------------------------------------------
    146  1.1  jtc ** Define (via Makefile) the following symbol to build a version that
    147  1.1  jtc ** will consult the NIS (formerly Yellow Pages) "auto.home" map to
    148  1.1  jtc ** locate the user's home directory (returned by the V2 authentication
    149  1.1  jtc ** procedure).
    150  1.1  jtc **---------------------------------------------------------------------
    151  1.1  jtc */
    152  1.1  jtc 
    153  1.1  jtc /* #define USE_YP */
    154  1.1  jtc 
    155  1.1  jtc 
    156  1.1  jtc /* #define USE_GETUSERSHELL */
    157  1.1  jtc 
    158  1.1  jtc 
    159  1.1  jtc /*
    160  1.1  jtc **---------------------------------------------------------------------
    161  1.1  jtc ** The following should force the right things for Interactive 2.0
    162  1.1  jtc **---------------------------------------------------------------------
    163  1.1  jtc */
    164  1.1  jtc #ifdef ISC_2_0
    165  1.1  jtc #define SYSV
    166  1.1  jtc #define USE_LP
    167  1.1  jtc #define SHADOW_SUPPORT
    168  1.1  jtc #endif
    169  1.1  jtc 
    170  1.1  jtc /*
    171  1.1  jtc **---------------------------------------------------------------------
    172  1.1  jtc ** Other #define's
    173  1.1  jtc **---------------------------------------------------------------------
    174  1.1  jtc */
    175  1.1  jtc 
    176  1.1  jtc #define assert(ex) {if (!(ex)) \
    177  1.1  jtc     {char asstmp[256];(void)sprintf(asstmp,"rpc.pcnfsd: Assertion failed: line %d of %s: \"%s\"\n", \
    178  1.1  jtc     __LINE__, __FILE__, "ex"); (void)msg_out(asstmp); \
    179  1.1  jtc     sleep (10); exit(1);}}
    180  1.1  jtc 
    181  1.1  jtc 
    182