home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume42 / alex / part13 < prev    next >
Encoding:
Internet Message Format  |  1994-03-30  |  72.0 KB

  1. From: vac@CS.CMU.EDU (Vincent.Cate)
  2. Newsgroups: comp.sources.misc
  3. Subject: v42i051:  alex - NFS/FTP global filesystem, Part13/13
  4. Date: 30 Mar 1994 20:58:27 -0600
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <2nde8j$jkq@sparky.sterling.com>
  9. X-Md4-Signature: bc581bbd92cf11181e8f93a886e1480b
  10.  
  11. Submitted-by: vac@CS.CMU.EDU (Vincent.Cate)
  12. Posting-number: Volume 42, Issue 51
  13. Archive-name: alex/part13
  14. Environment: Most Unix machines - with 100 MB to 10 GB of free disk
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  alexsrvr/alex-cache/readme alexsrvr/bin/readme
  21. #   alexsrvr/doc/README alexsrvr/doc/alex.html
  22. #   alexsrvr/doc/alexuser.html alexsrvr/etc/unfsd_exports
  23. #   alexsrvr/lib/README alexsrvr/lib/fix.hostslist
  24. #   alexsrvr/logs/readme alexsrvr/src/UidStrA.awk
  25. #   alexsrvr/src/UidStrB.awk alexsrvr/src/alexincs.h
  26. #   alexsrvr/src/compat.c alexsrvr/src/config.nfs.h alexsrvr/src/cp-rs
  27. #   alexsrvr/src/fh.h alexsrvr/src/install alexsrvr/src/libdefs
  28. #   alexsrvr/src/mount.h alexsrvr/src/mount_svc.c
  29. #   alexsrvr/src/mount_xdr.c alexsrvr/src/num alexsrvr/src/patchalex
  30. #   alexsrvr/src/remtimezonemain.c alexsrvr/src/rpc/auth_unix.h
  31. #   alexsrvr/src/rpc/netdb.h alexsrvr/src/rpc/pmap_clnt.h
  32. #   alexsrvr/src/rpc/pmap_prot.h alexsrvr/src/rpc/pmap_rmt.h
  33. #   alexsrvr/src/rpc/rpc.h alexsrvr/src/rpc/types.h
  34. #   alexsrvr/src/scripts/alex.nanny alexsrvr/src/scripts/evictor.nanny
  35. #   alexsrvr/src/scripts/grepnkill alexsrvr/src/scripts/grepnkill9
  36. #   alexsrvr/src/scripts/regression.test
  37. #   alexsrvr/src/scripts/restart.alex alexsrvr/src/scripts/runalexfsck
  38. #   alexsrvr/src/scripts/stop.alex alexsrvr/src/todo.c
  39. #   alexsrvr/src/unfsd.h alexsrvr/tmp/readme
  40. # Wrapped by kent@sparky on Tue Mar 29 21:56:24 1994
  41. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  42. echo If this archive is complete, you will see the following message:
  43. echo '          "shar: End of archive 13 (of 13)."'
  44. if test -f 'alexsrvr/alex-cache/readme' -a "${1}" != "-c" ; then 
  45.   echo shar: Will not clobber existing file \"'alexsrvr/alex-cache/readme'\"
  46. else
  47.   echo shar: Extracting \"'alexsrvr/alex-cache/readme'\" \(147 characters\)
  48.   sed "s/^X//" >'alexsrvr/alex-cache/readme' <<'END_OF_FILE'
  49. X
  50. X
  51. XThis directory can be remoted and /usr/alexsrvr/alex-cache can be a link
  52. Xoff to somplace else as long as the right user owns that other place.
  53. X
  54. X
  55. END_OF_FILE
  56.   if test 147 -ne `wc -c <'alexsrvr/alex-cache/readme'`; then
  57.     echo shar: \"'alexsrvr/alex-cache/readme'\" unpacked with wrong size!
  58.   fi
  59.   # end of 'alexsrvr/alex-cache/readme'
  60. fi
  61. if test -f 'alexsrvr/bin/readme' -a "${1}" != "-c" ; then 
  62.   echo shar: Will not clobber existing file \"'alexsrvr/bin/readme'\"
  63. else
  64.   echo shar: Extracting \"'alexsrvr/bin/readme'\" \(141 characters\)
  65.   sed "s/^X//" >'alexsrvr/bin/readme' <<'END_OF_FILE'
  66. X
  67. XYou should not edit scripts in this directory, edit them in 
  68. X~alexsrvr/src/scripts where they will come from when you
  69. Xdo a "make install".
  70. X
  71. END_OF_FILE
  72.   if test 141 -ne `wc -c <'alexsrvr/bin/readme'`; then
  73.     echo shar: \"'alexsrvr/bin/readme'\" unpacked with wrong size!
  74.   fi
  75.   # end of 'alexsrvr/bin/readme'
  76. fi
  77. if test -f 'alexsrvr/doc/README' -a "${1}" != "-c" ; then 
  78.   echo shar: Will not clobber existing file \"'alexsrvr/doc/README'\"
  79. else
  80.   echo shar: Extracting \"'alexsrvr/doc/README'\" \(1136 characters\)
  81.   sed "s/^X//" >'alexsrvr/doc/README' <<'END_OF_FILE'
  82. XAlex is a filesystem that lets users access files in FTP sites around
  83. Xthe world just like they access local files.  The name Alex comes from 
  84. Xthe ancient Library of Alexandria. Alexandria gathered information from 
  85. Xaround the world into one easy to access location. Alex does an analogous 
  86. Xthing in a very modern way.
  87. X
  88. XSource to Alex is now available.
  89. X
  90. Xalex.post             - Latest version of file that is posted to internet.
  91. X                        If you want to save just one file on Alex, save this.
  92. X                        Explains the easy ways to get a server up.
  93. X                         
  94. X
  95. Xusenix.wofs92.ps      - paper on Alex as published in Usenix Workshop on File 
  96. X                        Systems May of 1992.
  97. X
  98. X
  99. Xintro.ps              - same as above paper but with a few updates
  100. X
  101. Xusenix.wofs92.talk.ps - Slides for above talk
  102. X
  103. Xalex.html             - Alex www/xmosaic page
  104. X
  105. Xalexuser.html         - Alex users www/xmosaic page
  106. X
  107. XREADME.TOP            - copy of /alex/README
  108. X
  109. X
  110. XKeywords:     Alexandria, Alex, technical papers, techreport
  111. XMaster copy:  /alex/edu/cmu/cs/sp/alex/doc/README
  112. X
  113. X
  114. X   Vincent Cate
  115. X   vac@cs.cmu.edu
  116. X
  117. END_OF_FILE
  118.   if test 1136 -ne `wc -c <'alexsrvr/doc/README'`; then
  119.     echo shar: \"'alexsrvr/doc/README'\" unpacked with wrong size!
  120.   fi
  121.   # end of 'alexsrvr/doc/README'
  122. fi
  123. if test -f 'alexsrvr/doc/alex.html' -a "${1}" != "-c" ; then 
  124.   echo shar: Will not clobber existing file \"'alexsrvr/doc/alex.html'\"
  125. else
  126.   echo shar: Extracting \"'alexsrvr/doc/alex.html'\" \(2118 characters\)
  127.   sed "s/^X//" >'alexsrvr/doc/alex.html' <<'END_OF_FILE'
  128. X<TITLE>Alex FTP Filesystem</TITLE>
  129. X<H1>Alex FTP Filesystem </H1>
  130. X
  131. X<BODY>
  132. X
  133. XAlex is a filesystem that lets users access files in FTP sites around
  134. Xthe world just like they access local files.   Alex pathnames are 
  135. Xcomposed of 3 parts.  First is /alex.  Second is a reversed hostname.  
  136. XLast is the path on that host.  For example, 
  137. X/alex/edu/berkeley/pub/virus.patch is a file at berkeley.edu.
  138. X
  139. X
  140. X<MENU>
  141. X<LI> <A href="file://alex.sp.cs.cmu.edu/doc/alex.post">Post on netnews about Alex</A>
  142. X
  143. X<LI> <A href="file://alex.sp.cs.cmu.edu/doc/README">Alex README file</A>
  144. X
  145. X<LI> <A href="file://alex.sp.cs.cmu.edu/doc/NIR.Tool">Alex NIR entry</A>
  146. X
  147. X<LI> <A href="file://alex.sp.cs.cmu.edu/doc/intro.ps">Usenix paper on Alex intro.ps</A>
  148. X
  149. X<LI> <A href="file://alex.sp.cs.cmu.edu/src/README">Source code README</A>
  150. X</MENU>
  151. X
  152. X<H2>Getting Alex or trying it out</H2>
  153. X
  154. X<MENU>
  155. X<LI> <A href="file://alex.sp.cs.cmu.edu/src/getalex">Script to get and install Alex - getalex</A>
  156. X
  157. X<LI> <A href="file://alex.sp.cs.cmu.edu/alex"> Mosaic/WWW Alex demo starting at /alex </A>
  158. X
  159. X<LI> <A href="file://alex.sp.cs.cmu.edu/links"> Mosaic/WWW Alex demo starting at links </A>
  160. X
  161. X<LI> <A href="file://alex.sp.cs.cmu.edu/demo/alex.demo.mount"> Two line script to demo mount Alex </A>
  162. X</MENU>
  163. X
  164. X<H2>User Commands</H2>
  165. X
  166. X<MENU>
  167. X<LI> <A href="file://alex.sp.cs.cmu.edu/user/man-html/alexuser.html"> Man pages for Alex user commands </A>
  168. X
  169. X<LI> <A href="file://alex.sp.cs.cmu.edu/user/man-html/alexurl.html"> Alex support for URLs </A>
  170. X
  171. X<LI> <A href="file://alex.sp.cs.cmu.edu/links/thisdir.html"> alex2html of links tree </A>
  172. X</MENU>
  173. X
  174. X<H2>Other internet related systems</H2>
  175. X
  176. X<MENU>
  177. X<LI> <A href="file://ftp.rpi.edu/pub/communications/internet-tools.html"> internet-tools.html </A>
  178. X
  179. X<LI> <A href="file://alex.sp.cs.cmu.edu/links/information-systems"> directory of alex links to other systems </A>
  180. X
  181. X<LI> <A href="ftp://mailbase.ac.uk/pub/lists/nir/files/nir.status.report"> NIR status report </A>
  182. X
  183. X<LI> <A href="http://www.ai.mit.edu/the-net"> Index of /the-net</A>
  184. X</MENU>
  185. X
  186. X
  187. X<H3><A href=file://alex.sp.cs.cmu.edu/www/vincent-cate.html>Vincent Cate</A></H3>
  188. X
  189. X</BODY>
  190. END_OF_FILE
  191.   if test 2118 -ne `wc -c <'alexsrvr/doc/alex.html'`; then
  192.     echo shar: \"'alexsrvr/doc/alex.html'\" unpacked with wrong size!
  193.   fi
  194.   # end of 'alexsrvr/doc/alex.html'
  195. fi
  196. if test -f 'alexsrvr/doc/alexuser.html' -a "${1}" != "-c" ; then 
  197.   echo shar: Will not clobber existing file \"'alexsrvr/doc/alexuser.html'\"
  198. else
  199.   echo shar: Extracting \"'alexsrvr/doc/alexuser.html'\" \(3315 characters\)
  200.   sed "s/^X//" >'alexsrvr/doc/alexuser.html' <<'END_OF_FILE'
  201. X<TITLE>Alex User Commands</TITLE>
  202. X<H1>Alex User Commands</H1>
  203. X
  204. X<P>
  205. XAlex is an experimental filesystem that tries to give users
  206. Xtransparent read access to anonymous FTP sites.  Alex path-
  207. Xnames are really composed of 3 parts.  First is /alex.
  208. XSecond is a reversed hostname.  Last is the path on that
  209. Xhost.  For example, /alex/edu/berkeley/pub/virus.patch is a
  210. Xfile at berkeley.edu.
  211. X<P>
  212. XThis document and the documents referenced by it describe 
  213. Xsome commands that users may fine useful.  If you want 
  214. Xinformation on the server <A HREF=ftp://alex.sp.cs.cmu.edu/www/alex.html>click here</A>.
  215. X
  216. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/mountalex.html>NFS Mount Alex</A></H2>
  217. X
  218. XAlex is a funny NFS server that needs special timeouts options
  219. X(FTPs take longer than disk accesses).  The mountalex script
  220. Xhandles all of this.  It will also make /alex if it needs
  221. Xto.
  222. X
  223. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/installalexuser.html>Install User Commands</A></H2>
  224. X
  225. XThis page tells how to install all of the user commands and html pages.
  226. X
  227. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexurl.html>Commands to use with URLs (WWW/Mosaic)</A></H2>
  228. X
  229. XThere are a number of user commands for useful to Mosaic users.
  230. XThey are all collected under this section. 
  231. X
  232. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexaliases.html>Alex Aliases</A></H2>
  233. X
  234. XA bunch of aliases that make using Alex faster.  These include things
  235. Xlike cdh (cd host) and <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/cdu.html>cdu</A> for going to a URL. 
  236. X
  237. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/searchalex.html>Searching Through Alex</A></H2>
  238. X
  239. XThis is a collection of commands for searching and browsing Alex.
  240. X
  241. X
  242. X<H2><A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/other.html>Other Alex User Commands</A></H2>
  243. X
  244. XThis is a another bunch of Alex user commands.
  245. X
  246. X
  247. X<H2>FILES</H2>
  248. X
  249. XAll of the user related man pages and commands can be found
  250. Xunder /alex/edu/cmu/cs/sp/alex/user.
  251. X
  252. X<H2>DEMO</H2>
  253. X
  254. XTo demo Alex get a copy of <A HREF=ftp://alex.sp.cs.cmu.edu/demo/alex.demo.mount>
  255. Xalex.demo.mount</A> and run it as
  256. Xroot.  This will do an NFS mount of the demo server.
  257. X
  258. X
  259. X<H2>SEE ALSO</H2>
  260. X     <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/cdu.html>cdu</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html//lnu.html>lnu</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/mountalex.html>mountalex</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexaliases.html>alexaliases</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/archia.html>archia</A>,
  261. X     <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexupdate.html>alexupdate</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/readmes.html>readmes</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/cmuftp.html>cmuftp</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexurl.html>alexurl</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/url2alex.html>url2alex</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alex2url.html>alex2url</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alex2html.html>alex2html</A>, <A HREF=ftp://alex.sp.cs.cmu.edu/user/man-html/alexinalex.html>alexinalex</A>
  262. X
  263. X
  264. X
  265. X<H2>BUGS</H2>
  266. X
  267. X     To report bugs please send mail to vac@cs.cmu.edu.
  268. X
  269. X
  270. X<H2>AUTHOR</H2>
  271. X<H3><A href=file://alex.sp.cs.cmu.edu/www/vincent-cate.html>Vincent Cate</A></H3>
  272. X
  273. END_OF_FILE
  274.   if test 3315 -ne `wc -c <'alexsrvr/doc/alexuser.html'`; then
  275.     echo shar: \"'alexsrvr/doc/alexuser.html'\" unpacked with wrong size!
  276.   fi
  277.   # end of 'alexsrvr/doc/alexuser.html'
  278. fi
  279. if test -f 'alexsrvr/etc/unfsd_exports' -a "${1}" != "-c" ; then 
  280.   echo shar: Will not clobber existing file \"'alexsrvr/etc/unfsd_exports'\"
  281. else
  282.   echo shar: Extracting \"'alexsrvr/etc/unfsd_exports'\" \(196 characters\)
  283.   sed "s/^X//" >'alexsrvr/etc/unfsd_exports' <<'END_OF_FILE'
  284. X/usr0/alex HOKUSAI.TRUST.CS.CMU.EDU hokusai.trust.cs.cmu.edu 
  285. X/usr0/alex FURMINT.NECTAR.CS.CMU.EDU furmint.nectar.cs.cmu.edu 
  286. X
  287. XDUCK.WARP.CS.CMU.EDU
  288. XCONCORD.NECTAR.CS.CMU.EDU
  289. XROBIN.WARP.CS.CMU.EDU
  290. END_OF_FILE
  291.   if test 196 -ne `wc -c <'alexsrvr/etc/unfsd_exports'`; then
  292.     echo shar: \"'alexsrvr/etc/unfsd_exports'\" unpacked with wrong size!
  293.   fi
  294.   # end of 'alexsrvr/etc/unfsd_exports'
  295. fi
  296. if test -f 'alexsrvr/lib/README' -a "${1}" != "-c" ; then 
  297.   echo shar: Will not clobber existing file \"'alexsrvr/lib/README'\"
  298. else
  299.   echo shar: Extracting \"'alexsrvr/lib/README'\" \(385 characters\)
  300.   sed "s/^X//" >'alexsrvr/lib/README' <<'END_OF_FILE'
  301. X
  302. X
  303. XIf you need to edit the HostsList file do the following:
  304. X
  305. X  1)  grepnkill alexd    - to get it to save the current version
  306. X      (note that alex.nanny will restart it)
  307. X
  308. X  2)  cp HostsList  HostsList.new
  309. X  
  310. X  3)  edit HostsList.new as needed (usually just remove old stuff)
  311. X
  312. X  4)  grepnkill alexd      
  313. X         will save HostsList but then find HostsList.new and use that
  314. X
  315. X
  316. X        
  317. END_OF_FILE
  318.   if test 385 -ne `wc -c <'alexsrvr/lib/README'`; then
  319.     echo shar: \"'alexsrvr/lib/README'\" unpacked with wrong size!
  320.   fi
  321.   # end of 'alexsrvr/lib/README'
  322. fi
  323. if test -f 'alexsrvr/lib/fix.hostslist' -a "${1}" != "-c" ; then 
  324.   echo shar: Will not clobber existing file \"'alexsrvr/lib/fix.hostslist'\"
  325. else
  326.   echo shar: Extracting \"'alexsrvr/lib/fix.hostslist'\" \(117 characters\)
  327.   sed "s/^X//" >'alexsrvr/lib/fix.hostslist' <<'END_OF_FILE'
  328. X#!/bin/csh
  329. X#
  330. X#
  331. X#  This is an example of fixing HostsList
  332. X
  333. X
  334. Xsort +0 -1 -u HostsList > HostsList.new
  335. X
  336. Xgrepnkill alexd
  337. X
  338. END_OF_FILE
  339.   if test 117 -ne `wc -c <'alexsrvr/lib/fix.hostslist'`; then
  340.     echo shar: \"'alexsrvr/lib/fix.hostslist'\" unpacked with wrong size!
  341.   fi
  342.   chmod +x 'alexsrvr/lib/fix.hostslist'
  343.   # end of 'alexsrvr/lib/fix.hostslist'
  344. fi
  345. if test -f 'alexsrvr/logs/readme' -a "${1}" != "-c" ; then 
  346.   echo shar: Will not clobber existing file \"'alexsrvr/logs/readme'\"
  347. else
  348.   echo shar: Extracting \"'alexsrvr/logs/readme'\" \(236 characters\)
  349.   sed "s/^X//" >'alexsrvr/logs/readme' <<'END_OF_FILE'
  350. X
  351. XThis directory can be removed and alex-logs made to be a symbolic
  352. Xlink off to someplace else if you would rather.
  353. X
  354. XAlso note that "config.h" can be edited such that "COMPRESSPATH" is
  355. X"/bin/rm" which is known to save more disk space.
  356. X
  357. X
  358. END_OF_FILE
  359.   if test 236 -ne `wc -c <'alexsrvr/logs/readme'`; then
  360.     echo shar: \"'alexsrvr/logs/readme'\" unpacked with wrong size!
  361.   fi
  362.   # end of 'alexsrvr/logs/readme'
  363. fi
  364. if test -f 'alexsrvr/src/UidStrA.awk' -a "${1}" != "-c" ; then 
  365.   echo shar: Will not clobber existing file \"'alexsrvr/src/UidStrA.awk'\"
  366. else
  367.   echo shar: Extracting \"'alexsrvr/src/UidStrA.awk'\" \(39 characters\)
  368.   sed "s/^X//" >'alexsrvr/src/UidStrA.awk' <<'END_OF_FILE'
  369. XBEGIN {FS = ":"}
  370. X{print $3 "   " $5}
  371. X
  372. X
  373. END_OF_FILE
  374.   if test 39 -ne `wc -c <'alexsrvr/src/UidStrA.awk'`; then
  375.     echo shar: \"'alexsrvr/src/UidStrA.awk'\" unpacked with wrong size!
  376.   fi
  377.   # end of 'alexsrvr/src/UidStrA.awk'
  378. fi
  379. if test -f 'alexsrvr/src/UidStrB.awk' -a "${1}" != "-c" ; then 
  380.   echo shar: Will not clobber existing file \"'alexsrvr/src/UidStrB.awk'\"
  381. else
  382.   echo shar: Extracting \"'alexsrvr/src/UidStrB.awk'\" \(82 characters\)
  383.   sed "s/^X//" >'alexsrvr/src/UidStrB.awk' <<'END_OF_FILE'
  384. X{printf "%s  %s",$1,$2 ; for (i = 3; i<= NF; i++) printf ".%s",$i ; printf "\n" }
  385. END_OF_FILE
  386.   if test 82 -ne `wc -c <'alexsrvr/src/UidStrB.awk'`; then
  387.     echo shar: \"'alexsrvr/src/UidStrB.awk'\" unpacked with wrong size!
  388.   fi
  389.   # end of 'alexsrvr/src/UidStrB.awk'
  390. fi
  391. if test -f 'alexsrvr/src/alexincs.h' -a "${1}" != "-c" ; then 
  392.   echo shar: Will not clobber existing file \"'alexsrvr/src/alexincs.h'\"
  393. else
  394.   echo shar: Extracting \"'alexsrvr/src/alexincs.h'\" \(2375 characters\)
  395.   sed "s/^X//" >'alexsrvr/src/alexincs.h' <<'END_OF_FILE'
  396. X
  397. X#ifdef __alpha
  398. X#define ALPHAOSF
  399. X#endif
  400. X
  401. X#include <stdio.h>
  402. X#include <errno.h>
  403. X#include <sys/types.h>
  404. X#include <sys/wait.h>
  405. X#include <sys/stat.h>
  406. X#include <strings.h>
  407. X#include <ctype.h>
  408. X#include <sys/param.h>
  409. X
  410. X#if !defined(ultrix) && !defined(__386BSD__) && !defined(ALPHAOSF) && !defined(__NetBSD__)
  411. X#  include <sys/vfs.h>
  412. X#endif
  413. X
  414. X#include <sys/time.h>
  415. X#include <sys/timeb.h>
  416. X
  417. X#if defined(ultrix) || defined(ALPHAOSF)
  418. X#  include <netinet/in.h>       /* needs to be before rpc/*.h and nfs/*.h */
  419. X#  include <ufs/fs.h>
  420. X#  include <rpc/types.h>
  421. X#  include <malloc.h>
  422. X#endif
  423. X
  424. X#ifdef ultrix
  425. X   extern double rint();        /* for some reason this isn't in math.h */
  426. X#  include <sys/mount.h>
  427. X#  include <nfs/nfs_clnt.h>
  428. X#  include <nfs/vfs.h>
  429. X#else
  430. X#  ifdef MACH
  431. X#  include <sys/inode.h>              /*  ufs/inode.h on many machines */
  432. X#  include <sys/fs.h>                 /*  ufs/fs.h  on many machines */
  433. X   extern char *malloc();             /*  seems there is no malloc.h */
  434. X   extern char *realloc();
  435. X#else
  436. X#  ifdef __linux__
  437. X#  include <malloc.h>
  438. X#  else
  439. X
  440. X#    if defined(__386BSD__) || defined(__NetBSD__)
  441. X#      include <sys/uio.h>
  442. X#      include <sys/proc.h>
  443. X#      include <sys/ucred.h>
  444. X#      include <ufs/quota.h>
  445. X#    endif
  446. X#    include <sys/vnode.h>
  447. X#    ifdef hpux
  448. X#      include <sys/inode.h>
  449. X#      include <sys/fs.h>
  450. X#    else
  451. X#      include <ufs/inode.h>
  452. X#      include <ufs/fs.h>
  453. X#    endif
  454. X#    if defined(__386BSD__) || defined(__NetBSD__)
  455. X#      include <sys/malloc.h>
  456. X#    else
  457. X#      ifndef NeXT
  458. X#          include <malloc.h> /* Next arpa name server file includes */
  459. X#      endif                  /* some conflicting definitions        */
  460. X#    endif
  461. X#  endif
  462. X#endif
  463. X#endif
  464. X
  465. X#include <signal.h>
  466. X#include <netdb.h>
  467. X#include <arpa/nameser.h>
  468. X#include <netinet/in.h>
  469. X#include <arpa/inet.h>
  470. X#include <resolv.h>
  471. X#include <sys/socket.h>
  472. X#include <pwd.h>
  473. X#if !defined(ultrix) && !defined(__386BSD__) && !defined(ALPHAOSF) && !defined(__NetBSD__)
  474. X#  include <mntent.h>
  475. X#endif
  476. X
  477. X#include <sys/dir.h>
  478. X#include <math.h>
  479. X#ifdef hpux
  480. X#define rint(x) (floor(x + 0.5))
  481. X#endif
  482. X
  483. X#include <sys/ioctl.h>
  484. X#include <varargs.h>
  485. X
  486. X
  487. X/* ftpparent ftp child stuff */
  488. X#include <string.h>
  489. X#include <arpa/ftp.h>
  490. X#include <arpa/telnet.h>
  491. X
  492. X/* unfsd and unfsmntd stuff */
  493. X#include <sys/file.h>
  494. X#include <syslog.h>
  495. X#include <rpc/rpc.h>
  496. X
  497. X
  498. X#ifdef __NetBSD__
  499. X#include <sys/mount.h>
  500. X#endif
  501. X
  502. X
  503. END_OF_FILE
  504.   if test 2375 -ne `wc -c <'alexsrvr/src/alexincs.h'`; then
  505.     echo shar: \"'alexsrvr/src/alexincs.h'\" unpacked with wrong size!
  506.   fi
  507.   # end of 'alexsrvr/src/alexincs.h'
  508. fi
  509. if test -f 'alexsrvr/src/compat.c' -a "${1}" != "-c" ; then 
  510.   echo shar: Will not clobber existing file \"'alexsrvr/src/compat.c'\"
  511. else
  512.   echo shar: Extracting \"'alexsrvr/src/compat.c'\" \(338 characters\)
  513.   sed "s/^X//" >'alexsrvr/src/compat.c' <<'END_OF_FILE'
  514. X
  515. X#include "config.h"
  516. X
  517. X
  518. X#ifdef hpux
  519. X
  520. Xint getdtablesize()
  521. X{
  522. X   return(64);
  523. X}
  524. X
  525. X#endif
  526. X
  527. X#if defined(hpux) || defined(ultrix)
  528. X
  529. Xint usleep (us)
  530. Xunsigned us;
  531. X{
  532. X   double seconds;
  533. X   int secs;
  534. X
  535. X   seconds = us/1000000.0;
  536. X   secs = 1 + seconds;              /* we will go slower on these machines */
  537. X   
  538. X   sleep(secs);
  539. X
  540. X   return(0);
  541. X}
  542. X
  543. X#endif
  544. X
  545. X
  546. END_OF_FILE
  547.   if test 338 -ne `wc -c <'alexsrvr/src/compat.c'`; then
  548.     echo shar: \"'alexsrvr/src/compat.c'\" unpacked with wrong size!
  549.   fi
  550.   # end of 'alexsrvr/src/compat.c'
  551. fi
  552. if test -f 'alexsrvr/src/config.nfs.h' -a "${1}" != "-c" ; then 
  553.   echo shar: Will not clobber existing file \"'alexsrvr/src/config.nfs.h'\"
  554. else
  555.   echo shar: Extracting \"'alexsrvr/src/config.nfs.h'\" \(376 characters\)
  556.   sed "s/^X//" >'alexsrvr/src/config.nfs.h' <<'END_OF_FILE'
  557. X
  558. X/* By default Alex is world mountable, so the following 
  559. X * should not matter.  When alexd is started with a -p
  560. X * it is "permiscuous".
  561. X */
  562. X#define ALEXEXPORTSFILE "/usr/alexsrvr/etc/unfsd_exports"
  563. X
  564. X#define ALEXNFSPROG   100003         /*  NFS is 100003 */
  565. X#define ALEXMOUNTPROG 100005         /*  NFS is 100005 */
  566. X#define ALEXNFSPORT   2049           /*  NFS is 2049   */
  567. X
  568. X
  569. END_OF_FILE
  570.   if test 376 -ne `wc -c <'alexsrvr/src/config.nfs.h'`; then
  571.     echo shar: \"'alexsrvr/src/config.nfs.h'\" unpacked with wrong size!
  572.   fi
  573.   # end of 'alexsrvr/src/config.nfs.h'
  574. fi
  575. if test -f 'alexsrvr/src/cp-rs' -a "${1}" != "-c" ; then 
  576.   echo shar: Will not clobber existing file \"'alexsrvr/src/cp-rs'\"
  577. else
  578.   echo shar: Extracting \"'alexsrvr/src/cp-rs'\" \(395 characters\)
  579.   sed "s/^X//" >'alexsrvr/src/cp-rs' <<'END_OF_FILE'
  580. X#!/bin/sh
  581. X
  582. X# cp-rs: written by Tony Robinson, ajr@eng.cam.ac.uk
  583. X# please send me bug reports
  584. X
  585. X
  586. Xif [ $# != 2 -o ! -d $1 ]; then
  587. X  echo Syntax: $0 "<alex dir> <local dir>"
  588. X  exit 1
  589. Xfi
  590. X
  591. Xif [ ! -d $2 ] ; then mkdir $2 ; fi
  592. X
  593. Xfor name in `cd $1 ; ls -a` ; do
  594. X    if [ -d $1/$name ] ; then
  595. X        if [ $name != . -a $name != .. ] ; then
  596. X            sh $0 $1/$name $2/$name
  597. X        fi
  598. X    else
  599. X        ln -s $1/$name $2/$name
  600. X    fi
  601. Xdone
  602. END_OF_FILE
  603.   if test 395 -ne `wc -c <'alexsrvr/src/cp-rs'`; then
  604.     echo shar: \"'alexsrvr/src/cp-rs'\" unpacked with wrong size!
  605.   fi
  606.   chmod +x 'alexsrvr/src/cp-rs'
  607.   # end of 'alexsrvr/src/cp-rs'
  608. fi
  609. if test -f 'alexsrvr/src/fh.h' -a "${1}" != "-c" ; then 
  610.   echo shar: Will not clobber existing file \"'alexsrvr/src/fh.h'\"
  611. else
  612.   echo shar: Extracting \"'alexsrvr/src/fh.h'\" \(716 characters\)
  613.   sed "s/^X//" >'alexsrvr/src/fh.h' <<'END_OF_FILE'
  614. X/* UNFSD - copyright Mark A Shand, May 1988.
  615. X * This software maybe be used for any purpose provided
  616. X * the above copyright notice is retained.  It is supplied
  617. X * as is, with no warranty expressed or implied.
  618. X */
  619. X
  620. X/* compatibility between mount and nfs_prot */
  621. X#ifndef NFS_FHSIZE
  622. X#define NFS_FHSIZE    FHSIZE
  623. X#endif
  624. X
  625. X#define    INODEARRAYLEN    (NFS_FHSIZE/sizeof(u_long))       /*  32/4 = 8                  */
  626. X#define INODEARRAYBYTES INODEARRAY*sizof(u_long)          /* for bcmp and bcopy         */
  627. X
  628. Xtypedef struct
  629. X{
  630. X    u_long    InodeArray[INODEARRAYLEN];   /* first is our inode, next is parents ... */
  631. X}
  632. X    svc_fh;
  633. X
  634. Xextern fh_init();
  635. Xextern int fh_fd();
  636. Xextern int fh_path();
  637. Xextern int fh_compose();
  638. X
  639. Xextern char *fh_pr();
  640. X
  641. END_OF_FILE
  642.   if test 716 -ne `wc -c <'alexsrvr/src/fh.h'`; then
  643.     echo shar: \"'alexsrvr/src/fh.h'\" unpacked with wrong size!
  644.   fi
  645.   # end of 'alexsrvr/src/fh.h'
  646. fi
  647. if test -f 'alexsrvr/src/install' -a "${1}" != "-c" ; then 
  648.   echo shar: Will not clobber existing file \"'alexsrvr/src/install'\"
  649. else
  650.   echo shar: Extracting \"'alexsrvr/src/install'\" \(1152 characters\)
  651.   sed "s/^X//" >'alexsrvr/src/install' <<'END_OF_FILE'
  652. X#!/bin/csh -f
  653. X#
  654. X# This is used by the makefile after things have been compiled.
  655. X# This should not be used directly.
  656. X#
  657. X
  658. X
  659. Xset INSTALLDIR  = `./defs install`
  660. Xset ALEXSRVR    = `./defs alexsrvr`
  661. Xset HOSTNAME    = `hostname`
  662. Xset CACHEDIRVAR = `./defs cachedir`
  663. Xset ALEXSRVRHOME = `./defs home`
  664. X
  665. X/bin/rm -f     $INSTALLDIR/defs
  666. Xcp  defs       $INSTALLDIR/defs
  667. X
  668. X
  669. Xif ($1 == basic) then
  670. X    echo "updating alexd and alexmountd"
  671. X    /bin/rm -f      $INSTALLDIR/alexd 
  672. X    /bin/rm -f      $INSTALLDIR/alexmountd
  673. X    cp  alexd       $INSTALLDIR 
  674. X    cp  alexmountd  $INSTALLDIR 
  675. X
  676. X    foreach SCRIPT (`ls scripts`)
  677. X        echo $SCRIPT
  678. X        cat scripts/$SCRIPT | sed s/DEFAULTSERVERHOST/${HOSTNAME}/g | sed s-BINDIR-${INSTALLDIR}-g > $INSTALLDIR/$SCRIPT
  679. X        chmod +x $INSTALLDIR/$SCRIPT
  680. X    end
  681. Xendif
  682. X
  683. Xif ($1 == nonbasic) then
  684. X    echo "updating nonbasic"
  685. X    /bin/rm -f $INSTALLDIR/alexfsck
  686. X    /bin/rm -f $INSTALLDIR/evictor
  687. X    /bin/rm -f $INSTALLDIR/printinfo
  688. X    cp  alexfsck   $INSTALLDIR
  689. X    cp  evictor    $INSTALLDIR
  690. X    cp  printinfo  $INSTALLDIR
  691. X    /bin/rm -f $CACHEDIRVAR/README
  692. X    cp  $ALEXSRVRHOME/doc/README.TOP $CACHEDIRVAR/README
  693. Xendif
  694. X
  695. X
  696. X
  697. END_OF_FILE
  698.   if test 1152 -ne `wc -c <'alexsrvr/src/install'`; then
  699.     echo shar: \"'alexsrvr/src/install'\" unpacked with wrong size!
  700.   fi
  701.   chmod +x 'alexsrvr/src/install'
  702.   # end of 'alexsrvr/src/install'
  703. fi
  704. if test -f 'alexsrvr/src/libdefs' -a "${1}" != "-c" ; then 
  705.   echo shar: Will not clobber existing file \"'alexsrvr/src/libdefs'\"
  706. else
  707.   echo shar: Extracting \"'alexsrvr/src/libdefs'\" \(245 characters\)
  708.   sed "s/^X//" >'alexsrvr/src/libdefs' <<'END_OF_FILE'
  709. X#!/bin/csh -f
  710. X
  711. X
  712. Xset LIB = ""
  713. Xforeach POSIBILITY (/usr/lib/librpc.a /usr/misc/.nfs/lib/librpc.a /usr/lib/librpcsvc.a)
  714. X    if (-f $POSIBILITY) then
  715. X        set LIB=$POSIBILITY
  716. X    endif
  717. Xend
  718. X
  719. Xset RESOLVER = `./defs resolver`
  720. X
  721. Xecho  $LIB $RESOLVER
  722. X
  723. END_OF_FILE
  724.   if test 245 -ne `wc -c <'alexsrvr/src/libdefs'`; then
  725.     echo shar: \"'alexsrvr/src/libdefs'\" unpacked with wrong size!
  726.   fi
  727.   chmod +x 'alexsrvr/src/libdefs'
  728.   # end of 'alexsrvr/src/libdefs'
  729. fi
  730. if test -f 'alexsrvr/src/mount.h' -a "${1}" != "-c" ; then 
  731.   echo shar: Will not clobber existing file \"'alexsrvr/src/mount.h'\"
  732. else
  733.   echo shar: Extracting \"'alexsrvr/src/mount.h'\" \(1613 characters\)
  734.   sed "s/^X//" >'alexsrvr/src/mount.h' <<'END_OF_FILE'
  735. X#define MNTPATHLEN 1024
  736. X#define MNTNAMLEN 255
  737. X#define FHSIZE 32
  738. X
  739. Xstruct alex_fhandle {
  740. X    char data[FHSIZE];
  741. X};
  742. Xtypedef struct alex_fhandle alex_fhandle;
  743. Xbool_t xdr_alex_fhandle();
  744. X
  745. X
  746. Xstruct fhstatus {
  747. X    u_int fhs_status;
  748. X    union {
  749. X        struct alex_fhandle fhs_fhandle;
  750. X    } fhstatus_u;
  751. X};
  752. Xtypedef struct fhstatus fhstatus;
  753. Xbool_t xdr_fhstatus();
  754. X
  755. X
  756. Xtypedef char *dirpath;
  757. Xbool_t xdr_dirpath();
  758. X
  759. X
  760. Xtypedef char *name;
  761. Xbool_t xdr_name();
  762. X
  763. X
  764. Xtypedef struct mountbody *mountlist;
  765. Xbool_t xdr_mountlist();
  766. X
  767. X
  768. Xstruct mountbody {
  769. X    name ml_hostname;
  770. X    dirpath ml_directory;
  771. X    mountlist ml_next;
  772. X};
  773. Xtypedef struct mountbody mountbody;
  774. Xbool_t xdr_mountbody();
  775. X
  776. X
  777. Xtypedef struct groupnode *grouplist;
  778. Xbool_t xdr_grouplist();
  779. X
  780. X
  781. Xstruct groupnode {
  782. X    name gr_name;
  783. X    grouplist gr_next;
  784. X};
  785. Xtypedef struct groupnode groupnode;
  786. Xbool_t xdr_groupnode();
  787. X
  788. X
  789. Xtypedef struct exportnode *exportlist;
  790. Xbool_t xdr_exportlist();
  791. X
  792. X
  793. Xstruct exportnode {
  794. X    dirpath ex_dir;
  795. X    grouplist ex_groups;
  796. X    exportlist ex_next;
  797. X};
  798. Xtypedef struct exportnode exportnode;
  799. Xbool_t xdr_exportnode();
  800. X
  801. X
  802. X#define MOUNTPROG ((u_long)100005)
  803. X#define MOUNTVERS ((u_long)1)
  804. X#define MOUNTPROC_NULL ((u_long)0)
  805. Xextern void *mountproc_null_1();
  806. X#define MOUNTPROC_MNT ((u_long)1)
  807. Xextern fhstatus *mountproc_mnt_1();
  808. X#define MOUNTPROC_DUMP ((u_long)2)
  809. Xextern mountlist *mountproc_dump_1();
  810. X#define MOUNTPROC_UMNT ((u_long)3)
  811. Xextern void *mountproc_umnt_1();
  812. X#define MOUNTPROC_UMNTALL ((u_long)4)
  813. Xextern void *mountproc_umntall_1();
  814. X#define MOUNTPROC_EXPORT ((u_long)5)
  815. Xextern exportlist *mountproc_export_1();
  816. X#define MOUNTPROC_EXPORTALL ((u_long)6)
  817. Xextern exportlist *mountproc_exportall_1();
  818. X
  819. END_OF_FILE
  820.   if test 1613 -ne `wc -c <'alexsrvr/src/mount.h'`; then
  821.     echo shar: \"'alexsrvr/src/mount.h'\" unpacked with wrong size!
  822.   fi
  823.   # end of 'alexsrvr/src/mount.h'
  824. fi
  825. if test -f 'alexsrvr/src/mount_svc.c' -a "${1}" != "-c" ; then 
  826.   echo shar: Will not clobber existing file \"'alexsrvr/src/mount_svc.c'\"
  827. else
  828.   echo shar: Extracting \"'alexsrvr/src/mount_svc.c'\" \(2252 characters\)
  829.   sed "s/^X//" >'alexsrvr/src/mount_svc.c' <<'END_OF_FILE'
  830. X#include <stdio.h>
  831. X#include <rpc/rpc.h>
  832. X#include "mount.h"
  833. X
  834. Xstatic void mountprog_1();
  835. X
  836. Xmain(argc,argv) int argc; char **argv;
  837. X{
  838. X    SVCXPRT *transp;
  839. X
  840. X    (void)init_Log(); pmap_unset(MOUNTPROG, MOUNTVERS);
  841. X
  842. X    transp = svcudp_create(RPC_ANYSOCK);
  843. X    if (transp == NULL) {
  844. X        (void)fprintf(stderr, "cannot create udp service.\n");
  845. X        exit(1);
  846. X    }
  847. X    if (!svc_register(transp, MOUNTPROG, MOUNTVERS, mountprog_1, IPPROTO_UDP)) {
  848. X        (void)fprintf(stderr, "unable to register (MOUNTPROG, MOUNTVERS, udp).\n");
  849. X        exit(1);
  850. X    }
  851. X    unfsmntd_init(argc,argv); svc_run();
  852. X    (void)fprintf(stderr, "svc_run returned\n");
  853. X    exit(1);
  854. X}
  855. X
  856. Xstatic void
  857. Xmountprog_1(rqstp, transp)
  858. X    struct svc_req *rqstp;
  859. X    SVCXPRT *transp;
  860. X{
  861. X    union {
  862. X        dirpath mountproc_mnt_1_arg;
  863. X        dirpath mountproc_umnt_1_arg;
  864. X    } argument;
  865. X    char *result;
  866. X    bool_t (*xdr_argument)(), (*xdr_result)();
  867. X    char *(*local)();
  868. X
  869. X    switch (rqstp->rq_proc) {
  870. X    case MOUNTPROC_NULL:
  871. X        xdr_argument = xdr_void;
  872. X        xdr_result = xdr_void;
  873. X        local = (char *(*)()) mountproc_null_1;
  874. X        break;
  875. X
  876. X    case MOUNTPROC_MNT:
  877. X        xdr_argument = xdr_dirpath;
  878. X        xdr_result = xdr_fhstatus;
  879. X        local = (char *(*)()) mountproc_mnt_1;
  880. X        break;
  881. X
  882. X    case MOUNTPROC_DUMP:
  883. X        xdr_argument = xdr_void;
  884. X        xdr_result = xdr_mountlist;
  885. X        local = (char *(*)()) mountproc_dump_1;
  886. X        break;
  887. X
  888. X    case MOUNTPROC_UMNT:
  889. X        xdr_argument = xdr_dirpath;
  890. X        xdr_result = xdr_void;
  891. X        local = (char *(*)()) mountproc_umnt_1;
  892. X        break;
  893. X
  894. X    case MOUNTPROC_UMNTALL:
  895. X        xdr_argument = xdr_void;
  896. X        xdr_result = xdr_void;
  897. X        local = (char *(*)()) mountproc_umntall_1;
  898. X        break;
  899. X
  900. X    case MOUNTPROC_EXPORT:
  901. X        xdr_argument = xdr_void;
  902. X        xdr_result = xdr_exportlist;
  903. X        local = (char *(*)()) mountproc_export_1;
  904. X        break;
  905. X
  906. X    case MOUNTPROC_EXPORTALL:
  907. X        xdr_argument = xdr_void;
  908. X        xdr_result = xdr_exportlist;
  909. X        local = (char *(*)()) mountproc_exportall_1;
  910. X        break;
  911. X
  912. X    default:
  913. X        svcerr_noproc(transp);
  914. X        return;
  915. X    }
  916. X    bzero((char *)&argument, sizeof(argument));
  917. X    if (!svc_getargs(transp, xdr_argument, &argument)) {
  918. X        svcerr_decode(transp);
  919. X        return;
  920. X    }
  921. X    result = (*local)(&argument, rqstp);
  922. X    if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
  923. X        svcerr_systemerr(transp);
  924. X    }
  925. X    if (!svc_freeargs(transp, xdr_argument, &argument)) {
  926. X        (void)fprintf(stderr, "unable to free arguments\n");
  927. X        exit(1);
  928. X    }
  929. X}
  930. X
  931. END_OF_FILE
  932.   if test 2252 -ne `wc -c <'alexsrvr/src/mount_svc.c'`; then
  933.     echo shar: \"'alexsrvr/src/mount_svc.c'\" unpacked with wrong size!
  934.   fi
  935.   # end of 'alexsrvr/src/mount_svc.c'
  936. fi
  937. if test -f 'alexsrvr/src/mount_xdr.c' -a "${1}" != "-c" ; then 
  938.   echo shar: Will not clobber existing file \"'alexsrvr/src/mount_xdr.c'\"
  939. else
  940.   echo shar: Extracting \"'alexsrvr/src/mount_xdr.c'\" \(2141 characters\)
  941.   sed "s/^X//" >'alexsrvr/src/mount_xdr.c' <<'END_OF_FILE'
  942. X#include <rpc/rpc.h>
  943. X#include "mount.h"
  944. X
  945. X
  946. Xbool_t
  947. Xxdr_alex_fhandle(xdrs, objp)
  948. X    XDR *xdrs;
  949. X    alex_fhandle *objp;
  950. X{
  951. X    if (!xdr_opaque(xdrs, objp->data, FHSIZE)) {
  952. X        return (FALSE);
  953. X    }
  954. X    return (TRUE);
  955. X}
  956. X
  957. X
  958. X
  959. X
  960. Xbool_t
  961. Xxdr_fhstatus(xdrs, objp)
  962. X    XDR *xdrs;
  963. X    fhstatus *objp;
  964. X{
  965. X    if (!xdr_u_int(xdrs, &objp->fhs_status)) {
  966. X        return (FALSE);
  967. X    }
  968. X    switch (objp->fhs_status) {
  969. X    case 0:
  970. X        if (!xdr_alex_fhandle(xdrs, &objp->fhstatus_u.fhs_fhandle)) {
  971. X            return (FALSE);
  972. X        }
  973. X        break;
  974. X    }
  975. X    return (TRUE);
  976. X}
  977. X
  978. X
  979. X
  980. X
  981. Xbool_t
  982. Xxdr_dirpath(xdrs, objp)
  983. X    XDR *xdrs;
  984. X    dirpath *objp;
  985. X{
  986. X    if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
  987. X        return (FALSE);
  988. X    }
  989. X    return (TRUE);
  990. X}
  991. X
  992. X
  993. X
  994. X
  995. Xbool_t
  996. Xxdr_name(xdrs, objp)
  997. X    XDR *xdrs;
  998. X    name *objp;
  999. X{
  1000. X    if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
  1001. X        return (FALSE);
  1002. X    }
  1003. X    return (TRUE);
  1004. X}
  1005. X
  1006. X
  1007. X
  1008. X
  1009. Xbool_t
  1010. Xxdr_mountlist(xdrs, objp)
  1011. X    XDR *xdrs;
  1012. X    mountlist *objp;
  1013. X{
  1014. X    if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), xdr_mountbody)) {
  1015. X        return (FALSE);
  1016. X    }
  1017. X    return (TRUE);
  1018. X}
  1019. X
  1020. X
  1021. X
  1022. X
  1023. Xbool_t
  1024. Xxdr_mountbody(xdrs, objp)
  1025. X    XDR *xdrs;
  1026. X    mountbody *objp;
  1027. X{
  1028. X    if (!xdr_name(xdrs, &objp->ml_hostname)) {
  1029. X        return (FALSE);
  1030. X    }
  1031. X    if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
  1032. X        return (FALSE);
  1033. X    }
  1034. X    if (!xdr_mountlist(xdrs, &objp->ml_next)) {
  1035. X        return (FALSE);
  1036. X    }
  1037. X    return (TRUE);
  1038. X}
  1039. X
  1040. X
  1041. X
  1042. X
  1043. Xbool_t
  1044. Xxdr_grouplist(xdrs, objp)
  1045. X    XDR *xdrs;
  1046. X    grouplist *objp;
  1047. X{
  1048. X    if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), xdr_groupnode)) {
  1049. X        return (FALSE);
  1050. X    }
  1051. X    return (TRUE);
  1052. X}
  1053. X
  1054. X
  1055. X
  1056. X
  1057. Xbool_t
  1058. Xxdr_groupnode(xdrs, objp)
  1059. X    XDR *xdrs;
  1060. X    groupnode *objp;
  1061. X{
  1062. X    if (!xdr_name(xdrs, &objp->gr_name)) {
  1063. X        return (FALSE);
  1064. X    }
  1065. X    if (!xdr_grouplist(xdrs, &objp->gr_next)) {
  1066. X        return (FALSE);
  1067. X    }
  1068. X    return (TRUE);
  1069. X}
  1070. X
  1071. X
  1072. X
  1073. X
  1074. Xbool_t
  1075. Xxdr_exportlist(xdrs, objp)
  1076. X    XDR *xdrs;
  1077. X    exportlist *objp;
  1078. X{
  1079. X    if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), xdr_exportnode)) {
  1080. X        return (FALSE);
  1081. X    }
  1082. X    return (TRUE);
  1083. X}
  1084. X
  1085. X
  1086. X
  1087. X
  1088. Xbool_t
  1089. Xxdr_exportnode(xdrs, objp)
  1090. X    XDR *xdrs;
  1091. X    exportnode *objp;
  1092. X{
  1093. X    if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
  1094. X        return (FALSE);
  1095. X    }
  1096. X    if (!xdr_grouplist(xdrs, &objp->ex_groups)) {
  1097. X        return (FALSE);
  1098. X    }
  1099. X    if (!xdr_exportlist(xdrs, &objp->ex_next)) {
  1100. X        return (FALSE);
  1101. X    }
  1102. X    return (TRUE);
  1103. X}
  1104. X
  1105. X
  1106. END_OF_FILE
  1107.   if test 2141 -ne `wc -c <'alexsrvr/src/mount_xdr.c'`; then
  1108.     echo shar: \"'alexsrvr/src/mount_xdr.c'\" unpacked with wrong size!
  1109.   fi
  1110.   # end of 'alexsrvr/src/mount_xdr.c'
  1111. fi
  1112. if test -f 'alexsrvr/src/num' -a "${1}" != "-c" ; then 
  1113.   echo shar: Will not clobber existing file \"'alexsrvr/src/num'\"
  1114. else
  1115.   echo shar: Extracting \"'alexsrvr/src/num'\" \(3 characters\)
  1116.   sed "s/^X//" >'alexsrvr/src/num' <<'END_OF_FILE'
  1117. X45
  1118. END_OF_FILE
  1119.   if test 3 -ne `wc -c <'alexsrvr/src/num'`; then
  1120.     echo shar: \"'alexsrvr/src/num'\" unpacked with wrong size!
  1121.   fi
  1122.   # end of 'alexsrvr/src/num'
  1123. fi
  1124. if test -f 'alexsrvr/src/patchalex' -a "${1}" != "-c" ; then 
  1125.   echo shar: Will not clobber existing file \"'alexsrvr/src/patchalex'\"
  1126. else
  1127.   echo shar: Extracting \"'alexsrvr/src/patchalex'\" \(882 characters\)
  1128.   sed "s/^X//" >'alexsrvr/src/patchalex' <<'END_OF_FILE'
  1129. X#!/bin/csh -f
  1130. X#
  1131. X# The Alex release comes with a ~/src/num that indicates what
  1132. X# patch level it is up to.  This script can then be used to
  1133. X# update from there to the current release.
  1134. X#
  1135. X
  1136. Xset DIFFDIR = /alex/edu/cmu/cs/sp/alex/src/diffs
  1137. X
  1138. Xcat $DIFFDIR/.alex.update >& /dev/null
  1139. X
  1140. Xset WEHAVEFILE = ~/src/num
  1141. Xif (-f $WEHAVEFILE) then
  1142. X   set WEHAVE = `cat $WEHAVEFILE`
  1143. Xelse
  1144. X   echo "You can only run patchalex on versions shipped with a num file."
  1145. X   exit -1
  1146. Xendif
  1147. X
  1148. Xset CURRENT = `cat $DIFFDIR/num`
  1149. X
  1150. Xcd ~
  1151. X
  1152. Xecho "We have $WEHAVE and current is $CURRENT"
  1153. X
  1154. X
  1155. Xwhile ($WEHAVE < $CURRENT) 
  1156. X   @ next = $WEHAVE + 1     
  1157. X   echo " "
  1158. X   echo "About to do $DIFFDIR/$next"
  1159. X   patch < $DIFFDIR/$next 
  1160. X   set WEHAVE = $next
  1161. X   echo $WEHAVE > $WEHAVEFILE
  1162. Xend
  1163. X
  1164. Xecho $WEHAVE > $WEHAVEFILE
  1165. X
  1166. Xecho " "
  1167. Xecho "patchalex will try to list any rejected patches in src (want No match, Exit 1)"
  1168. X/bin/ls -l src/*.rej
  1169. X
  1170. END_OF_FILE
  1171.   if test 882 -ne `wc -c <'alexsrvr/src/patchalex'`; then
  1172.     echo shar: \"'alexsrvr/src/patchalex'\" unpacked with wrong size!
  1173.   fi
  1174.   chmod +x 'alexsrvr/src/patchalex'
  1175.   # end of 'alexsrvr/src/patchalex'
  1176. fi
  1177. if test -f 'alexsrvr/src/remtimezonemain.c' -a "${1}" != "-c" ; then 
  1178.   echo shar: Will not clobber existing file \"'alexsrvr/src/remtimezonemain.c'\"
  1179. else
  1180.   echo shar: Extracting \"'alexsrvr/src/remtimezonemain.c'\" \(772 characters\)
  1181.   sed "s/^X//" >'alexsrvr/src/remtimezonemain.c' <<'END_OF_FILE'
  1182. X#include "alexincs.h"
  1183. X#include "alex.h"
  1184. X
  1185. X
  1186. XFILE *debugLog = NULL;
  1187. X
  1188. Xfh_fdclose()
  1189. X{
  1190. X}
  1191. X
  1192. Xmain(argc, argv)
  1193. Xint argc;
  1194. Xchar **argv;
  1195. X{
  1196. X    char *myname, *hostname;
  1197. X    char name[100];
  1198. X    int hesok, timezone;
  1199. X
  1200. X    myname = argv[0];
  1201. X    if (argc > 2) {
  1202. X        printf("usage: %s hostname\n", myname);
  1203. X        exit(1);
  1204. X    } else if (argc == 2) {
  1205. X        hostname = argv[1];
  1206. X    } else {
  1207. X        (void) scanf("%s", name);
  1208. X        hostname=name;
  1209. X    }
  1210. X        
  1211. X
  1212. X    do {
  1213. X        hesok=HisClockIsOK(name);
  1214. X        if (hesok) {
  1215. X            printf("His clock is ok. \n");
  1216. X        } else {
  1217. X            printf("His clock is ok. \n");
  1218. X        }
  1219. X        
  1220. X        timezone=RemTimeZone(name);
  1221. X        printf("And the answer is %d\n", timezone);
  1222. X    } while (scanf("%s", name) != EOF);
  1223. X}
  1224. X
  1225. X
  1226. X
  1227. X
  1228. END_OF_FILE
  1229.   if test 772 -ne `wc -c <'alexsrvr/src/remtimezonemain.c'`; then
  1230.     echo shar: \"'alexsrvr/src/remtimezonemain.c'\" unpacked with wrong size!
  1231.   fi
  1232.   # end of 'alexsrvr/src/remtimezonemain.c'
  1233. fi
  1234. if test -f 'alexsrvr/src/rpc/auth_unix.h' -a "${1}" != "-c" ; then 
  1235.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/auth_unix.h'\"
  1236. else
  1237.   echo shar: Extracting \"'alexsrvr/src/rpc/auth_unix.h'\" \(2413 characters\)
  1238.   sed "s/^X//" >'alexsrvr/src/rpc/auth_unix.h' <<'END_OF_FILE'
  1239. X/* @(#)auth_unix.h    2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
  1240. X/*
  1241. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1242. X * unrestricted use provided that this legend is included on all tape
  1243. X * media and as a part of the software program in whole or part.  Users
  1244. X * may copy or modify Sun RPC without charge, but are not authorized
  1245. X * to license or distribute it to anyone else except as part of a product or
  1246. X * program developed by the user.
  1247. X * 
  1248. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1249. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1250. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1251. X * 
  1252. X * Sun RPC is provided with no support and without any obligation on the
  1253. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1254. X * modification or enhancement.
  1255. X * 
  1256. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1257. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1258. X * OR ANY PART THEREOF.
  1259. X * 
  1260. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1261. X * or profits or other special, indirect and consequential damages, even if
  1262. X * Sun has been advised of the possibility of such damages.
  1263. X * 
  1264. X * Sun Microsystems, Inc.
  1265. X * 2550 Garcia Avenue
  1266. X * Mountain View, California  94043
  1267. X */
  1268. X/*      @(#)auth_unix.h 1.5 86/07/16 SMI      */
  1269. X
  1270. X/*
  1271. X * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
  1272. X *
  1273. X * Copyright (C) 1984, Sun Microsystems, Inc.
  1274. X */
  1275. X
  1276. X/*
  1277. X * The system is very weak.  The client uses no encryption for  it
  1278. X * credentials and only sends null verifiers.  The server sends backs
  1279. X * null verifiers or optionally a verifier that suggests a new short hand
  1280. X * for the credentials.
  1281. X */
  1282. X
  1283. X/* The machine name is part of a credential; it may not exceed 255 bytes */
  1284. X#define MAX_MACHINE_NAME 255
  1285. X
  1286. X/* gids compose part of a credential; there may not be more than 16 of them */
  1287. X#define NGRPS 16
  1288. X
  1289. X/*
  1290. X * Unix style credentials.
  1291. X */
  1292. Xstruct authunix_parms {
  1293. X    u_long     aup_time;
  1294. X    char    *aup_machname;
  1295. X    int     aup_uid;
  1296. X    int     aup_gid;
  1297. X    u_int     aup_len;
  1298. X    int    *aup_gids;
  1299. X};
  1300. X
  1301. Xextern bool_t xdr_authunix_parms();
  1302. X
  1303. X/* 
  1304. X * If a response verifier has flavor AUTH_SHORT, 
  1305. X * then the body of the response verifier encapsulates the following structure;
  1306. X * again it is serialized in the obvious fashion.
  1307. X */
  1308. Xstruct short_hand_verf {
  1309. X    struct opaque_auth new_cred;
  1310. X};
  1311. END_OF_FILE
  1312.   if test 2413 -ne `wc -c <'alexsrvr/src/rpc/auth_unix.h'`; then
  1313.     echo shar: \"'alexsrvr/src/rpc/auth_unix.h'\" unpacked with wrong size!
  1314.   fi
  1315.   # end of 'alexsrvr/src/rpc/auth_unix.h'
  1316. fi
  1317. if test -f 'alexsrvr/src/rpc/netdb.h' -a "${1}" != "-c" ; then 
  1318.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/netdb.h'\"
  1319. else
  1320.   echo shar: Extracting \"'alexsrvr/src/rpc/netdb.h'\" \(1660 characters\)
  1321.   sed "s/^X//" >'alexsrvr/src/rpc/netdb.h' <<'END_OF_FILE'
  1322. X/* @(#)netdb.h    2.1 88/07/29 3.9 RPCSRC */
  1323. X/*
  1324. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1325. X * unrestricted use provided that this legend is included on all tape
  1326. X * media and as a part of the software program in whole or part.  Users
  1327. X * may copy or modify Sun RPC without charge, but are not authorized
  1328. X * to license or distribute it to anyone else except as part of a product or
  1329. X * program developed by the user.
  1330. X * 
  1331. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1332. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1333. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1334. X * 
  1335. X * Sun RPC is provided with no support and without any obligation on the
  1336. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1337. X * modification or enhancement.
  1338. X *
  1339. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1340. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1341. X * OR ANY PART THEREOF.
  1342. X * 
  1343. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1344. X * or profits or other special, indirect and consequential damages, even if
  1345. X * Sun has been advised of the possibility of such damages.
  1346. X * 
  1347. X * Sun Microsystems, Inc.
  1348. X * 2550 Garcia Avenue
  1349. X * Mountain View, California  94043
  1350. X */
  1351. X/*    @(#)rpc.h 1.8 87/07/24 SMI    */
  1352. X
  1353. X/* Really belongs in <netdb.h> */
  1354. X
  1355. X/* vac 2/18/91
  1356. X
  1357. Xstruct rpcent {
  1358. X      char    *r_name;        /* name of server for this rpc program * /
  1359. X      char    **r_aliases;    /* alias list * /
  1360. X      int     r_number;       /* rpc program number * /
  1361. X};
  1362. X
  1363. X*/
  1364. X
  1365. Xstruct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
  1366. END_OF_FILE
  1367.   if test 1660 -ne `wc -c <'alexsrvr/src/rpc/netdb.h'`; then
  1368.     echo shar: \"'alexsrvr/src/rpc/netdb.h'\" unpacked with wrong size!
  1369.   fi
  1370.   # end of 'alexsrvr/src/rpc/netdb.h'
  1371. fi
  1372. if test -f 'alexsrvr/src/rpc/pmap_clnt.h' -a "${1}" != "-c" ; then 
  1373.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/pmap_clnt.h'\"
  1374. else
  1375.   echo shar: Extracting \"'alexsrvr/src/rpc/pmap_clnt.h'\" \(2509 characters\)
  1376.   sed "s/^X//" >'alexsrvr/src/rpc/pmap_clnt.h' <<'END_OF_FILE'
  1377. X/* @(#)pmap_clnt.h    2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
  1378. X/*
  1379. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1380. X * unrestricted use provided that this legend is included on all tape
  1381. X * media and as a part of the software program in whole or part.  Users
  1382. X * may copy or modify Sun RPC without charge, but are not authorized
  1383. X * to license or distribute it to anyone else except as part of a product or
  1384. X * program developed by the user.
  1385. X * 
  1386. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1387. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1388. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1389. X * 
  1390. X * Sun RPC is provided with no support and without any obligation on the
  1391. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1392. X * modification or enhancement.
  1393. X * 
  1394. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1395. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1396. X * OR ANY PART THEREOF.
  1397. X * 
  1398. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1399. X * or profits or other special, indirect and consequential damages, even if
  1400. X * Sun has been advised of the possibility of such damages.
  1401. X * 
  1402. X * Sun Microsystems, Inc.
  1403. X * 2550 Garcia Avenue
  1404. X * Mountain View, California  94043
  1405. X */
  1406. X
  1407. X/*
  1408. X * pmap_clnt.h
  1409. X * Supplies C routines to get to portmap services.
  1410. X *
  1411. X * Copyright (C) 1984, Sun Microsystems, Inc.
  1412. X */
  1413. X
  1414. X/*
  1415. X * Usage:
  1416. X *    success = pmap_set(program, version, protocol, port);
  1417. X *    success = pmap_unset(program, version);
  1418. X *    port = pmap_getport(address, program, version, protocol);
  1419. X *    head = pmap_getmaps(address);
  1420. X *    clnt_stat = pmap_rmtcall(address, program, version, procedure,
  1421. X *        xdrargs, argsp, xdrres, resp, tout, port_ptr)
  1422. X *        (works for udp only.) 
  1423. X *     clnt_stat = clnt_broadcast(program, version, procedure,
  1424. X *        xdrargs, argsp,    xdrres, resp, eachresult)
  1425. X *        (like pmap_rmtcall, except the call is broadcasted to all
  1426. X *        locally connected nets.  For each valid response received,
  1427. X *        the procedure eachresult is called.  Its form is:
  1428. X *    done = eachresult(resp, raddr)
  1429. X *        bool_t done;
  1430. X *        caddr_t resp;
  1431. X *        struct sockaddr_in raddr;
  1432. X *        where resp points to the results of the call and raddr is the
  1433. X *        address if the responder to the broadcast.
  1434. X */
  1435. X
  1436. Xextern bool_t        pmap_set();
  1437. Xextern bool_t        pmap_unset();
  1438. Xextern struct pmaplist    *pmap_getmaps();
  1439. Xenum clnt_stat        pmap_rmtcall();
  1440. Xenum clnt_stat        clnt_broadcast();
  1441. Xextern u_short        pmap_getport();
  1442. END_OF_FILE
  1443.   if test 2509 -ne `wc -c <'alexsrvr/src/rpc/pmap_clnt.h'`; then
  1444.     echo shar: \"'alexsrvr/src/rpc/pmap_clnt.h'\" unpacked with wrong size!
  1445.   fi
  1446.   # end of 'alexsrvr/src/rpc/pmap_clnt.h'
  1447. fi
  1448. if test -f 'alexsrvr/src/rpc/pmap_prot.h' -a "${1}" != "-c" ; then 
  1449.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/pmap_prot.h'\"
  1450. else
  1451.   echo shar: Extracting \"'alexsrvr/src/rpc/pmap_prot.h'\" \(3333 characters\)
  1452.   sed "s/^X//" >'alexsrvr/src/rpc/pmap_prot.h' <<'END_OF_FILE'
  1453. X/* @(#)pmap_prot.h    2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
  1454. X/*
  1455. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1456. X * unrestricted use provided that this legend is included on all tape
  1457. X * media and as a part of the software program in whole or part.  Users
  1458. X * may copy or modify Sun RPC without charge, but are not authorized
  1459. X * to license or distribute it to anyone else except as part of a product or
  1460. X * program developed by the user.
  1461. X * 
  1462. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1463. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1464. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1465. X * 
  1466. X * Sun RPC is provided with no support and without any obligation on the
  1467. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1468. X * modification or enhancement.
  1469. X * 
  1470. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1471. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1472. X * OR ANY PART THEREOF.
  1473. X * 
  1474. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1475. X * or profits or other special, indirect and consequential damages, even if
  1476. X * Sun has been advised of the possibility of such damages.
  1477. X * 
  1478. X * Sun Microsystems, Inc.
  1479. X * 2550 Garcia Avenue
  1480. X * Mountain View, California  94043
  1481. X */
  1482. X
  1483. X/*
  1484. X * pmap_prot.h
  1485. X * Protocol for the local binder service, or pmap.
  1486. X *
  1487. X * Copyright (C) 1984, Sun Microsystems, Inc.
  1488. X *
  1489. X * The following procedures are supported by the protocol:
  1490. X *
  1491. X * PMAPPROC_NULL() returns ()
  1492. X *     takes nothing, returns nothing
  1493. X *
  1494. X * PMAPPROC_SET(struct pmap) returns (bool_t)
  1495. X *     TRUE is success, FALSE is failure.  Registers the tuple
  1496. X *    [prog, vers, prot, port].
  1497. X *
  1498. X * PMAPPROC_UNSET(struct pmap) returns (bool_t)
  1499. X *    TRUE is success, FALSE is failure.  Un-registers pair
  1500. X *    [prog, vers].  prot and port are ignored.
  1501. X *
  1502. X * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
  1503. X *    0 is failure.  Otherwise returns the port number where the pair
  1504. X *    [prog, vers] is registered.  It may lie!
  1505. X *
  1506. X * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
  1507. X *
  1508. X * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
  1509. X *     RETURNS (port, string<>);
  1510. X * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
  1511. X *     Calls the procedure on the local machine.  If it is not registered,
  1512. X *    this procedure is quite; ie it does not return error information!!!
  1513. X *    This procedure only is supported on rpc/udp and calls via
  1514. X *    rpc/udp.  This routine only passes null authentication parameters.
  1515. X *    This file has no interface to xdr routines for PMAPPROC_CALLIT.
  1516. X *
  1517. X * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
  1518. X */
  1519. X
  1520. X#define PMAPPORT        ((u_short)111)
  1521. X#define PMAPPROG        ((u_long)100000)
  1522. X#define PMAPVERS        ((u_long)2)
  1523. X#define PMAPVERS_PROTO        ((u_long)2)
  1524. X#define PMAPVERS_ORIG        ((u_long)1)
  1525. X#define PMAPPROC_NULL        ((u_long)0)
  1526. X#define PMAPPROC_SET        ((u_long)1)
  1527. X#define PMAPPROC_UNSET        ((u_long)2)
  1528. X#define PMAPPROC_GETPORT    ((u_long)3)
  1529. X#define PMAPPROC_DUMP        ((u_long)4)
  1530. X#define PMAPPROC_CALLIT        ((u_long)5)
  1531. X
  1532. Xstruct pmap {
  1533. X    long unsigned pm_prog;
  1534. X    long unsigned pm_vers;
  1535. X    long unsigned pm_prot;
  1536. X    long unsigned pm_port;
  1537. X};
  1538. X
  1539. Xextern bool_t xdr_pmap();
  1540. X
  1541. Xstruct pmaplist {
  1542. X    struct pmap    pml_map;
  1543. X    struct pmaplist *pml_next;
  1544. X};
  1545. X
  1546. Xextern bool_t xdr_pmaplist();
  1547. END_OF_FILE
  1548.   if test 3333 -ne `wc -c <'alexsrvr/src/rpc/pmap_prot.h'`; then
  1549.     echo shar: \"'alexsrvr/src/rpc/pmap_prot.h'\" unpacked with wrong size!
  1550.   fi
  1551.   # end of 'alexsrvr/src/rpc/pmap_prot.h'
  1552. fi
  1553. if test -f 'alexsrvr/src/rpc/pmap_rmt.h' -a "${1}" != "-c" ; then 
  1554.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/pmap_rmt.h'\"
  1555. else
  1556.   echo shar: Extracting \"'alexsrvr/src/rpc/pmap_rmt.h'\" \(1761 characters\)
  1557.   sed "s/^X//" >'alexsrvr/src/rpc/pmap_rmt.h' <<'END_OF_FILE'
  1558. X/* @(#)pmap_rmt.h    2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
  1559. X/*
  1560. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1561. X * unrestricted use provided that this legend is included on all tape
  1562. X * media and as a part of the software program in whole or part.  Users
  1563. X * may copy or modify Sun RPC without charge, but are not authorized
  1564. X * to license or distribute it to anyone else except as part of a product or
  1565. X * program developed by the user.
  1566. X * 
  1567. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1568. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1569. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1570. X * 
  1571. X * Sun RPC is provided with no support and without any obligation on the
  1572. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1573. X * modification or enhancement.
  1574. X * 
  1575. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1576. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1577. X * OR ANY PART THEREOF.
  1578. X * 
  1579. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1580. X * or profits or other special, indirect and consequential damages, even if
  1581. X * Sun has been advised of the possibility of such damages.
  1582. X * 
  1583. X * Sun Microsystems, Inc.
  1584. X * 2550 Garcia Avenue
  1585. X * Mountain View, California  94043
  1586. X */
  1587. X
  1588. X/*
  1589. X * Structures and XDR routines for parameters to and replies from
  1590. X * the portmapper remote-call-service.
  1591. X *
  1592. X * Copyright (C) 1986, Sun Microsystems, Inc.
  1593. X */
  1594. X
  1595. Xstruct rmtcallargs {
  1596. X    u_long prog, vers, proc, arglen;
  1597. X    caddr_t args_ptr;
  1598. X    xdrproc_t xdr_args;
  1599. X};
  1600. X
  1601. Xbool_t xdr_rmtcall_args();
  1602. X
  1603. Xstruct rmtcallres {
  1604. X    u_long *port_ptr;
  1605. X    u_long resultslen;
  1606. X    caddr_t results_ptr;
  1607. X    xdrproc_t xdr_results;
  1608. X};
  1609. X
  1610. Xbool_t xdr_rmtcallres();
  1611. END_OF_FILE
  1612.   if test 1761 -ne `wc -c <'alexsrvr/src/rpc/pmap_rmt.h'`; then
  1613.     echo shar: \"'alexsrvr/src/rpc/pmap_rmt.h'\" unpacked with wrong size!
  1614.   fi
  1615.   # end of 'alexsrvr/src/rpc/pmap_rmt.h'
  1616. fi
  1617. if test -f 'alexsrvr/src/rpc/rpc.h' -a "${1}" != "-c" ; then 
  1618.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/rpc.h'\"
  1619. else
  1620.   echo shar: Extracting \"'alexsrvr/src/rpc/rpc.h'\" \(2792 characters\)
  1621.   sed "s/^X//" >'alexsrvr/src/rpc/rpc.h' <<'END_OF_FILE'
  1622. X/* @(#)rpc.h    2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
  1623. X/*
  1624. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1625. X * unrestricted use provided that this legend is included on all tape
  1626. X * media and as a part of the software program in whole or part.  Users
  1627. X * may copy or modify Sun RPC without charge, but are not authorized
  1628. X * to license or distribute it to anyone else except as part of a product or
  1629. X * program developed by the user.
  1630. X * 
  1631. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1632. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1633. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1634. X * 
  1635. X * Sun RPC is provided with no support and without any obligation on the
  1636. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1637. X * modification or enhancement.
  1638. X *
  1639. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1640. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1641. X * OR ANY PART THEREOF.
  1642. X *
  1643. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1644. X * or profits or other special, indirect and consequential damages, even if
  1645. X * Sun has been advised of the possibility of such damages.
  1646. X *
  1647. X * Sun Microsystems, Inc.
  1648. X * 2550 Garcia Avenue
  1649. X * Mountain View, California  94043
  1650. X */
  1651. X
  1652. X/*
  1653. X * rpc.h, Just includes the billions of rpc header files necessary to
  1654. X * do remote procedure calling.
  1655. X *
  1656. X * Copyright (C) 1984, Sun Microsystems, Inc.
  1657. X */
  1658. X#ifndef __RPC_HEADER__
  1659. X#define __RPC_HEADER__
  1660. X
  1661. X#include <rpc/types.h>        /* some typedefs */
  1662. X#include <netinet/in.h>
  1663. X
  1664. X/* external data representation interfaces */
  1665. X#include <rpc/xdr.h>        /* generic (de)serializer */
  1666. X
  1667. X/* Client side only authentication */
  1668. X#include <rpc/auth.h>        /* generic authenticator (client side) */
  1669. X
  1670. X/* Client side (mostly) remote procedure call */
  1671. X#include <rpc/clnt.h>        /* generic rpc stuff */
  1672. X
  1673. X/* semi-private protocol headers */
  1674. X#include <rpc/rpc_msg.h>    /* protocol for rpc messages */
  1675. X#include <rpc/auth_unix.h>    /* protocol for unix style cred */
  1676. X/*
  1677. X *  Uncomment-out the next line if you are building the rpc library with    
  1678. X *  DES Authentication (see the README file in the secure_rpc/ directory).
  1679. X */
  1680. X/*#include <rpc/auth_des.h>    /* protocol for des style cred */
  1681. X
  1682. X/* Server side only remote procedure callee */
  1683. X#include <rpc/svc.h>        /* service manager and multiplexer */
  1684. X#include <rpc/svc_auth.h>    /* service side authenticator */
  1685. X
  1686. X/*
  1687. X * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
  1688. X * OF UNIX BASED ON NFSSRC.  These systems will already have the structures
  1689. X * defined by <rpc/netdb.h> included in <netdb.h>.
  1690. X */
  1691. X/* routines for parsing /etc/rpc */
  1692. X#include <rpc/netdb.h>        /* structures and routines to parse /etc/rpc */
  1693. X
  1694. X#endif /* ndef __RPC_HEADER__ */
  1695. END_OF_FILE
  1696.   if test 2792 -ne `wc -c <'alexsrvr/src/rpc/rpc.h'`; then
  1697.     echo shar: \"'alexsrvr/src/rpc/rpc.h'\" unpacked with wrong size!
  1698.   fi
  1699.   # end of 'alexsrvr/src/rpc/rpc.h'
  1700. fi
  1701. if test -f 'alexsrvr/src/rpc/types.h' -a "${1}" != "-c" ; then 
  1702.   echo shar: Will not clobber existing file \"'alexsrvr/src/rpc/types.h'\"
  1703. else
  1704.   echo shar: Extracting \"'alexsrvr/src/rpc/types.h'\" \(2008 characters\)
  1705.   sed "s/^X//" >'alexsrvr/src/rpc/types.h' <<'END_OF_FILE'
  1706. X/* @(#)types.h    2.3 88/08/15 4.0 RPCSRC */
  1707. X/*
  1708. X * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  1709. X * unrestricted use provided that this legend is included on all tape
  1710. X * media and as a part of the software program in whole or part.  Users
  1711. X * may copy or modify Sun RPC without charge, but are not authorized
  1712. X * to license or distribute it to anyone else except as part of a product or
  1713. X * program developed by the user.
  1714. X * 
  1715. X * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  1716. X * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  1717. X * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  1718. X * 
  1719. X * Sun RPC is provided with no support and without any obligation on the
  1720. X * part of Sun Microsystems, Inc. to assist in its use, correction,
  1721. X * modification or enhancement.
  1722. X * 
  1723. X * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  1724. X * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  1725. X * OR ANY PART THEREOF.
  1726. X * 
  1727. X * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  1728. X * or profits or other special, indirect and consequential damages, even if
  1729. X * Sun has been advised of the possibility of such damages.
  1730. X * 
  1731. X * Sun Microsystems, Inc.
  1732. X * 2550 Garcia Avenue
  1733. X * Mountain View, California  94043
  1734. X */
  1735. X/*      @(#)types.h 1.18 87/07/24 SMI      */
  1736. X
  1737. X/*
  1738. X * Rpc additions to <sys/types.h>
  1739. X */
  1740. X#ifndef __TYPES_RPC_HEADER__
  1741. X#define __TYPES_RPC_HEADER__
  1742. X
  1743. X#define    bool_t    int
  1744. X#define    enum_t    int
  1745. X#define    FALSE    (0)
  1746. X#define    TRUE    (1)
  1747. X#define __dontcare__    -1
  1748. X#ifndef NULL
  1749. X#    define NULL 0
  1750. X#endif
  1751. X
  1752. Xextern char *malloc();
  1753. X#define mem_alloc(bsize)    malloc(bsize)
  1754. X#define mem_free(ptr, bsize)    free(ptr)
  1755. X
  1756. X#ifndef makedev /* ie, we haven't already included it */
  1757. X#include <sys/types.h>
  1758. X#endif
  1759. X#include <sys/time.h>
  1760. X
  1761. X/* vac
  1762. X#ifndef INADDR_LOOPBACK
  1763. X#define       INADDR_LOOPBACK         (u_long)0x7F000001
  1764. X#endif
  1765. X */
  1766. X
  1767. X#ifndef MAXHOSTNAMELEN
  1768. X#define        MAXHOSTNAMELEN  64
  1769. X#endif
  1770. X
  1771. X#endif /* ndef __TYPES_RPC_HEADER__ */
  1772. END_OF_FILE
  1773.   if test 2008 -ne `wc -c <'alexsrvr/src/rpc/types.h'`; then
  1774.     echo shar: \"'alexsrvr/src/rpc/types.h'\" unpacked with wrong size!
  1775.   fi
  1776.   # end of 'alexsrvr/src/rpc/types.h'
  1777. fi
  1778. if test -f 'alexsrvr/src/scripts/alex.nanny' -a "${1}" != "-c" ; then 
  1779.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/alex.nanny'\"
  1780. else
  1781.   echo shar: Extracting \"'alexsrvr/src/scripts/alex.nanny'\" \(1292 characters\)
  1782.   sed "s/^X//" >'alexsrvr/src/scripts/alex.nanny' <<'END_OF_FILE'
  1783. X#!/bin/csh -f
  1784. X#
  1785. X# If Alex crashes save the logs and restart
  1786. X#
  1787. X# the ls -l gets the top 2 levels in the file handle cache
  1788. X#    the actual fh can reach up 7 levels to something in the cache
  1789. X#    this means that paths of 9 or more should work even after restarts
  1790. X#
  1791. X# wait is waiting for alexd to crash (which makes restart.alex finish)
  1792. X
  1793. Xset NUM=1
  1794. X
  1795. Xset LOGDIR     = `BINDIR/defs logdir`
  1796. Xset ALEXSRVR   = `BINDIR/defs alexsrvr`
  1797. Xset DEBUGLEVEL = `BINDIR/defs debuglevel`
  1798. X
  1799. X
  1800. Xset EPIC     = `/bin/date | awk '{print $2_$3_$4}'`
  1801. Xset OLDLOGS  = $LOGDIR/oldlogs.$EPIC
  1802. Xmkdir $OLDLOGS
  1803. Xchown $ALEXSRVR $OLDLOGS
  1804. Xset nonomatch
  1805. Xmv -f $LOGDIR/old.*       $OLDLOGS
  1806. Xmv -f $LOGDIR/alex.log.*  $OLDLOGS
  1807. X
  1808. Xif ($DEBUGLEVEL < 5) then
  1809. X    echo "Will remove oldlogs.* in background"
  1810. X    (sleep 60; /bin/rm -rf $LOGDIR/oldlogs.*) &
  1811. Xendif
  1812. X
  1813. Xwhile (1)
  1814. X    date
  1815. X    (sleep 10; if (-d /alex/edu) /bin/ls -l /alex) >& /dev/null &
  1816. X
  1817. X    BINDIR/restart.alex 
  1818. X
  1819. X    set NEWDIR=$LOGDIR/old.$NUM
  1820. X    mkdir $NEWDIR
  1821. X    chown $ALEXSRVR $NEWDIR
  1822. X    mv    $LOGDIR/alex.log*     $NEWDIR
  1823. X    /bin/rm  -f $LOGDIR/ftp.log*  >& /dev/null
  1824. X    if ($DEBUGLEVEL < 5) then
  1825. X        echo "Will remove the old logs in 10 minutes"
  1826. X        (sleep 600; /bin/rm -rf $NEWDIR) &
  1827. X    endif
  1828. X
  1829. X    @ NUM++
  1830. X    echo $0 
  1831. X    echo $NUM
  1832. X    date
  1833. X    sleep 10
  1834. Xend
  1835. X
  1836. X
  1837. X
  1838. END_OF_FILE
  1839.   if test 1292 -ne `wc -c <'alexsrvr/src/scripts/alex.nanny'`; then
  1840.     echo shar: \"'alexsrvr/src/scripts/alex.nanny'\" unpacked with wrong size!
  1841.   fi
  1842.   chmod +x 'alexsrvr/src/scripts/alex.nanny'
  1843.   # end of 'alexsrvr/src/scripts/alex.nanny'
  1844. fi
  1845. if test -f 'alexsrvr/src/scripts/evictor.nanny' -a "${1}" != "-c" ; then 
  1846.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/evictor.nanny'\"
  1847. else
  1848.   echo shar: Extracting \"'alexsrvr/src/scripts/evictor.nanny'\" \(1298 characters\)
  1849.   sed "s/^X//" >'alexsrvr/src/scripts/evictor.nanny' <<'END_OF_FILE'
  1850. X#!/bin/csh -f
  1851. X#
  1852. X# This makes a list of files with ages and sizes,
  1853. X#  and then feeds this to "evictor" which evicts files from the
  1854. X#  cache as disk space is needed.
  1855. X#
  1856. X# Evictor exits every night at 4 am so that a new find can be done,
  1857. X# or when it has used up too many files.
  1858. X#
  1859. X# evictor.output has output for the last day
  1860. X#
  1861. X
  1862. Xset DEFS = BINDIR/defs
  1863. X
  1864. Xset ALEXSRVR    = `$DEFS alexsrvr`
  1865. Xset EFFUSER = `whoami`
  1866. X
  1867. Xif (($EFFUSER == root ) || ($EFFUSER == rootl)) then
  1868. X    echo "Going to run as $ALEXSRVR"
  1869. X    exec su $ALEXSRVR -c BINDIR/evictor.nanny
  1870. X    exit $status
  1871. Xendif
  1872. X
  1873. Xif ($EFFUSER != $ALEXSRVR ) then
  1874. X    echo "Must be run by root or $ALEXSRVR not $EFFUSER"
  1875. X    exit -8
  1876. Xendif
  1877. X
  1878. Xnice +10
  1879. X
  1880. X
  1881. Xset CACHEDIR=`$DEFS cachedir`
  1882. Xecho "CACHEDIR is $CACHEDIR"
  1883. X
  1884. Xset CACHEINFOHEAD = `$DEFS cacheinfohead`
  1885. Xecho "CACHEINFOHEAD is $CACHEINFOHEAD"
  1886. X
  1887. Xset T=`$DEFS tmpdir`
  1888. Xecho "The temporary directory we are using is $T"
  1889. X
  1890. Xif (! -e $T) then
  1891. X    echo "Making tmp directory"
  1892. X    mkdir $T
  1893. Xendif
  1894. X
  1895. X
  1896. Xwhile (1)
  1897. X    date
  1898. X    if (! -f $T/nofind) then
  1899. X        find $CACHEDIR -print | BINDIR/printinfo | sort -nr -T $T | compress -c > $T/cacheinfo.Z
  1900. X        zcat $T/cacheinfo.Z | head -1 > $CACHEINFOHEAD
  1901. X        date
  1902. X    endif
  1903. X    /bin/rm -f $T/evictor.output
  1904. X    zcat $T/cacheinfo.Z | BINDIR/evictor >& $T/evictor.output
  1905. Xend
  1906. X
  1907. X
  1908. X
  1909. END_OF_FILE
  1910.   if test 1298 -ne `wc -c <'alexsrvr/src/scripts/evictor.nanny'`; then
  1911.     echo shar: \"'alexsrvr/src/scripts/evictor.nanny'\" unpacked with wrong size!
  1912.   fi
  1913.   chmod +x 'alexsrvr/src/scripts/evictor.nanny'
  1914.   # end of 'alexsrvr/src/scripts/evictor.nanny'
  1915. fi
  1916. if test -f 'alexsrvr/src/scripts/grepnkill' -a "${1}" != "-c" ; then 
  1917.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/grepnkill'\"
  1918. else
  1919.   echo shar: Extracting \"'alexsrvr/src/scripts/grepnkill'\" \(428 characters\)
  1920.   sed "s/^X//" >'alexsrvr/src/scripts/grepnkill' <<'END_OF_FILE'
  1921. X#! /bin/csh -f
  1922. X# grepnkill - Grep and Kill
  1923. X#
  1924. X# grep ps -x for $1 and kill that process.
  1925. X#
  1926. X# Note that this process and the grep process are saved by the grep -v grep
  1927. X#    because the name of this script includes "grep"
  1928. X#
  1929. X
  1930. Xif (-f /hp-ux) then
  1931. X    set NUM=`ps -ef | grep $1 | grep -v grep | awk '{print $2}'`
  1932. Xelse
  1933. X    set NUM=`ps -auxww | grep $1 | grep -v grep | awk '{print $2}'`
  1934. Xendif
  1935. X
  1936. Xecho "About to kill $NUM"
  1937. Xkill -1 $NUM 
  1938. X
  1939. END_OF_FILE
  1940.   if test 428 -ne `wc -c <'alexsrvr/src/scripts/grepnkill'`; then
  1941.     echo shar: \"'alexsrvr/src/scripts/grepnkill'\" unpacked with wrong size!
  1942.   fi
  1943.   chmod +x 'alexsrvr/src/scripts/grepnkill'
  1944.   # end of 'alexsrvr/src/scripts/grepnkill'
  1945. fi
  1946. if test -f 'alexsrvr/src/scripts/grepnkill9' -a "${1}" != "-c" ; then 
  1947.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/grepnkill9'\"
  1948. else
  1949.   echo shar: Extracting \"'alexsrvr/src/scripts/grepnkill9'\" \(427 characters\)
  1950.   sed "s/^X//" >'alexsrvr/src/scripts/grepnkill9' <<'END_OF_FILE'
  1951. X#! /bin/csh -f
  1952. X# grepnkill - Grep and Kill
  1953. X#
  1954. X# grep ps -x for $1 and kill that process.
  1955. X#
  1956. X# Note that this process and the grep process are saved by the grep -v grep
  1957. X#    because the name of this script includes "grep"
  1958. X#
  1959. X
  1960. Xif (-f /hp-ux) then
  1961. X    set NUM=`ps -ef | grep $1 | grep -v grep | awk '{print $2}'`
  1962. Xelse
  1963. X    set NUM=`ps -auxww | grep $1 | grep -v grep | awk '{print $2}'`
  1964. Xendif
  1965. X
  1966. Xecho "About to kill $NUM"
  1967. Xkill -9 $NUM
  1968. X
  1969. END_OF_FILE
  1970.   if test 427 -ne `wc -c <'alexsrvr/src/scripts/grepnkill9'`; then
  1971.     echo shar: \"'alexsrvr/src/scripts/grepnkill9'\" unpacked with wrong size!
  1972.   fi
  1973.   chmod +x 'alexsrvr/src/scripts/grepnkill9'
  1974.   # end of 'alexsrvr/src/scripts/grepnkill9'
  1975. fi
  1976. if test -f 'alexsrvr/src/scripts/regression.test' -a "${1}" != "-c" ; then 
  1977.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/regression.test'\"
  1978. else
  1979.   echo shar: Extracting \"'alexsrvr/src/scripts/regression.test'\" \(3874 characters\)
  1980.   sed "s/^X//" >'alexsrvr/src/scripts/regression.test' <<'END_OF_FILE'
  1981. X#!/bin/csh -f
  1982. X#
  1983. X# usage:  regression.test [filewithpaths]
  1984. X# 
  1985. X# examples:
  1986. X#         regression.test
  1987. X#         regression.test ~/lib/testfiles
  1988. X#         regression.test ~/lib/testfiles.furmint
  1989. X#
  1990. X# Removes each of these files from the cache and then checks that
  1991. X# the size Alex shows is the same as what wc gives through alex 
  1992. X# and what ends up in the cache - all of which must not be zero.
  1993. X#
  1994. X
  1995. Xif (.$1. == ..) then
  1996. X    set INPUT   = $0
  1997. X    set COMMAND = "tail -11 "
  1998. Xelse
  1999. X    set INPUT   = $1
  2000. X    set COMMAND = cat
  2001. Xendif
  2002. X
  2003. Xecho $0
  2004. X
  2005. Xset DEFS = BINDIR/defs
  2006. Xset CACHEDIR=`$DEFS cachedir`
  2007. Xecho "The cache directory is $CACHEDIR"
  2008. X
  2009. Xecho "Removing furmint tree from cache"
  2010. X/bin/rm -rf $CACHEDIR/edu/cmu/cs/nectar/furmint
  2011. X
  2012. Xecho "Removing sp tree from cache to remove .alex.info with info on alex hostalias"
  2013. X/bin/rm -rf $CACHEDIR/edu/cmu/cs/sp
  2014. X
  2015. Xecho "Removing /ca/ucalgary/cpsc and children to test adding hosts"
  2016. X/bin/rm -rf $CACHEDIR/ca/ucalgary/cpsc
  2017. X
  2018. Xecho "Removing furmint, alex, and /alex/ca/ucalgary/cpsc (and spsc/*) from HostsList"
  2019. Xgrep    -v "/edu/cmu/cs/nectar/furmint" ~/lib/HostsList | \
  2020. X   grep -v "/edu/cmu/cs/sp/alex" | grep -v "/ca/ucalgary/cpsc" > ~/lib/HostsList.new
  2021. X
  2022. Xsleep 10
  2023. Xecho "Going to kill alexd both to see if it restarts ok and to use latest code"
  2024. XBINDIR/grepnkill alexd
  2025. X
  2026. X
  2027. Xsleep 30
  2028. Xecho "Doing an ls /alex"
  2029. X/bin/ls /alex
  2030. X
  2031. Xset TMP = /tmp/reg.test.tmp
  2032. X
  2033. X
  2034. Xset COUNTFIVE = 0
  2035. Xforeach FILE (`$COMMAND $INPUT`)
  2036. X    echo " "
  2037. X    echo $FILE
  2038. X    set CACHEDFILE = `echo $FILE | sed s./alex.$CACHEDIR.`
  2039. X
  2040. X    @ COUNTFIVE ++
  2041. X    echo $COUNTFIVE
  2042. X# 1,2,3 we remove - 4, we leave alone 
  2043. X# 5+ we make file wrong size if there and wait enough that Alex will refetch it then to 0
  2044. X    if ($COUNTFIVE > 4) then
  2045. X        (echo "Date to make wrong size" >> $CACHEDFILE) >& /dev/null
  2046. X        if ($status == 0) then
  2047. X            echo "Have made file in cache the wrong size - wait a bit"
  2048. X            sleep 65
  2049. X            set COUNTFIVE = 0
  2050. X        else 
  2051. X            echo "Could not make wrong size - directory must not exist"
  2052. X        endif
  2053. X    else
  2054. X        if ($COUNTFIVE < 4) then
  2055. X            /bin/rm -f $CACHEDFILE
  2056. X        endif
  2057. X    endif
  2058. X
  2059. X    echo "Going to do latency check"
  2060. X    /bin/time strings $FILE | head >& /dev/null
  2061. X
  2062. X    set WCSIZE = `/bin/time cat $FILE | wc -c`
  2063. X    if ($status != 0) goto error
  2064. X
  2065. X    set LSSIZE = `/bin/ls -l $FILE | awk '{print $4}'`
  2066. X    if ($status != 0) goto error
  2067. X
  2068. X    /bin/rm -f $TMP
  2069. X    sleep 1
  2070. X    (/bin/ls -l $CACHEDFILE > $TMP ) >& /dev/null
  2071. X    if ($status != 0) then
  2072. X        set CSIZE = 0
  2073. X    else 
  2074. X        set CSIZE = `head -2 $TMP | tail -1 | awk '{print $4}'`
  2075. X    endif
  2076. X
  2077. X
  2078. X    echo "LS= $LSSIZE   WC= $WCSIZE  C= $CSIZE"
  2079. X
  2080. X    if (($LSSIZE > 0) && ($LSSIZE == $WCSIZE) && ($WCSIZE == $CSIZE)) then
  2081. X        echo "Looks fine."
  2082. X    else
  2083. X        if (($LSSIZE > 0) && ($LSSIZE == $WCSIZE)) then
  2084. X            echo "Probably ok but ls-l of cached file shows wrong size "
  2085. X        else
  2086. X            echo "$FILE *****ERROR******"
  2087. X        endif
  2088. X    endif
  2089. X
  2090. X    echo " "
  2091. X    set status = 0
  2092. Xend
  2093. X
  2094. Xexit 0
  2095. X
  2096. Xerror:  echo "ERROR $status  $FILE"
  2097. Xexit -1
  2098. X
  2099. X
  2100. X**************************************************************************
  2101. XBelow this are the 10 default test files (tail above has number).
  2102. X**************************************************************************
  2103. X
  2104. X/alex/edu/cmu/cs/sp/alex/src/README
  2105. X/alex/edu/cmu/cs/sp/alex/src/alex.tar.Z           
  2106. X/alex/edu/cmu/cs/nectar/furmint/chimphuman.mail/34           
  2107. X/alex/edu/cmu/cs/nectar/furmint/space-companies 
  2108. X/alex/gov/nasa/gsfc/nsinic/images/gif/nasa/best1.gif
  2109. X/alex/edu/cmu/cs/nectar/furmint/space-investors.mail/88
  2110. X/alex/edu/ucar/unidata/pub/gopherd/gopher-data/Images/sample.sat/eir.gif
  2111. X/alex/edu/duke/cs/dist/papers/NUMAtic/CS-1990-10.ps.Z
  2112. X/alex/edu/ucla/cs/delphi/pub/ficus/usenix_summer_90.ps.gz
  2113. X/alex/edu/ohio-state/cis/archive/pub/tech-report/1993/TR07.ps.gz
  2114. X/alex/net/concert/ncnoc/rfc/rfc-index.txt
  2115. END_OF_FILE
  2116.   if test 3874 -ne `wc -c <'alexsrvr/src/scripts/regression.test'`; then
  2117.     echo shar: \"'alexsrvr/src/scripts/regression.test'\" unpacked with wrong size!
  2118.   fi
  2119.   chmod +x 'alexsrvr/src/scripts/regression.test'
  2120.   # end of 'alexsrvr/src/scripts/regression.test'
  2121. fi
  2122. if test -f 'alexsrvr/src/scripts/restart.alex' -a "${1}" != "-c" ; then 
  2123.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/restart.alex'\"
  2124. else
  2125.   echo shar: Extracting \"'alexsrvr/src/scripts/restart.alex'\" \(129 characters\)
  2126.   sed "s/^X//" >'alexsrvr/src/scripts/restart.alex' <<'END_OF_FILE'
  2127. X#!/bin/csh -f
  2128. X
  2129. Xecho $0
  2130. Xdate
  2131. X
  2132. Xsetenv HOME `BINDIR/defs home`
  2133. Xsetenv USER `BINDIR/defs alexsrvr`
  2134. X
  2135. Xcd $HOME
  2136. X
  2137. Xexec BINDIR/alexd -p 
  2138. X
  2139. END_OF_FILE
  2140.   if test 129 -ne `wc -c <'alexsrvr/src/scripts/restart.alex'`; then
  2141.     echo shar: \"'alexsrvr/src/scripts/restart.alex'\" unpacked with wrong size!
  2142.   fi
  2143.   chmod +x 'alexsrvr/src/scripts/restart.alex'
  2144.   # end of 'alexsrvr/src/scripts/restart.alex'
  2145. fi
  2146. if test -f 'alexsrvr/src/scripts/runalexfsck' -a "${1}" != "-c" ; then 
  2147.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/runalexfsck'\"
  2148. else
  2149.   echo shar: Extracting \"'alexsrvr/src/scripts/runalexfsck'\" \(1318 characters\)
  2150.   sed "s/^X//" >'alexsrvr/src/scripts/runalexfsck' <<'END_OF_FILE'
  2151. X#!/bin/csh -f
  2152. X#
  2153. X# It is not clear this script is ready for general consumption.
  2154. X# Removing everything under CACHDIR is a fine option if this 
  2155. X# does not work - remember that it is only a cache.
  2156. X#
  2157. X# Flags:
  2158. X#     r  -  print out readmes
  2159. X#     q  -  quick - do not check consistency (currently does not work with r)
  2160. X#     h  -  print histograms
  2161. X#
  2162. X
  2163. Xunlimit datasize
  2164. Xunlimit stacksize
  2165. X
  2166. Xset DEFS = BINDIR/defs
  2167. Xset CACHEDIR=`$DEFS cachedir`
  2168. Xecho "The cache directory is $CACHEDIR"
  2169. X
  2170. X# /usr/bin/sort only takes up to 21 chars in path so this could be too long
  2171. X# depending on what all is in CACHEDIR
  2172. Xset   T = `$DEFS tmpdir`
  2173. X
  2174. Xif (! -e $T) then
  2175. X    echo "Making tmp directory"
  2176. X    mkdir $T
  2177. Xendif
  2178. X
  2179. Xecho "The tmpdir is $T"
  2180. Xcd $T
  2181. X
  2182. Xdate
  2183. Xfind $CACHEDIR -name .alex.info -print  | sed s-/.alex.info-- | sort -T $T > alex.info.dirs
  2184. Xdate
  2185. X
  2186. Xcat alex.info.dirs | BINDIR/alexfsck $1 >& results.fsck
  2187. Xdate
  2188. X
  2189. X
  2190. Xgrep "was new in" results.fsck | awk '{print $7}' >  no.dot
  2191. Xgrep "did not point" results.fsck | awk '{print $11}' | sed s-/.alex.info-- > no.dotdot
  2192. X
  2193. X
  2194. Xcat no.dot no.dotdot | sed s.$CACHEDIR./alex. | sort -u > need.update
  2195. X
  2196. Xwc need.update
  2197. X
  2198. Xmkdir .split
  2199. X/bin/rm .split/*
  2200. X
  2201. Xsplit -100 need.update .split/
  2202. Xforeach SET ( `ls .split` )
  2203. X   date
  2204. X    foreach PATH (`cat .split/$SET`)
  2205. X        echo $PATH
  2206. X        cat $PATH/.alex.update
  2207. X    end
  2208. Xend
  2209. X
  2210. END_OF_FILE
  2211.   if test 1318 -ne `wc -c <'alexsrvr/src/scripts/runalexfsck'`; then
  2212.     echo shar: \"'alexsrvr/src/scripts/runalexfsck'\" unpacked with wrong size!
  2213.   fi
  2214.   chmod +x 'alexsrvr/src/scripts/runalexfsck'
  2215.   # end of 'alexsrvr/src/scripts/runalexfsck'
  2216. fi
  2217. if test -f 'alexsrvr/src/scripts/stop.alex' -a "${1}" != "-c" ; then 
  2218.   echo shar: Will not clobber existing file \"'alexsrvr/src/scripts/stop.alex'\"
  2219. else
  2220.   echo shar: Extracting \"'alexsrvr/src/scripts/stop.alex'\" \(390 characters\)
  2221.   sed "s/^X//" >'alexsrvr/src/scripts/stop.alex' <<'END_OF_FILE'
  2222. X#!/bin/csh -f 
  2223. X
  2224. X
  2225. Xecho "Trying to unmount /alex"
  2226. XBINDIR/mountalex -u &
  2227. Xsleep 30
  2228. X
  2229. Xalias gk  BINDIR/grepnkill
  2230. Xalias gk9 BINDIR/grepnkill9
  2231. X
  2232. X
  2233. Xecho "Killing nannys"
  2234. Xgk9 alex.nanny
  2235. Xgk9 evictor.nanny
  2236. X
  2237. Xsleep 5
  2238. Xecho "Killing evictor"
  2239. Xgk9 evictor
  2240. Xgk9 cacheinfo.Z
  2241. X
  2242. Xecho "Terminating alexd and alexmountd"
  2243. Xgk alexd
  2244. Xgk9 alexmountd
  2245. X
  2246. X
  2247. Xecho "Waiting for alexd to shut down"
  2248. Xsleep 120
  2249. X
  2250. Xgk9 alexd
  2251. X
  2252. Xsleep 10
  2253. X
  2254. X
  2255. END_OF_FILE
  2256.   if test 390 -ne `wc -c <'alexsrvr/src/scripts/stop.alex'`; then
  2257.     echo shar: \"'alexsrvr/src/scripts/stop.alex'\" unpacked with wrong size!
  2258.   fi
  2259.   chmod +x 'alexsrvr/src/scripts/stop.alex'
  2260.   # end of 'alexsrvr/src/scripts/stop.alex'
  2261. fi
  2262. if test -f 'alexsrvr/src/todo.c' -a "${1}" != "-c" ; then 
  2263.   echo shar: Will not clobber existing file \"'alexsrvr/src/todo.c'\"
  2264. else
  2265.   echo shar: Extracting \"'alexsrvr/src/todo.c'\" \(981 characters\)
  2266.   sed "s/^X//" >'alexsrvr/src/todo.c' <<'END_OF_FILE'
  2267. X
  2268. X/*
  2269. X This is a wish list for Alex changes.  If someone wants to
  2270. Xhack on Alex, these are things I think would really help.
  2271. X
  2272. X
  2273. X 1)  Make RemTimeZone() be off in a child process (as FTPs are).
  2274. X     The parent can just return AWORKING if the child does not
  2275. X     have the answer right then.  This way the main process would
  2276. X     not block.
  2277. X
  2278. X 2)  OutputHostsBefore() in dirtoinfo.c does a linear scan of 
  2279. X     the list of known hosts (order 6,000) doing a strcmp() for
  2280. X     each, on every update of a directory.  This takes some time.
  2281. X     A tree datastructure that mirrors the hierarchy of the hostnames
  2282. X     with entries pointing to the current list would not be too hard.
  2283. X     This would let OutputHostsBefore() just walk down the node for
  2284. X     the current directory.  This would be far faster.
  2285. X
  2286. X 3)  I would love to see the output of a profile program run on Alex.
  2287. X     I could not get the profilers here to work.  Something like 
  2288. X     pixie woudl be wonderful.
  2289. X
  2290. X
  2291. X   -- Vince
  2292. X
  2293. X
  2294. X*/
  2295. X
  2296. END_OF_FILE
  2297.   if test 981 -ne `wc -c <'alexsrvr/src/todo.c'`; then
  2298.     echo shar: \"'alexsrvr/src/todo.c'\" unpacked with wrong size!
  2299.   fi
  2300.   # end of 'alexsrvr/src/todo.c'
  2301. fi
  2302. if test -f 'alexsrvr/src/unfsd.h' -a "${1}" != "-c" ; then 
  2303.   echo shar: Will not clobber existing file \"'alexsrvr/src/unfsd.h'\"
  2304. else
  2305.   echo shar: Extracting \"'alexsrvr/src/unfsd.h'\" \(998 characters\)
  2306.   sed "s/^X//" >'alexsrvr/src/unfsd.h' <<'END_OF_FILE'
  2307. X/* UNFSD - copyright Mark A Shand, May 1988.
  2308. X * This software maybe be used for any purpose provided
  2309. X * the above copyright notice is retained.  It is supplied
  2310. X * as is, with no warranty expressed or implied.
  2311. X */
  2312. X
  2313. X
  2314. X#include "nfs_prot.h"
  2315. X
  2316. X
  2317. X
  2318. Xtypedef struct options
  2319. X{
  2320. X    /* uid/gid mapping functions */
  2321. X    enum {map_daemon, identity}    uidmap;
  2322. X    int    root_squash;
  2323. X    /* client options */
  2324. X    int    secure_port;
  2325. X    int    read_only;
  2326. X    int    link_relative;
  2327. X}
  2328. X    options;
  2329. X
  2330. Xtypedef struct clnt_param
  2331. X{
  2332. X    struct clnt_param    *next;
  2333. X
  2334. X    struct in_addr    clnt_addr;
  2335. X    char    *clnt_name;
  2336. X    char    *mount_point;
  2337. X    options    o;
  2338. X}
  2339. X    clnt_param;
  2340. X
  2341. Xextern ftype ft_map[16];
  2342. Xextern int svc_euid;
  2343. Xextern int svc_egid;
  2344. Xextern int cur_gid;
  2345. Xextern int svc_ngids;
  2346. Xextern int svc_gids[NGROUPS+2];
  2347. X
  2348. X#define ft_extr(x)    ((x & S_IFMT) >> 12)
  2349. X#define in_gid_set(gid)    ((gid) == cur_gid || _in_gid_set(gid))
  2350. X
  2351. Xextern int _in_gid_set();
  2352. Xextern clnt_param *knownclient();
  2353. X
  2354. X#define LogUnfsd(n, a, r)  LogUnfsdReal(10, n, a, r)
  2355. Xextern LogUnfsdReal();
  2356. X
  2357. Xextern int AlexInit();
  2358. X
  2359. END_OF_FILE
  2360.   if test 998 -ne `wc -c <'alexsrvr/src/unfsd.h'`; then
  2361.     echo shar: \"'alexsrvr/src/unfsd.h'\" unpacked with wrong size!
  2362.   fi
  2363.   # end of 'alexsrvr/src/unfsd.h'
  2364. fi
  2365. if test -f 'alexsrvr/tmp/readme' -a "${1}" != "-c" ; then 
  2366.   echo shar: Will not clobber existing file \"'alexsrvr/tmp/readme'\"
  2367. else
  2368.   echo shar: Extracting \"'alexsrvr/tmp/readme'\" \(149 characters\)
  2369.   sed "s/^X//" >'alexsrvr/tmp/readme' <<'END_OF_FILE'
  2370. X
  2371. XThis is where temprorary files go.
  2372. XThe more interesting alexd log files are in /usr/alexsrvr/log.
  2373. X
  2374. XThis file is partly here to make tar work right.
  2375. END_OF_FILE
  2376.   if test 149 -ne `wc -c <'alexsrvr/tmp/readme'`; then
  2377.     echo shar: \"'alexsrvr/tmp/readme'\" unpacked with wrong size!
  2378.   fi
  2379.   # end of 'alexsrvr/tmp/readme'
  2380. fi
  2381. echo shar: End of archive 13 \(of 13\).
  2382. cp /dev/null ark13isdone
  2383. MISSING=""
  2384. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  2385.     if test ! -f ark${I}isdone ; then
  2386.     MISSING="${MISSING} ${I}"
  2387.     fi
  2388. done
  2389. if test "${MISSING}" = "" ; then
  2390.     echo You have unpacked all 13 archives.
  2391.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2392. else
  2393.     echo You still must unpack the following archives:
  2394.     echo "        " ${MISSING}
  2395. fi
  2396. exit 0
  2397. exit 0 # Just in case...
  2398.