home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / LINUX_PC.TAR / pcnfsd_linux2 / common.h next >
Encoding:
C/C++ Source or Header  |  1994-04-06  |  9.9 KB  |  306 lines

  1. /* RE_SID: @(%)/tmp_mnt/vol/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.common.h 1.8 93/01/29 17:52:15 SMI */
  2. /*
  3. **=====================================================================
  4. ** Copyright (c) 1986-1993 by Sun Microsystems, Inc.
  5. **
  6. **         D I S C L A I M E R   S E C T I O N ,   E T C .
  7. **
  8. ** pcnfsd is copyrighted software, but is freely licensed. This
  9. ** means that you are free to redistribute it, modify it, ship it
  10. ** in binary with your system, whatever, provided:
  11. **
  12. ** - you leave the Sun copyright notice in the source code
  13. ** - you make clear what changes you have introduced and do
  14. **   not represent them as being supported by Sun.
  15. ** - you do not charge money for the source code (unlikely, given
  16. **   its free availability)
  17. **
  18. ** If you make changes to this software, we ask that you do so in
  19. ** a way which allows you to build either the "standard" version or
  20. ** your custom version from a single source file. Test it, lint
  21. ** it (it won't lint 100%, very little does, and there are bugs in
  22. ** some versions of lint :-), and send it back to Sun via email
  23. ** so that we can roll it into the source base and redistribute
  24. ** it. We'll try to make sure your contributions are acknowledged
  25. ** in the source, but after all these years it's getting hard to
  26. ** remember who did what.
  27. **
  28. ** The main contributors have been (in no special order):
  29. **
  30. ** Glen Eustace <G.Eustace@massey.ac.nz>
  31. **    user name caching for b-i-g password files
  32. ** Paul Emerson <paul@sdgsun.uucp>
  33. **    cleaning up Interactive 386/ix handling, fixing the lp
  34. **    interface, and generally tidying up the sources
  35. ** Keith Ericson <keithe@sail.labs.tek.com>
  36. **    more 386/ix fixes
  37. ** Jeff Stearns <jeff@tc.fluke.com>
  38. **    setuid/setgid for lpr
  39. ** Peter Van Campen <petervc@sci.kun.nl>
  40. **    fixing setuid/gid stuff, syslog
  41. ** Ted Nolan <ted@usasoc.soc.mil>
  42. **    /usr/adm/wtmp, other security suggestions
  43. ** Mogens Trab Damsgaard <trab@kubism.ku.dk>
  44. **    allow SVR4 and BSD names to be used as appropriate.
  45. ** Arthur David Olson <ado@elsie.nci.nih.gov>
  46. **    dozens of fixes all over the place
  47. ** Phil Servita <meister@ftp.com>
  48. **    Ultrix authentication
  49. ** Greg Hinkel <guh@dsunx1.dsrd.ornl.gov>
  50. **    more Ultrix stuff
  51. **
  52. ** Thanks to everyone who has contributed.
  53. **
  54. **    Geoff Arnold, PC-NFS architect <geoff@East.Sun.COM>
  55. **=====================================================================
  56. */
  57. /*
  58. **=====================================================================
  59. **             C U S T O M I Z A T I O N   S E C T I O N              *
  60. **=====================================================================
  61. */
  62.  
  63. /*
  64. **---------------------------------------------------------------------
  65. ** Define the following symbol to enable the use of a 
  66. ** shadow password file
  67. **---------------------------------------------------------------------
  68. **/
  69.  
  70. /* #define SHADOW_SUPPORT */
  71.  
  72. /*
  73. **---------------------------------------------------------------------
  74. ** Define the following symbol to enable the logging 
  75. ** of authentication requests to /usr/adm/wtmp
  76. **---------------------------------------------------------------------
  77. **/
  78.  
  79. #define WTMP
  80.  
  81. /*
  82. **------------------------------------------------------------------------
  83. ** Define the following symbol conform to Interactive
  84. ** System's 2.0
  85. **------------------------------------------------------------------------
  86. */
  87.  
  88. /* #define ISC_2_0 */
  89.  
  90. /*
  91. **---------------------------------------------------------------------
  92. ** Define the following symbol to use a cache of recently-used
  93. ** user names. This has certain uses in university and other settings
  94. ** where (1) the pasword file is very large, and (2) a group of users
  95. ** frequently logs in together using the same account (for example,
  96. ** a class userid).
  97. **---------------------------------------------------------------------
  98. */
  99.  
  100. /* #define USER_CACHE */
  101.  
  102. /*
  103. **---------------------------------------------------------------------
  104. ** Define the following symbol to build a System V version
  105. **---------------------------------------------------------------------
  106. */
  107.  
  108. /* #define SYSV */
  109.  
  110. /*
  111. **---------------------------------------------------------------------
  112. ** Define the following symbol to build an Ultrix 4.2 version
  113. **---------------------------------------------------------------------
  114. */
  115.  
  116. /* #define ULTRIX */
  117.  
  118.  
  119.  
  120. /*
  121. **---------------------------------------------------------------------
  122. ** Define the following symbol to build a version that
  123. ** will use the setusershell()/getusershell()/endusershell() calls
  124. ** to determine if a password entry contains a legal shell (and therefore
  125. ** identifies a user who may log in). The default is to check that
  126. ** the last two characters of the shell field are "sh", which should
  127. ** cope with "sh", "csh", "ksh", "bash".... See the routine get_password()
  128. ** in pcnfsd_misc.c for more details.
  129. */
  130.  
  131. /* #define USE_GETUSERSHELL */
  132.  
  133. /*
  134. **---------------------------------------------------------------------
  135. ** Define the following symbol to build a version that
  136. ** will consult the NIS (formerly Yellow Pages) "auto.home" map to
  137. ** locate the user's home directory (returned by the V2 authentication
  138. ** procedure).
  139. **---------------------------------------------------------------------
  140. */
  141.  
  142. /* #define USE_YP */
  143.  
  144.  
  145. /*
  146. **---------------------------------------------------------------------
  147. ** Define one of the following symbols to select the way in which
  148. ** the "print file" printer operation is to be implemented.
  149. ** See pcnfsd_printer.c for more details.
  150. **---------------------------------------------------------------------
  151. */
  152.  
  153. /* #define SVR4_STYLE_PRINT */
  154. /* #define BSD_STYLE_PRINT */
  155.  
  156. /*
  157. **---------------------------------------------------------------------
  158. ** Define one of the following symbols to select the way in which
  159. ** the "list printers" printer operation is to be implemented.
  160. ** See pcnfsd_printer.c for more details.
  161. **---------------------------------------------------------------------
  162. */
  163.  
  164. /* #define SVR4_STYLE_PR_LIST */
  165. /* #define BSD_STYLE_PR_LIST */
  166.  
  167. /*
  168. **---------------------------------------------------------------------
  169. ** Define one of the following symbols to select the way in which
  170. ** the "list queue" printer operation is to be implemented.
  171. ** See pcnfsd_printer.c for more details.
  172. **---------------------------------------------------------------------
  173. */
  174.  
  175. /* #define SVR4_STYLE_QUEUE */
  176. /* #define BSD_STYLE_QUEUE */
  177.  
  178. /*
  179. **---------------------------------------------------------------------
  180. ** Define one of the following symbols to select the way in which
  181. ** the "cancel job" printer operation is to be implemented.
  182. ** See pcnfsd_printer.c for more details.
  183. **---------------------------------------------------------------------
  184. */
  185.  
  186. /* #define SVR4_STYLE_CANCEL */
  187. /* #define BSD_STYLE_CANCEL */
  188.  
  189. /*
  190. **---------------------------------------------------------------------
  191. ** Define one of the following symbols to select the way in which
  192. ** the "printer status" printer operation is to be implemented.
  193. ** See pcnfsd_printer.c for more details.
  194. **---------------------------------------------------------------------
  195. */
  196.  
  197. /* #define SVR4_STYLE_STATUS */
  198. /* #define BSD_STYLE_STATUS */
  199.  
  200. /*
  201. **---------------------------------------------------------------------
  202. ** Define one of the following symbols to select the file or directory
  203. ** for which any change should cause the printer list to be rebuilt.
  204. ** See pcnfsd_printer.c for more details.
  205. **---------------------------------------------------------------------
  206. */
  207.  
  208. /* #define SVR4_STYLE_MONITOR */
  209. /* #define BSD_STYLE_MONITOR */
  210.  
  211. /*
  212. **---------------------------------------------------------------------
  213. ** trab -jan 1993:
  214. ** Define the following symbol, if you have defined BSD style print
  215. ** operations with:
  216. **    BSD_STYLE_PRINT
  217. **    BSD_STYLE_QUEUE
  218. **    BSD_STYLE_STATUS
  219. **    BSD_STYLE_MONITOR
  220. ** but have choosen:
  221. **    SVR4_STYLE_PR_LIST 
  222. ** for "list printers".
  223. ** This will permit use of both the SVR4 printer names (from lpstat)
  224. ** and the BSD printer names (first name in printcap entries).
  225. ** See pcnfsd_printer.c for more details.
  226. **---------------------------------------------------------------------
  227.  
  228. /* #define ACCEPT_BSD_PR_NAMES */
  229.  
  230.  
  231. /*
  232. **=====================================================================
  233. **                 P E R - O / S   S E C T I O N                      *
  234. **                                                                    *
  235. ** For each supported OS, we gather the options in a single #ifdef    *
  236. **=====================================================================
  237. */
  238.  
  239. #ifdef OSVER_SOLARIS2X
  240. #define SVR4_STYLE_PRINT
  241. #define SVR4_STYLE_PR_LIST
  242. #define SVR4_STYLE_QUEUE
  243. #define SVR4_STYLE_CANCEL
  244. #define SVR4_STYLE_STATUS
  245. #define SVR4_STYLE_MONITOR
  246. #define SHADOW_SUPPORT
  247. #define SVR4
  248. #define WTMP
  249. #endif
  250.  
  251. #ifdef OSVER_SUNOS41
  252. #define BSD_STYLE_PRINT
  253. #define BSD_STYLE_QUEUE
  254. #define BSD_STYLE_CANCEL
  255. #define BSD_STYLE_STATUS
  256. #define BSD_STYLE_MONITOR
  257. #define SVR4_STYLE_PR_LIST
  258. #define ACCEPT_BSD_PR_NAMES
  259. #endif
  260.  
  261. #ifdef OSVER_SUNOS403C
  262. #define BSD_STYLE_PRINT
  263. #define BSD_STYLE_PR_LIST
  264. #define BSD_STYLE_QUEUE
  265. #define BSD_STYLE_CANCEL
  266. #define BSD_STYLE_STATUS
  267. #define BSD_STYLE_MONITOR
  268. #define SUNOS_403C
  269. #endif
  270.  
  271. #ifdef OSVER_BSD386
  272. #define BSD_STYLE_PRINT
  273. #define BSD_STYLE_PR_LIST
  274. #define BSD_STYLE_QUEUE
  275. #define BSD_STYLE_CANCEL
  276. #define BSD_STYLE_STATUS
  277. #define BSD_STYLE_MONITOR
  278. #define BSD386
  279. #endif
  280.  
  281. #ifdef OSVER_ULTRIX
  282. #define BSD_STYLE_PRINT
  283. #define BSD_STYLE_PR_LIST
  284. #define BSD_STYLE_QUEUE
  285. #define BSD_STYLE_CANCEL
  286. #define BSD_STYLE_STATUS
  287. #define BSD_STYLE_MONITOR
  288. #define WTMP
  289. #define ULTRIX
  290. #define ULTRIX_AUTH
  291. #endif
  292.  
  293.  
  294. /*
  295. **=====================================================================
  296. **              " O T H E R  S T U F F "   S E C T I O N              *
  297. **=====================================================================
  298. */
  299.  
  300. #ifndef assert
  301. #define assert(ex) {if (!(ex)) \
  302.     {char asstmp[256];(void)sprintf(asstmp,"rpc.pcnfsd: Assertion failed: line %d of %s\n", \
  303.     __LINE__, __FILE__); (void)msg_out(asstmp); \
  304.     sleep (10); exit(1);}}
  305. #endif
  306.