home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / ispin / part14 < prev    next >
Encoding:
Text File  |  1992-02-01  |  56.3 KB  |  1,278 lines

  1. Newsgroups: comp.sources.unix
  2. From: sir-alan!ispin!lbartz@iuvax.cs.indiana.edu (Larry Bartz)
  3. Subject: v25i125: Indianapolis Standard Printer Interface for Networked printers, Part14/15
  4. Sender: sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: sir-alan!ispin!lbartz@iuvax.cs.indiana.edu (Larry Bartz)
  8. Posting-Number: Volume 25, Issue 125
  9. Archive-Name: ispin/part14
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 14 (of 15)."
  18. # Contents:  ISPIN/doc/OLD-DOCS/README.rel_2.0
  19. #   ISPIN/doc/OLD-DOCS/rel_2.0.fixes ISPIN/misc/ISPIT.dr/ISPIT.mail
  20. #   ISPIN/misc/ISPIT.dr/IMPLEMENT ISPIN/misc/SUID.dr/mail.msg
  21. #   ISPIN/misc/wrdprfct.doc
  22. # Wrapped by socrates@indy6 on Tue Jan 28 15:27:18 1992
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'ISPIN/doc/OLD-DOCS/README.rel_2.0' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'ISPIN/doc/OLD-DOCS/README.rel_2.0'\"
  26. else
  27. echo shar: Extracting \"'ISPIN/doc/OLD-DOCS/README.rel_2.0'\" \(7661 characters\)
  28. sed "s/^X//" >'ISPIN/doc/OLD-DOCS/README.rel_2.0' <<'END_OF_FILE'
  29. X
  30. X
  31. X
  32. X        date   :  August 9, 1990
  33. X
  34. X        to     :       
  35. X
  36. X        from   :  Systems Administrator, Information Systems Division
  37. X                  Indianapolis District Office
  38. X
  39. X        subject:  Indianapolis Standard Printer Interface (for Network printers)
  40. X                  ISPIN
  41. X                  production release 2.0
  42. X
  43. X
  44. X
  45. X        *** *** *** *** *** *** INTRODUCTION *** *** *** *** *** *** *** ***
  46. X
  47. X        This is the current version of the production release of ISPIN.
  48. X        The following instructions should be followed by those sites which
  49. X        have not previously installed ISPIN. If you already have ISPIN
  50. X        release 1.1 or 1.2 installed on your system, you should follow the 
  51. X        instructions in the file "UPDATEto2.0".
  52. X
  53. X        Several files in the ISPIN/doc directory document the design, devel-
  54. X        opment, testing, and implementation history of ISPIN.
  55. X
  56. X        ISPIN has been successfully installed and tested on:
  57. X
  58. X                                     AT&T  3B1
  59. X                                     AT&T  3B2600G
  60. X                                     CCI 6/32 MP   (CCI SysV)
  61. X                                     Compaq with Intel 80286 CPU
  62. X                                             (running XENIX)
  63. X                                     IBM PC/AT with Intel 80386 CPU
  64. X                                             (running XENIX)
  65. X                                     Prime EXL 50
  66. X                                     Pyramid 90x
  67. X                                     Pyramid 9810
  68. X                                     Pyramid MIS-4
  69. X                                     Sequent Balance B8 (DYNIX)
  70. X                                     Sequent Symmetry (DYNIX)
  71. X                                     Zilog Model 31
  72. X                                     Zilog Model 32
  73. X                                     Zilog Model 130 (Rev J OS)
  74. X
  75. X                                     CDN (IRS X.25 network with async interface)
  76. X                                     Teltone/Tellabs Switch
  77. X                                     Gandolph Switch
  78. X                                     David Switch
  79. X                                     Mitron Switch
  80. X                                     Equinox Switch
  81. X                                     Neac Switch
  82. X
  83. X
  84. X        Except for conditional compile statements required to resolve the
  85. X        differences between Zeus 3.21's nq/dqueuer and System V's lp and
  86. X        between System V UNIX and DYNIX, the source code is the same for
  87. X        all target environments.
  88. X
  89. X        *** *** *** *** *** *** THIS TRANSMITTAL *** *** *** *** *** *** ***
  90. X
  91. X        The tape upon which we have transmitted the application was created
  92. X        in cpio format. cd to a directory in which you want this release to
  93. X        be written, then execute the command:
  94. X                        cpio -iudmvc < your_tape_drive
  95. X
  96. X        The result of this cpio will be the creation of a directory named
  97. X        ISPIN.rel_2.0. ISPIN.rel_2.0 will contain two subdirectories, namely
  98. X        ISPI and ISPIN.
  99. X
  100. X
  101. X
  102. X        *** *** *** *** *** *** ISPI subdirectory *** *** *** *** *** *** ***
  103. X
  104. X        The ISPI directory contains the freshest version of our ISPI
  105. X        application. ISPI is an application which serves as a FRONTEND
  106. X        for the two queuer/spoolers. The ISPI application is fully self-
  107. X        contained, with its own source code, documentation, etc. We sent
  108. X        ISPI along because we have found it to be an extremely useful tool
  109. X        to support the native queuer/spoolers. If you have any version of
  110. X        ISPI previous to this one, please use this one as a replacement. The
  111. X        ISPI included with this transmittal supersedes the ISPI which
  112. X        accompanied the ISPIN.rel_1.2 release.
  113. X
  114. X        ISPIN and ISPI are TWO SEPARATE AND DISTINCT APPLICATIONS.
  115. X
  116. X        Neither depends upon the other for functionality. You may use ISPIN
  117. X        without ISPI. You may use ISPI without ISPIN.
  118. X
  119. X
  120. X
  121. X        *** *** *** *** *** *** ISPIN subdirectory *** *** *** *** *** *** ***
  122. X
  123. X        ISPIN contains the source code, install documents, and install scripts 
  124. X        for the ISPIN application. The ISPIN application serves as a BACKEND 
  125. X        for either of two native queuer/spoolers, lp or dqueuer. We have 
  126. X        organized the directory ISPIN and its contents into subdirectories
  127. X        using standard names "doc" (for documentation files), "h" (for header
  128. X        files), "install" (where install scripts exist, and from which they
  129. X        must be executed), "obj" (where the executables will be placed as
  130. X        they are compiled), and "src" (where the source code resides).
  131. X
  132. X
  133. X
  134. X        *** *** *** *** *** *** ISPIN documentation *** *** *** *** *** ***
  135. X
  136. X        The documentation for this application is informal in style, and the
  137. X        code is overflowing with comments. If you don't have time and inclin-
  138. X        ation to read everything in the ISPIN.rel_2.0/ISPIN/doc directory,
  139. X        AT LEAST READ: LPinstall.doc, NQinstall.doc, README.beta.3, design,
  140. X        rel_2.0.fixes, and rtab.
  141. X
  142. X
  143. X
  144. X
  145. X        *** *** *** *** *** *** ISPIN installation *** *** *** *** *** *** ***
  146. X
  147. X        If you are installing this application under ZEUS 3.21 and its
  148. X        nq/xq/dqueuer queuer family, install per NQinstall.doc.
  149. X
  150. X        If you are installing this application under System V UNIX and
  151. X        the lp spooler, install per LPinstall.doc.
  152. X
  153. X
  154. X
  155. X        *** *** *** *** *** *** FEEDBACK, please *** *** *** *** *** *** ***
  156. X
  157. X        We are maintaining a list of sites to which we have sent ISPI/ISPIN
  158. X        and of contact persons at those sites. Unless you tell us, however,
  159. X        we will have no idea whether or not you actually use these applications
  160. X        in production. Our expectation is that you will, but we will not 
  161. X        presume it. Please confirm installation and usage of ISPI/ISPIN. We
  162. X        prefer confirmation via mmdf mail sent to "ispin@indy6", but written 
  163. X        confirmation or a phone call will do. Confirmed users of ISPI/ISPIN 
  164. X        will receive all subsequent update and informational distributions.
  165. X        We will notify users of updates via a mmdf electronic mail group, 
  166. X        "ispinusr@indy6".  If possible, we would like your site to have an 
  167. X        user included in this mmdf group. An administrative mmdf address which
  168. X        is aliased to an actual user at your end is preferred (i.e.
  169. X        "sysadm@det1" instead of "jdoe@det1"). Please notify us of the mmdf
  170. X        address at which you would like to receive ISPIN information.
  171. X
  172. X        There is no bug-free software. Although the alpha site and beta site
  173. X        testing has been extensive, we recognize the possibility of bugs which
  174. X        have not yet been exposed. Please report them to us by telephone or by
  175. X        sending mmdf mail to "ispin@indy6". We are committed to supporting this
  176. X        application.
  177. X
  178. X        If you install and use ISPI/ISPIN on hardware/software platforms which
  179. X        are not listed in this memo, please let us know. This software is 
  180. X        intended to be portable, especially among machines which support a 
  181. X        System V UNIX environment. 
  182. X
  183. X        If you develop "rtab" entries which you feel others may find useful,
  184. X        contact us. We'd like to be the clearinghouse for such information.
  185. X        We have plans to implement a software distribution facility for 
  186. X        users of Indianapolis applications.  The establishment of the mmdf 
  187. X        group "ispinusr@indy6" is the first step in the implementation of 
  188. X        this distribution facility. If you have any questions, please
  189. X        feel free to contact us.
  190. X        
  191. X
  192. X
  193. X
  194. X                               Larry Bartz
  195. X
  196. X
  197. END_OF_FILE
  198. if test 7661 -ne `wc -c <'ISPIN/doc/OLD-DOCS/README.rel_2.0'`; then
  199.     echo shar: \"'ISPIN/doc/OLD-DOCS/README.rel_2.0'\" unpacked with wrong size!
  200. fi
  201. # end of 'ISPIN/doc/OLD-DOCS/README.rel_2.0'
  202. fi
  203. if test -f 'ISPIN/doc/OLD-DOCS/rel_2.0.fixes' -a "${1}" != "-c" ; then 
  204.   echo shar: Will not clobber existing file \"'ISPIN/doc/OLD-DOCS/rel_2.0.fixes'\"
  205. else
  206. echo shar: Extracting \"'ISPIN/doc/OLD-DOCS/rel_2.0.fixes'\" \(8356 characters\)
  207. sed "s/^X//" >'ISPIN/doc/OLD-DOCS/rel_2.0.fixes' <<'END_OF_FILE'
  208. X
  209. X
  210. X                         ISPIN RELEASE 2.0 CHANGES
  211. X
  212. XHere, in no particular order of importance, is a listing of the differences
  213. Xin ISPIN.rel_2.0
  214. X
  215. X
  216. XLOCK FILES  -  Take a look at the file ISPIN/doc/design. What I said there
  217. X               about lock files still holds true. Lock files are a relatively
  218. X               arcane and inefficient way for an application to control
  219. X               access to resources. That's why previous releases of ISPIN
  220. X               didn't employ lock files for its own purposes. Neither does
  221. X               this release. The IQUEUER daemon still maintains its own
  222. X               internal control of tty access among competing ISPIN processes.
  223. X
  224. X               This release, however, implements lock files on top of, or
  225. X               in addition to, IQUEUER's control. The purpose of these lock
  226. X               files is to allow ISPIN to share tty resources with applications
  227. X               such as cu(1), uucp(1), uugetty(M, on some machines), mmdf's
  228. X               deliver, and others. Many of our customers' machines didn't
  229. X               have enough tty ports to permit dedicating some to ISPIN and
  230. X               other tty ports to other datacomm purposes. Hey, the customer
  231. X               is king! You asked for it, you got it. You can get anything
  232. X               you want at Alice's Restaurant (excepting Alice). Blah, blah,
  233. X               blah, etc. (Really, this was a good idea all along. It just
  234. X               took a few of you a while to beat it into my thick head.)
  235. X
  236. X               ISPIN honors all "foreign" lock files, so if cu(1) or uucp(1)
  237. X               is using the tty, ISPIN won't interfere. If more than one tty
  238. X               is defined for ISPIN's use, ISPIN will move on to the next.
  239. X               If the competitor has tied up the only tty which ISPIN knows,
  240. X               we'll try again the next time the IQUEUER daemon loops around.
  241. X
  242. X               The lock files ISPIN creates are intended to be unassailable
  243. X               by competing "foreigners". Analysis and development of this
  244. X               feature included a study of the lock file implementation on
  245. X               five different UNIX hardware/software platforms. Guess what.
  246. X               I saw five different lock file strategies. So much for any
  247. X               attempt at compliance with the native schemes. We could have
  248. X               complied with all five via liberal use of conditionally 
  249. X               compiled code, but what if a customer wants to run ISPIN on
  250. X               a hardware/software combo which implements a sixth different
  251. X               scheme? Can you say bye-bye to portability? I couldn't.
  252. X
  253. X               ISPIN's lock files are implemented as directory files with
  254. X               no contents and "zero" permissions all around. Alpha and
  255. X               beta site testing has proven that this approach is universally
  256. X               compatible with competing processes. This method is an
  257. X               inelegant "brute force" technique, but it works. When we
  258. X               all have POSIX-compliant boxes which implement a truly
  259. X               universal lock file scheme, I'll do it the POSIX way. Until
  260. X               then, we'll use the big hammer.
  261. X
  262. X
  263. XLP's "-m"  -   Here's the scenario: a user requests several files to be
  264. X               printed via one lp(1) command, like so:
  265. X
  266. X                         lp -ddest -m file1 file2 file3 dir1/dir2/file4 file5
  267. X
  268. X               Now suppose that dir2's permissions were such that the user
  269. X               "lp" could not get in there to read file4. If the user "lp" 
  270. X               can't read it, lp(1) can't print it. Since the user specified
  271. X               the "-m" flag, he should receive mail from lp, reporting
  272. X               that the print request failed.
  273. X
  274. X               Under previous releases of ISPIN, user never got the message.
  275. X               Now he will.
  276. X
  277. X
  278. XISPIN's log - All of ISPIN's log messages now show which tty was in use at
  279. X              the time the log message was written. There are some phases in
  280. X              the life of an ISPIN process in which the tty is undefined. If
  281. X              the log message is written at such a point, there will be no
  282. X              entry for "DEVICE".
  283. X
  284. X
  285. XRTAB flags - Two new flags for your rtab entries to further control the 
  286. X             behavior of the ISPIN process:
  287. X  -R
  288. X  This flag takes no argument. If the -R flag is present, the tty through
  289. X  which ISPIN communicates will be set so that it DOES NOT transmit the
  290. X  "newline" (ascii "LF", or octal \012) as the newline/carriage return pair.
  291. X  Note that the LF/LF-CR conversion is the default condition if -R is not
  292. X  present. For most printers, DO NOT USE THIS FLAG. This flag is included
  293. X  specifically for supporting the transmission of binary information (such
  294. X  as would be the case with raster graphics).
  295. X  -T
  296. X  This flag takes no argument. If the -T flag is present, tabs will be
  297. X  expanded to spaces on output. If -R flag is present, -T has no effect.
  298. X
  299. XIQ output  -  The utility iq (iqueuer status enquirer) is modified in some
  300. X              subtle ways:
  301. X
  302. X              TIME-IN - This column reflects the time the native spooler/
  303. X                        queuer first invoked the ISPIN process.
  304. X
  305. X              STATE-TIME - This column relects the time the ISPIN process
  306. X                        entered its current "STATE", or phase of execution.
  307. X
  308. X              STATE   - As before, this column shows the current phase of
  309. X                        the ISPIN process. A new state has been defined
  310. X                        and will be displayed when appropriate.
  311. X                        The state "QUITTING" will be displayed whenever
  312. X                        the ispin is in the process of an abnormal
  313. X                        termination. The state "DISCONNECTING" will be
  314. X                        displayed during normal termination and loop cycles.
  315. X
  316. X
  317. XISPI mods  -  As we've said many times before, ISPI is a companion application
  318. X              to ISPIN. ISPI serves as a front-end menu for the native system's
  319. X              spooler/queuer. ISPIN will work without ISPI, and vice versa.
  320. X              Each, however, complements the native spooler/queuer, and the
  321. X              trio (ISPI, native spooler/queuer, ISPIN) makes for a very 
  322. X              efficient and effective package.
  323. X
  324. X              This latest release of ISPI incorporates yet another customer-
  325. X              driven feature. Here is an excerpt form the latest ISPI.DOC:
  326. X
  327. X
  328. X       As of 08/07/90 revision and later, the user may also set an environ-
  329. X   mental variable, CONFIGDIR. The value of this variable will override the
  330. X   compile-time-defined CONFIG_PATH. The purpose of CONFIGDIR is to allow
  331. X   the Systems Administrator to set up various printer selection menus for
  332. X   various groups of users. This may be necessary for reasons of: security (so
  333. X   users of sensitive data may not inadvertently send jobs to insecure
  334. X   printers [aren't they all?]); convenience (so users don't have to wade
  335. X   through a menu filled with printers they never use); and practicality (only
  336. X   so many printers will fit on one screen display page).
  337. X
  338. X              Like so:
  339. X                       in C-shell:
  340. X                                   set configdir=/z/bin/config/ex_configdir
  341. X                                   setenv CONFIGDIR /z/bin/config/ex_configdir
  342. X
  343. X                       in Bourne shell:
  344. X                                   CONFIGDIR=/z/bin/config/ex_configdir
  345. X                                   EXPORT CONFIGDIR
  346. X
  347. X
  348. X
  349. X
  350. X
  351. X
  352. X/******************************************************************************/
  353. XWell, that's the story on ISPIN.rel_2.0. I think the above-listed enhancements
  354. Xand fixes are sufficiently significant to warrant the minimal time you will
  355. Xspend upgrading from previous releases. If you haven't yet implemented ISPIN,
  356. Xthis release is what you've been waiting for.
  357. X
  358. XWith a lot of good customer involvement and a few extra keystrokes, we've made
  359. Xa good application even better.
  360. X
  361. X08/08/90
  362. X
  363. X                                                    Internal Revenue Service
  364. X                                                    Indianapolis District Office
  365. X                                                    Information Systems Division
  366. X                                                    Operations Branch
  367. X
  368. X                                                    Larry Bartz
  369. END_OF_FILE
  370. if test 8356 -ne `wc -c <'ISPIN/doc/OLD-DOCS/rel_2.0.fixes'`; then
  371.     echo shar: \"'ISPIN/doc/OLD-DOCS/rel_2.0.fixes'\" unpacked with wrong size!
  372. fi
  373. # end of 'ISPIN/doc/OLD-DOCS/rel_2.0.fixes'
  374. fi
  375. if test -f 'ISPIN/misc/ISPIT.dr/ISPIT.mail' -a "${1}" != "-c" ; then 
  376.   echo shar: Will not clobber existing file \"'ISPIN/misc/ISPIT.dr/ISPIT.mail'\"
  377. else
  378. echo shar: Extracting \"'ISPIN/misc/ISPIT.dr/ISPIT.mail'\" \(19020 characters\)
  379. sed "s/^X//" >'ISPIN/misc/ISPIT.dr/ISPIT.mail' <<'END_OF_FILE'
  380. X
  381. XHave you seen the television commercial which says "Orange juice: It's not 
  382. Xjust for breakfast anymore." ?
  383. X
  384. XTry this one. "ISPIN: It's not just for printing anymore."
  385. X
  386. XReally. Just as lp/lpsched is effectively a general purpose FIFO job scheduler,
  387. Xwhen you get right down to it, ISPIN is really a general purpose data transfer
  388. Xmechanism. It's just that up to now, we've only used it to transfer data to
  389. Xprinters.
  390. X
  391. XWhy couldn't we use ISPIN to transfer data to other systems or other media?
  392. X
  393. XWell, we can. I have. You can, too. Whether you want to (or not) is up
  394. Xto you. I'm not pushing this as any kind of world beater.
  395. X
  396. XThis message contains documentation, scripts, and programs to implement
  397. XIndianapolis Simple Protocol for Inter-system Transfers (ISPIT). ISPIT is
  398. Xa means of transferring data via the lp/ISPIN mechanism. ISPIT does not
  399. Xrequire modification to existing ISPIN code.
  400. X
  401. XI developed ISPIT for a particular purpose. The AT&T 3B1 which sits on my
  402. Xdesk has a 68MB hard disk but no decent magnetic media for backups. The
  403. Xcatridge tape drive is no longer in production, and putting that much data
  404. Xon floppies is beyond the scope of my patience. I wanted an automated full
  405. Xsystem backup, but I had no local hardware to do it.
  406. X
  407. XI tried several approaches via uucp but got no satisfactory result. Two
  408. Ximmutable factors of uucp data transfer got in my way.
  409. X
  410. XFirst is spooling. The uucico process on the receiving machine builds the
  411. Xincoming data in a temporary file in the spooling directory of your choice,
  412. Xthen copies that temporary file to the destination file you specify. The
  413. Xreceiving box must have ample disk capacity. Even if I specified the nine
  414. Xtrack drive on the receiving machine as the destination file (it works, by
  415. Xthe way), 35-40MB of free disk is pretty hard to come by on one of our
  416. Xproduction machines. (I'm sending my entire system as one cpio archive file
  417. Xwhich is compressed, then piped through a FIFO. I tried queueing up each
  418. Xseparate file, resulting in a mess of epic proportions). 
  419. X
  420. XThe second limiting factor of uucp was the speed (lack thereof) of the 
  421. Xuucp "G" protocol. My testing has shown that, in terms of raw throughput,
  422. XISPIT transfers data from system to system at twice the rate of uucp "G",
  423. X100% faster. 
  424. X
  425. XI'll also cite a figure I'll call "virtual throughput", or apparent
  426. Xthroughput. If you compress a file, uucp it to another system, then
  427. Xuncompress it on receipt, you've attained a faster file transfer. The com-
  428. Xpressed data is "data", so must travel through media (CDN, Tellabs, etc)
  429. Xwhich does not interpret software flow control. Fine for uucp.
  430. X
  431. XISPIN/ISPIT depends upon accurate software flow control, so compressed 
  432. Xdata must be converted to printable ascii before transmission. See the
  433. Xdo_ispit.sh script, below. The btoa (binary to ascii) process expands input
  434. Xdata by roughly 30% on output. 
  435. X
  436. XEven with this "handicap", ISPIT's virtual throughput is 70% faster than
  437. Xuucp "G".
  438. X
  439. XWhat of error checking, you say? Uucp "G" protocol may be slow, but at least
  440. Xit checks to make sure the data gets from end to end in one piece. 
  441. X
  442. XI haven't noticed ISPIN dropping a lot of characters, even on big print jobs.
  443. XThere certainly isn't any error checking going on there. ISPIT's success
  444. X(if it has any) is heavily dependent on fast, modern I/O subsystems at
  445. Xboth ends (no Model 31 Zilogs, please), and a clean transport media which
  446. Xsupports a reliable cascading buffered software flow control (CDN, Tellabs,
  447. Xmaybe others).
  448. X
  449. X
  450. X(DISCLAIMER)
  451. XPlease don't get me wrong. I'm not proposing that we use this method as a 
  452. Xreplacement for other valid data transfer mechanisms such as uucp, kermit,
  453. Xand others. But sometimes those others can't do what we need to do. Maybe
  454. Xthere are a few niches where ISPIT might fit.
  455. X
  456. XBelow is the output from "more * > ISPIT.doc" from within a directory which
  457. Xcontains all files necessary to implement ISPIT.
  458. X
  459. X::::::::::::::
  460. XIMPLEMENT
  461. X::::::::::::::
  462. XISPIT (Indianapolis Simple Protocol for Inter-system Transfers)
  463. X
  464. XIMPLEMENTATION NOTES
  465. X
  466. X
  467. XDON'T BOTHER IMPLEMENTING THIS ON 16-BIT MACHINES SUCH AS ZILOG MODEL 31 (or
  468. Xeven the so-called "32-bit Upgrade"). Their I/O systems are not adequate for
  469. Xthe reliable data flow ISPIT requires.
  470. X
  471. XOn dual universe machines, do everything from att universe.
  472. X
  473. XAlso, if any of the machines you use in this scenario do not support the
  474. Xcompress/uncompress/btoa/atob/zcat family of executables, you'll need 'em.
  475. XThe Pyramids and Sequents have these in the ucb universe. "Pure" System V's
  476. Xlike the AT&T boxes and Zilog 130's don't. I have source code which compiles
  477. Xand executes fine on our Zilog 130 and my AT&T 3B1. If you want it, ask me.
  478. X
  479. X
  480. XSOURCE MACHINE:
  481. X
  482. X                 First, the source machine must have ISPIN.rel_2.1 or later.
  483. X
  484. X                 do_ispit.sh - check this script for correct pathnames to
  485. X                               your executables such as compress, btoa,
  486. X                               cpio, and lp. On dual universe machines, the
  487. X                               Berzerkely commands will have to be preceded
  488. X                               by "ucb".
  489. X
  490. X                             - Put a copy of this script in a directory which
  491. X                               is in your path, renaming it as "ispit", such
  492. X                               as:
  493. X                                   cp do_ispit.sh /usr/local/bin/ispit
  494. X
  495. X                                   or
  496. X
  497. X                                   cp do_ispit.sh /z/bin/ispit
  498. X
  499. X                 rtab.entry  - Edit this rtab entry to make it valid for your
  500. X                               situation. You'll have to change:
  501. X
  502. X                                 - the first field, for queue member name.
  503. X                                   I suggest the node name of the destination
  504. X                                   system.
  505. X
  506. X                                 - the second field, the device(s). Use the 
  507. X                                   same one(s) as you do for ISPIN printing.
  508. X
  509. X                                 - the connect chat fields. If you're going
  510. X                                   straight through CDN to the remote system,
  511. X                                   you'll only have to change the address.
  512. X                                   If negotiating other switches, adjust
  513. X                                   accordingly.
  514. X
  515. X                                   Unlike uucp,  ISPIT   REQUIRES   XON/XOFF 
  516. X                                   FLOW CONTROL! So make sure all the
  517. X                                   network links you go through support it.
  518. X                                   From the source machine, go out via ports
  519. X                                   you use for printing. Log into the destina-
  520. X                                   tion box through channels just like a
  521. X                                   user (person). Don't use "no flow" uucp
  522. X                                   file transfer channels.
  523. X
  524. X                                 - Notice that this rtab entry results in a 
  525. X                                   user named "ispit" logging onto the remote
  526. X                                   machine with password of "notvalid". Change
  527. X                                   these to correspond with what you set up
  528. X                                   on the destination system.
  529. X
  530. X                                 - The rest of the rtab entry, including 
  531. X                                   "FILE?", "OK", etc MUST STAY AS IS! It
  532. X                                   talks to the ispit.sh script on the dest-
  533. X                                   ination box.
  534. X
  535. X                                 - Add the rtab entry to your rtab file. 
  536. X
  537. X                 lpadmin stuff - Add a queue member whose name matches the
  538. X                                 first field of the rtab entry, using the
  539. X                                 special new ispit interface script included
  540. X                                 here. Such as:
  541. X
  542. X                                 lpshut
  543. X
  544. X                                 lpadmin -pINDY_5 -v/dev/null -iinterface
  545. X
  546. X                                 accept INDY_5
  547. X
  548. X                                 enable INDY_5
  549. X
  550. X                                 lpsched
  551. X
  552. X
  553. X
  554. XDESTINATION MACHINE:
  555. X
  556. X                 Add a user to the system. Use the passwd.entry file included
  557. X                 here as a model. This user's logname and password must match
  558. X                 corresponding fields in the rtab entry you set up on the
  559. X                 source machine.
  560. X
  561. X                 Compile the program "eot_trap" from the source I've provided.
  562. X
  563. X                         cc -o eot_trap eot_trap.c
  564. X
  565. X                 Put the executable "eot_trap" and the script "ispit.sh" in
  566. X                 the new user's home directory. Make they are executable by
  567. X                 the new user.
  568. X
  569. X                 Test this new user by logging as him (OK, Kim, as her).
  570. X                 ispit.sh will prompt you for a file name. Give a name and
  571. X                 a carriage return. Type anything you want, ending with a
  572. X                 <ctrl>d. When you log in again as yourself, the file you
  573. X                 specified should consist of all you typed.
  574. X
  575. X
  576. XUSAGE:
  577. X
  578. X                 The script do_ispit.sh contains some internal documentation
  579. X                 on its usage.
  580. X
  581. X                 If you transfer data via the do_ispit.sh (or "ispit") script,
  582. X                 the file on the destination machine will be named as you
  583. X                 specify. The file's format is as a cpio archive which is
  584. X                 compressed, then converted by btoa. To disassemble this mess
  585. X                 on the destination machine, you can:
  586. X
  587. X                        cat filename|atob|zcat|cpio -iudmcv
  588. X
  589. X                        on a dual universe box, from att universe:
  590. X                        cat filename|ucb atob|ucb zcat|cpio -iudmcv
  591. X
  592. XAPPLICATION:
  593. X
  594. X                 I've even had good luck specifying the nine track drive as
  595. X                 the destination device (Zilog 130, not Sequent B8). Here's
  596. X                 how I send the entire contents of my AT&T 3B1's 68MB hard
  597. X                 drive (approx 64% full) to a nine track tape on a Zilog
  598. X                 Model 130 named INDY_5:
  599. X
  600. X                 #!/bin/sh
  601. X                 cd /
  602. X                 /usr/local/bin/ispit . /dev/rmiop0 INDY_5
  603. X         
  604. X                 When I want to check the correctness of my backup tape,
  605. X                 I login to INDY_5, mount my tape, and:
  606. X
  607. X                        cat /dev/rmiop0|atob|zcat|cpio -itcv > tape.list
  608. X
  609. X                 You could easily modify the ispit.sh script on the destina-
  610. X                 tion machine so that eot_trap sends its output through atob,
  611. X                 and zcat, and then to the specified output file. Then you'd
  612. X                 be dealing with a simple cpio archive at the destination.
  613. X
  614. X                 Come to think of it, you could modify any of this to do
  615. X                 anything you might dream up!
  616. X::::::::::::::
  617. XREADME
  618. X::::::::::::::
  619. X
  620. Xrtab.entry     -  see do_ispit.sh. Notice that this rtab entry requires that
  621. X                  this queue member be called by an lp(1) command which
  622. X                  must include a sane value for the "-o" flag.
  623. X                  The arg to the "-o" is used by ISPIN at the point in the
  624. X                  rtab where "\U" appears.
  625. X                  Note also the use of the "-R" flag for really raw output.
  626. X
  627. Xdo_ispit.sh    -  the shell script which is executed by the source system.
  628. X
  629. X                  The lp command line contains some interesting features.
  630. X
  631. X                  The string passed as the argument to the "-o" flag is
  632. X                  actually made up of two arguments which are delimited by
  633. X                  the "@" symbol. These two arguments are processed by
  634. X                  the special interface script on the source system.
  635. X
  636. X                  The first "argument" to lp's "-o" flag is processed
  637. X                  by ispin and inserted in a "sent" network negotiation 
  638. X                  string where a "\U" appears. On the destination system,
  639. X                  ispit.sh picks this up as the name of the output file.
  640. X
  641. X                  Also notice that the second "argument" to the "-o" flag
  642. X                  is /tmp/$nowfile. This file is a named pipe, created "on
  643. X                  the fly". The lp/interface file (special for this purpose)
  644. X                  reads from the named pipe which was created and filled by
  645. X                  do_ispit.sh.
  646. X
  647. X                  The "filename" argument to the lp command is /etc/passwd.
  648. X                  This file is not actually transmitted by the ispit/ispin
  649. X                  process. We use /etc/passwd as a placeholder on the 
  650. X                  command line since lp will not queue a request without a
  651. X                  valid non-null filename.
  652. X
  653. X                  do_ispit.sh requires three arguments:
  654. X
  655. X                  - First is the name of the source file to be transferred.
  656. X                    
  657. X                  - Second is the destination file name on the destination 
  658. X                    system. This argument should be a full path name. All
  659. X                    elements of the path must exist. The destination directory
  660. X                    must be writable by the user "ispit" on the remote system.
  661. X                    If this argument is less than a fully qualified path, the
  662. X                    remote system will interpret the argument relative to
  663. X                    ispit's home directory.
  664. X
  665. X                  - Third is the (lp) queue member which will process the
  666. X                    request.
  667. X
  668. X                  On dual universe machines, the calls to "compress", "btoa",
  669. X                  "cut", and "lp" may have to be preceded by the appropriate
  670. X                  universe call. Path names to commands may also require 
  671. X                  adjustment.
  672. X
  673. Xinterface      -  This shell script is the lp interface file for ispit on
  674. X                  the source system.
  675. X
  676. Xeot_trap.c   * -  source for a filter program which watches for an ascii
  677. X                  "EOT" character. eot_trap filters the input 
  678. X                  on the receiving system. The source system's rtab entry
  679. X                  for the "ispit" queue member sends EOT as the first action
  680. X                  of the ispin quit sequence. eot_trap exits, ending the 
  681. X                  login session, so ispit exits. This dependence upon
  682. X                  EOT makes it IMPERATIVE that all output be converted by
  683. X                  btoa(1). See do_ispit.sh.
  684. X
  685. Xispit.sh     * -  see passwd.entry, below. This is the script which is invoked
  686. X                  upon login by and for the ispit user. Notice that ispit.sh
  687. X                  expects (actually requires) that a variable
  688. X                  "OF" is assigned a sane value. This value is passed at login
  689. X                  time by the user "ispit". See rtab.entry for the "\U".
  690. X
  691. X                  NOTE: ispit.sh calls the executable "eot_trap", assuming
  692. X                        that the executable is located in ispit's home
  693. X                        directory. 
  694. X
  695. Xpasswd.entry * -  this is the /etc/passwd entry for the ispit user on the 
  696. X                  destination machine. The last field of the entry is the full
  697. X                  path name of the ispit.sh script. Change the location of
  698. X                  ispit's home directory as you see fit.
  699. X
  700. X
  701. X
  702. X                  * - denotes this file, data, or program exists on the
  703. X                      destination machine. All else exists on the source
  704. X                      machine.
  705. X::::::::::::::
  706. Xdo_ispit.sh
  707. X::::::::::::::
  708. X#!/bin/sh
  709. X# do_ispit.sh         08/07/91     LSB
  710. X# When you install this in an accessible path, call it "ispit". This will
  711. X# assure compatibility with possible future executables.
  712. X# requires three args:
  713. X# $1 is file to be xferred: could be a directory, could be more than one
  714. X#                           file if all enclosed in double quote
  715. X#
  716. X# $2 is destination file name (full path on remote system, or relative to
  717. X# ispit's home directory on the remote system)
  718. X#
  719. X# $3 is the lp queue member to use (for destination system)
  720. X#
  721. X# so:
  722. X#     ispit source_file destination_file destination_system_queue_member
  723. X#
  724. X# examples:
  725. X#
  726. X# send testfile to /tmp/testfile on queue indy6:
  727. X#     ispit testfile /tmp/testfile indy6
  728. X#
  729. X# send directory UUGETTY and all contents to /tmp/UUG.cp.Z.a on queue indy6:
  730. X#     ispit UUGETTY /tmp/UUG.cp.Z.a indy6
  731. X#
  732. X# send all files whose names contain "ind" to /tmp/ind.cp.Z.a on queue indy6:
  733. X#     ispit "`ls *ind*`" /tmp/ind.cp.Z.a indy6
  734. X#
  735. X# nowfile (not an argument) is the name of the named pipe in /tmp we'll use
  736. X#
  737. X#
  738. Xnowfile=`/bin/date +%m%d%y`.`/bin/date +%H%M%S`
  739. Xecho "ISPIT REQUEST" >> /tmp/ispit.log
  740. Xdate >> /tmp/ispit.log
  741. Xecho "        user: "`id`  >> /tmp/ispit.log
  742. Xecho "      source: "$1  >> /tmp/ispit.log
  743. Xecho " destination: "$2  >> /tmp/ispit.log
  744. Xecho "       queue: "$3  >> /tmp/ispit.log
  745. Xecho "        pipe: /tmp/"$nowfile  >> /tmp/ispit.log
  746. X/bin/rm -f /tmp/$nowfile
  747. X/etc/mknod /tmp/$nowfile p
  748. X/bin/chmod 666 /tmp/$nowfile
  749. Xfind $1 ! -type p -print|/bin/cpio -oc|/usr/local/bin/compress|/usr/local/bin/btoa > /tmp/$nowfile &
  750. X/usr/bin/lp -d$3 -o$2@/tmp/$nowfile /etc/passwd
  751. X# Yes, I do mean /etc/passwd! It's here as a necessary argument to fool lp.
  752. X::::::::::::::
  753. Xeot_trap.c
  754. X::::::::::::::
  755. X#include <stdio.h>
  756. X
  757. Xmain()
  758. X{
  759. X  int c;
  760. X
  761. X  while ((c = getc(stdin)) != EOF)
  762. X  {
  763. X    if(c == 4)
  764. X    {
  765. X      exit(0);
  766. X    }
  767. X
  768. X    putc(c,stdout);
  769. X  }
  770. X}
  771. X::::::::::::::
  772. Xinterface
  773. X::::::::::::::
  774. X#!/bin/sh
  775. X# 08/07/91 LSB
  776. X# This interface script usable for ISPIT file transfer protocol
  777. Xecho "ISPIT FILE TRANSFER" >> /tmp/ispit.log
  778. Xdate >> /tmp/ispit.log
  779. Xecho "      lp job id : "$1 >> /tmp/ispit.log
  780. Xecho "requesting user : "$2 >> /tmp/ispit.log
  781. Xecho "    destination : "`echo $5|/usr/bin/cut -d@ -f1` >> /tmp/ispit.log
  782. Xecho "           pipe : "`echo $5|/usr/bin/cut -d@ -f2` >> /tmp/ispit.log
  783. Xexec /usr/spool/lp/ISPIN/ispin `/bin/basename $0|/usr/bin/tr -d "[\012*]"` $1 $2 "" 1 `echo $5|/usr/bin/cut -d@ -f1` `echo $5|/usr/bin/cut -d@ -f2`
  784. X::::::::::::::
  785. Xispit.sh
  786. X::::::::::::::
  787. X#!/bin/sh
  788. X# ispit.sh         080791    LSB
  789. X# written to run as the user ispit's default shell (last field in passwd entry)
  790. X# stty call is of "att" type, so must be run under att on dual universe boxes
  791. Xecho "OUTPUT_FILE?"
  792. Xread OF
  793. Xecho "OK"
  794. Xstty raw ixoff -echo hupcl brkint
  795. Xecho "ISPIT START" >> ispit.log
  796. Xdate >> ispit.log
  797. Xecho $OF >> ispit.log
  798. X./eot_trap > $OF
  799. Xdate >> ispit.log
  800. Xstty sane
  801. Xexit
  802. X::::::::::::::
  803. Xpasswd.entry
  804. X::::::::::::::
  805. Xispit:9CKY7K.On.kVs:437:4::/zb/ispit:/zb/ispit/ispit.sh
  806. X::::::::::::::
  807. Xrtab.entry
  808. X::::::::::::::
  809. X# This rtab entry is usable only for the ISPIT file transfer protocol.
  810. XINDY_5;/dev/tty000;19200;-L;-R;-Bcongestion;-Bremote dte;-Q\004\L\L\K\dclr\r\d;-DConnection cleared;-Dad>:;-Dogin:;ad>-\p\K\pclr\r\d\020\pclr\r\d-ad>;clr\r\r\d;ad>-\p\K\pclr\r\d\020\pclr\r\d-ad>;set recall=none\r\pset break-handling=send-break+recall\r\pset pad-flow=on\r\pset terminal-flow=on\r\p;ad>-\r\r\d-ad>;\pconnect\s00000099999999\r\d;Opened;\r\r\d;ogin:-\r\d-ogin:;ispit\r\d;assword:;notvalid\r\d\d;FILE?;\U\r\d\d;OK;\w;;;
  811. X#ispit to INDY_5
  812. X#
  813. END_OF_FILE
  814. if test 19020 -ne `wc -c <'ISPIN/misc/ISPIT.dr/ISPIT.mail'`; then
  815.     echo shar: \"'ISPIN/misc/ISPIT.dr/ISPIT.mail'\" unpacked with wrong size!
  816. fi
  817. # end of 'ISPIN/misc/ISPIT.dr/ISPIT.mail'
  818. fi
  819. if test -f 'ISPIN/misc/ISPIT.dr/IMPLEMENT' -a "${1}" != "-c" ; then 
  820.   echo shar: Will not clobber existing file \"'ISPIN/misc/ISPIT.dr/IMPLEMENT'\"
  821. else
  822. echo shar: Extracting \"'ISPIN/misc/ISPIT.dr/IMPLEMENT'\" \(6949 characters\)
  823. sed "s/^X//" >'ISPIN/misc/ISPIT.dr/IMPLEMENT' <<'END_OF_FILE'
  824. XISPIT (Indianapolis Simple Protocol for Inter-system Transfers)
  825. X
  826. XIMPLEMENTATION NOTES
  827. X
  828. X
  829. XDON'T BOTHER IMPLEMENTING THIS ON 16-BIT MACHINES SUCH AS ZILOG MODEL 31 (or
  830. Xeven the so-called "32-bit Upgrade"). Their I/O systems are not adequate for
  831. Xthe reliable data flow ISPIT requires.
  832. X
  833. XOn dual universe machines, do everything from att universe.
  834. X
  835. XAlso, if any of the machines you use in this scenario do not support the
  836. Xcompress/uncompress/btoa/atob/zcat family of executables, you'll need 'em.
  837. XThe Pyramids and Sequents have these in the ucb universe. "Pure" System V's
  838. Xlike the AT&T boxes and Zilog 130's don't. I have source code which compiles
  839. Xand executes fine on our Zilog 130 and my AT&T 3B1. If you want it, ask me.
  840. X
  841. X
  842. XSOURCE MACHINE:
  843. X
  844. X                 First, the source machine must have ISPIN.rel_2.1 or later.
  845. X
  846. X                 do_ispit.sh - check this script for correct pathnames to
  847. X                               your executables such as compress, btoa,
  848. X                               cpio, and lp. On dual universe machines, the
  849. X                               Berzerkely commands will have to be preceded
  850. X                               by "ucb".
  851. X
  852. X                             - Put a copy of this script in a directory which
  853. X                               is in your path, renaming it as "ispit", such
  854. X                               as:
  855. X                                   cp do_ispit.sh /usr/local/bin/ispit
  856. X
  857. X                                   or
  858. X
  859. X                                   cp do_ispit.sh /z/bin/ispit
  860. X
  861. X                 rtab.entry  - Edit this rtab entry to make it valid for your
  862. X                               situation. You'll have to change:
  863. X
  864. X                                 - the first field, for queue member name.
  865. X                                   I suggest the node name of the destination
  866. X                                   system.
  867. X
  868. X                                 - the second field, the device(s). Use the 
  869. X                                   same one(s) as you do for ISPIN printing.
  870. X
  871. X                                 - the connect chat fields. If you're going
  872. X                                   straight through CDN to the remote system,
  873. X                                   you'll only have to change the address.
  874. X                                   If negotiating other switches, adjust
  875. X                                   accordingly.
  876. X
  877. X                                   Unlike uucp,  ISPIT   REQUIRES   XON/XOFF 
  878. X                                   FLOW CONTROL! So make sure all the
  879. X                                   network links you go through support it.
  880. X                                   From the source machine, go out via ports
  881. X                                   you use for printing. Log into the destina-
  882. X                                   tion box through channels just like a
  883. X                                   user (person). Don't use "no flow" uucp
  884. X                                   file transfer channels.
  885. X
  886. X                                 - Notice that this rtab entry results in a 
  887. X                                   user named "ispit" logging onto the remote
  888. X                                   machine with password of "notvalid". Change
  889. X                                   these to correspond with what you set up
  890. X                                   on the destination system.
  891. X
  892. X                                 - The rest of the rtab entry, including 
  893. X                                   "FILE?", "OK", etc MUST STAY AS IS! It
  894. X                                   talks to the ispit.sh script on the dest-
  895. X                                   ination box.
  896. X
  897. X                                 - Add the rtab entry to your rtab file. 
  898. X
  899. X                 lpadmin stuff - Add a queue member whose name matches the
  900. X                                 first field of the rtab entry, using the
  901. X                                 special new ispit interface script included
  902. X                                 here. Such as:
  903. X
  904. X                                 lpshut
  905. X
  906. X                                 lpadmin -pINDY_5 -v/dev/null -iinterface
  907. X
  908. X                                 accept INDY_5
  909. X
  910. X                                 enable INDY_5
  911. X
  912. X                                 lpsched
  913. X
  914. X
  915. X
  916. XDESTINATION MACHINE:
  917. X
  918. X                 Add a user to the system. Use the passwd.entry file included
  919. X                 here as a model. This user's logname and password must match
  920. X                 corresponding fields in the rtab entry you set up on the
  921. X                 source machine.
  922. X
  923. X                 Compile the program "eot_trap" from the source I've provided.
  924. X
  925. X                         cc -o eot_trap eot_trap.c
  926. X
  927. X                 Put the executable "eot_trap" and the script "ispit.sh" in
  928. X                 the new user's home directory. Make they are executable by
  929. X                 the new user.
  930. X
  931. X                 Test this new user by logging as him (OK, Kim, as her).
  932. X                 ispit.sh will prompt you for a file name. Give a name and
  933. X                 a carriage return. Type anything you want, ending with a
  934. X                 <ctrl>d. When you log in again as yourself, the file you
  935. X                 specified should consist of all you typed.
  936. X
  937. X
  938. XUSAGE:
  939. X
  940. X                 The script do_ispit.sh contains some internal documentation
  941. X                 on its usage.
  942. X
  943. X                 If you transfer data via the do_ispit.sh (or "ispit") script,
  944. X                 the file on the destination machine will be named as you
  945. X                 specify. The file's format is as a cpio archive which is
  946. X                 compressed, then converted by btoa. To disassemble this mess
  947. X                 on the destination machine, you can:
  948. X
  949. X                        cat filename|atob|zcat|cpio -iudmcv
  950. X
  951. X                        on a dual universe box, from att universe:
  952. X                        cat filename|ucb atob|ucb zcat|cpio -iudmcv
  953. X
  954. XAPPLICATION:
  955. X
  956. X                 I've even had good luck specifying the nine track drive as
  957. X                 the destination device (Zilog 130, not Sequent B8). Here's
  958. X                 how I send the entire contents of my AT&T 3B1's 68MB hard
  959. X                 drive (approx 64% full) to a nine track tape on a Zilog
  960. X                 Model 130 named INDY_5:
  961. X
  962. X                 #!/bin/sh
  963. X                 cd /
  964. X                 /usr/local/bin/ispit . /dev/rmiop0 INDY_5
  965. X         
  966. X                 When I want to check the correctness of my backup tape,
  967. X                 I login to INDY_5, mount my tape, and:
  968. X
  969. X                        cat /dev/rmiop0|atob|zcat|cpio -itcv > tape.list
  970. X
  971. X                 You could easily modify the ispit.sh script on the destina-
  972. X                 tion machine so that eot_trap sends its output through atob,
  973. X                 and zcat, and then to the specified output file. Then you'd
  974. X                 be dealing with a simple cpio archive at the destination.
  975. X
  976. X                 Come to think of it, you could modify any of this to do
  977. X                 anything you might dream up!
  978. END_OF_FILE
  979. if test 6949 -ne `wc -c <'ISPIN/misc/ISPIT.dr/IMPLEMENT'`; then
  980.     echo shar: \"'ISPIN/misc/ISPIT.dr/IMPLEMENT'\" unpacked with wrong size!
  981. fi
  982. # end of 'ISPIN/misc/ISPIT.dr/IMPLEMENT'
  983. fi
  984. if test -f 'ISPIN/misc/SUID.dr/mail.msg' -a "${1}" != "-c" ; then 
  985.   echo shar: Will not clobber existing file \"'ISPIN/misc/SUID.dr/mail.msg'\"
  986. else
  987. echo shar: Extracting \"'ISPIN/misc/SUID.dr/mail.msg'\" \(5839 characters\)
  988. sed "s/^X//" >'ISPIN/misc/SUID.dr/mail.msg' <<'END_OF_FILE'
  989. XThe UNIX System V, release 2 lp subsystem incorporates a peculiar security
  990. Xmechanism. Unless the administrative user "lp" can read a file, it cannot
  991. Xbe printed. This effectively requires that any file which is to be printed
  992. Xmust have read permissions for the world.
  993. X
  994. XFor many sites/users/systems administrators this is an unacceptable situation.
  995. XFiles and directories are created with restrictive permissions for valid
  996. Xsecurity reasons. Even temporarily opening perms on a file to permit printing
  997. Xrepresents a potential security breach.
  998. X
  999. XIn 1987, Centel's Perry Mathis devised a Bourne shell script called "lpc".
  1000. XIt was designed to be run in place of /usr/bin/lp (after the "real" lp had
  1001. Xbeen moved to another name). lpc allowed any file the calling user could
  1002. Xread to be printed (by catting the file to a pipe to the "real" lp command).
  1003. X
  1004. XMany sites use the lpc script and find it acceptable. It has a side-effect
  1005. Xwhich many find unacceptable. When the "real" lp is asked to print the
  1006. Xstandard input (from the "cat" command), lp MUST make a temporary copy of
  1007. Xthe input so that it can be printed when lpsched allows. This copy is created
  1008. Xin the /usr/spool/lp/request/printername directory. This process eats cpu
  1009. Xand disk access time. Even worse, if the file(s) is(are) REALLY BIG, the
  1010. Xcopying activity can run the /usr filesystem down to zero free blocks!
  1011. X
  1012. XCatch-22.
  1013. X
  1014. XUntil now.
  1015. X
  1016. XI've recently had the pleasure of working with a box which runs 
  1017. XUNIX SysV release 3. The lp subsystem under release 3 employs a more logical,
  1018. Xmore flexible security approach. Under Sys V release 3, the daemon process
  1019. Xlpsched runs as setuid to root. Depending upon the particular flavor of
  1020. XSysVrel3, some of the other related process also run as superuser. At the
  1021. Xend of the print request/spooling/scheduling/printing process, the program
  1022. Xwhich actually reads and prints the file is executed under the identity
  1023. Xof the user who requested the job.
  1024. X
  1025. XThe net effect is that the user is allowed to print any file which they
  1026. Xcan read, but no extra disk copy need be created. This flexibility is
  1027. Xenabled while still retaining the security of not allowing users to print
  1028. Xfiles which they cannot read.
  1029. X
  1030. XI've devised a means by which you can make your System V release 2 lp 
  1031. Xsubsystem emulate release 3's behavior. Two files are attached below.
  1032. X
  1033. XFirst is a Bourne shell script which changes lp's uid to 0 and sets correct
  1034. Xfile permissions on all lp subsystem executables.
  1035. X
  1036. XSecond is a code fragment with which you can patch your
  1037. XISPIN.rel_2.1/ISPIN/src/ISPIN.c. This patch is good only for a 2.1 ISPIN!
  1038. X
  1039. XDO NOT USE THE FIRST WITHOUT THE SECOND! If you do, you'll totally subvert
  1040. Xall security relative to printing. 
  1041. X
  1042. X--- cut here --- cut here --- cut here --- cut here --- cut here --- cut here 
  1043. X#!/bin/sh
  1044. X# lp_perms.sh     05/13/91    LSB     IRS Indianapolis
  1045. X#
  1046. X# This routine sets up a System V, release 2 lp subsystem to behave
  1047. X# similar to a System V, release 3 lp subsystem with respect to file
  1048. X# access. It all runs as setuid to superuser. Under this setup, it
  1049. X# is CRITICALLY IMPORTANT to have an interface program which will
  1050. X# setgid and setuid back to the user who requested the job, thus
  1051. X# maintaining security. 
  1052. X#
  1053. X# After you run this routine, MAKE SURE that the user "lp" does have
  1054. X# a password which is unknown to all. Anyone who logs on as lp will
  1055. X# be superuser.
  1056. X#
  1057. X# After implementation of this routine and the setgid/setuid interface,
  1058. X# users will be able to print any file which they themselves can read.
  1059. X#
  1060. X# This is the code fragment for ispin which does the trick:
  1061. X#     #ifdef LP
  1062. X#           /* If this process is running as setuid to root (uid == 0),
  1063. X#              then setuid to the requesting user.      05/09/91  LSB   */
  1064. X#           if(geteuid() == 0)
  1065. X#           {
  1066. X#             setgid(pass->pw_gid);
  1067. X#             setuid(pass->pw_uid);
  1068. X#           }
  1069. X#     #endif
  1070. X# ISPIN.rel_2.1/src/ISPIN.c can be patched with this code fragment after line
  1071. X# 1269. All ISPIN releases after ISPIN.rel_2.1 will contain this code.
  1072. X#
  1073. X# change lp's uid to 0
  1074. Xset UID
  1075. Xset LYNE
  1076. XUID=`grep lp\: /etc/passwd|cut -d\: -f3`
  1077. XLYNE=`grep -n lp\: /etc/passwd|cut -d\: -f1`
  1078. Xsed $LYNE\ s/\:$UID\:/\:0\:/g /etc/passwd > /tmp/passwd.TMP
  1079. Xcp /etc/passwd /tmp/passwd.sav
  1080. Xcp /tmp/passwd.TMP /etc/passwd
  1081. X#
  1082. X# lp administrative stuff, superuser only
  1083. Xchown lp /usr/lib/lpsched
  1084. Xchmod 700 /usr/lib/lpsched
  1085. Xchown lp /usr/lib/lpshut
  1086. Xchmod 700 /usr/lib/lpshut
  1087. Xchown lp /usr/lib/lpmove
  1088. Xchmod 700 /usr/lib/lpmove
  1089. Xchown lp /usr/lib/accept
  1090. Xchmod 700 /usr/lib/accept
  1091. Xchown lp /usr/lib/reject
  1092. Xchmod 700 /usr/lib/reject
  1093. X#
  1094. X# lp user stuff
  1095. Xchown lp /usr/bin/lp
  1096. Xchmod 4711 /usr/bin/lp
  1097. Xchown lp /usr/bin/lpstat
  1098. Xchmod 4711 /usr/bin/lpstat
  1099. Xchown lp /usr/bin/cancel
  1100. X# The following lets any user cancel any job, same as before.
  1101. X# If you don't like that, change 4711 to 700. Then only superuser can cancel.
  1102. X# Same goes for enable and disable.
  1103. Xchmod 4711 /usr/bin/cancel
  1104. Xchown lp /usr/bin/enable
  1105. Xchmod 4711 /usr/bin/enable
  1106. Xchown lp /usr/bin/disable
  1107. Xchmod 4711 /usr/bin/disable
  1108. X# end of lp_perms.sh
  1109. X--- cut here --- cut here --- cut here --- cut here --- cut here --- cut here 
  1110. X
  1111. XThe following code module is to be inserted after line 1269 of the file
  1112. XISPIN.rel_2.1/ISPIN/src/ISPIN.c
  1113. X
  1114. XAfter you have inserted this code fragment, cd to
  1115. X
  1116. X       ISPIN.rel_2.1/ISPIN/install
  1117. X
  1118. Xthen
  1119. X
  1120. X       make ../obj/ispin
  1121. X
  1122. Xthen (when there are no active print jobs)
  1123. X
  1124. X       cp ../obj/ispin /usr/spool/lp/ISPIN/ispin
  1125. X
  1126. X
  1127. X--- cut here --- cut here --- cut here --- cut here --- cut here --- cut here 
  1128. X#ifdef LP
  1129. X      /* If this process is running as setuid to root (uid == 0),
  1130. X         then setuid to the requesting user.      05/09/91  LSB   */
  1131. X      if(geteuid() == 0)
  1132. X      {
  1133. X        setgid(pass->pw_gid);
  1134. X        setuid(pass->pw_uid);
  1135. X      }
  1136. X#endif
  1137. X--- cut here --- cut here --- cut here --- cut here --- cut here --- cut here 
  1138. END_OF_FILE
  1139. if test 5839 -ne `wc -c <'ISPIN/misc/SUID.dr/mail.msg'`; then
  1140.     echo shar: \"'ISPIN/misc/SUID.dr/mail.msg'\" unpacked with wrong size!
  1141. fi
  1142. # end of 'ISPIN/misc/SUID.dr/mail.msg'
  1143. fi
  1144. if test -f 'ISPIN/misc/wrdprfct.doc' -a "${1}" != "-c" ; then 
  1145.   echo shar: Will not clobber existing file \"'ISPIN/misc/wrdprfct.doc'\"
  1146. else
  1147. echo shar: Extracting \"'ISPIN/misc/wrdprfct.doc'\" \(4179 characters\)
  1148. sed "s/^X//" >'ISPIN/misc/wrdprfct.doc' <<'END_OF_FILE'
  1149. XFrom uucp Mon Feb  4 23:51 EST 1991
  1150. X>From lbartz  Mon Feb  4 23:35:53 1991 remote from localhost
  1151. XReceived: by localhost.UUCP (4.12/4.7)
  1152. X    id AA00203; Mon, 4 Feb 91 23:35:53 est
  1153. XMessage-Id: <9102050435.AA00203@localhost.UUCP>
  1154. XReceived: from cr07 by indy6.indy6.irs.gov id ab00186; 4 Feb 91 23:35 EST
  1155. XReceived: from tis by cr07.cr07.irs.gov id ab24006; 4 Feb 91 22:14 EST
  1156. XReceived: from wr by no1.irs id ac21732; 4 Feb 91 22:18 EST
  1157. XReceived: from sea by wr1.irs id aa00381; 4 Feb 91 9:58 PST
  1158. XDate:     4 Feb 91 9:45:27-EST (Mon)
  1159. XFrom: localhost!"Mwilson at sea"@wr1.ARPA
  1160. XTo: ispinusr@indy6.ARPA
  1161. XStatus: RO
  1162. X
  1163. X
  1164. X
  1165. X
  1166. X
  1167. X
  1168. X         INTERFACING ISPIN WITH WORDPERFECT 5.0 AND SCO UNIX V/386
  1169. X
  1170. X
  1171. X         Larry "The Supreme Print Commander" Bartz asked me to pass this
  1172. X         along in the hopes that it may be of some help to the folks
  1173. X         who are running WordPerfect 4.2 on their Sequents.
  1174. X
  1175. X
  1176. X         The problem we encountered was that Wordperfect assumes that
  1177. X         the "interface" program for each printer is a Bourne shell
  1178. X         script.  When you use "wpport" to let WP know about the printer
  1179. X         it tries to add a few lines of its own to the script in
  1180. X         order to format the document for the printer type.  If the
  1181. X         interface just happens to be "ispintrfce" (a C executable)
  1182. X         good ole WP can't do its thing.  After a few phone calls to
  1183. X         the "Bartzman" we've come up with the following.
  1184. X
  1185. X         1.  De-install the printer that you want to use.
  1186. X
  1187. X         2.  Create a file that will hold the formatted WP output
  1188. X             file for each printer.
  1189. X
  1190. X             touch /usr/tmp/yourprinter.tmp
  1191. X   
  1192. X             or any other directory that suits you.  Remember, references
  1193. X             to "yourprinter" means the name you give your printer.
  1194. X
  1195. X         3.  Put this pseudo interface file in your lp "interface"
  1196. X             directory.  We call it "wpface"
  1197. X
  1198. X---------------------------CUT HERE-----------------------------------------
  1199. X# wpface
  1200. Xfor option in $5
  1201. Xdo
  1202. X    if [ $option = WP50 ]
  1203. X    then
  1204. X                ### Make sure to change PRINTER.tmp to your "queuename".tmp
  1205. X                # and have correct directory references
  1206. X                cat /dev/null > /usr/tmp/PRINTER.tmp
  1207. X        /u1/WP50/sbin/wpp50 < $6
  1208. X                ### Make sure to change PRINTER.tmp to your "queuename".tmp
  1209. X                exec /usr/spool/lp/ISPIN/ispin `/bin/basename $0|/usr/bin/tr -d "[\012*]"` $1 $2 "" $4 option /usr/tmp/PRINTER.tmp
  1210. X        fi
  1211. Xdone
  1212. Xif [ "$option" = "" ]
  1213. X   then
  1214. X                exec /usr/spool/lp/ISPIN/ispin `/bin/basename $0|/usr/bin/tr -d "[\012*]"` $1 $2 "" $4 "" $6
  1215. X   fi
  1216. X---------------------------CUT HERE------------------------------------------
  1217. X
  1218. X
  1219. X       Don't worry about the contents of this just yet.  WP will stomp on it
  1220. X       and put its junk in when using "wpport" 
  1221. X
  1222. X         4.  Time to install your printer to the "lp" system
  1223. X             "cd" to your interface directory
  1224. X             replace the "lpadmin" command options in your ispin
  1225. X             documentation with the following:
  1226. X             "/usr/lib/lpadmin -pyourprinter -iwpface -v/usr/tmp/yourprinter.tmp
  1227. X
  1228. X             Remember that file you created in step 2.  That's your "-v"
  1229. X             flag option
  1230. X             Start your scheduler and do your "accepts" and "enables"
  1231. X
  1232. X         5.  Install your printer for WP using "wpport".  We've found
  1233. X             that WP will try to set the line settings using "stty"
  1234. X             which it can't do because the printer isn't connected
  1235. X             to particular tty.  You defeat this by defining the line
  1236. X             type as parallel (Yes it works!!!!!!!!!)
  1237. X
  1238. X         6.  Go back to your lp "interface" directory.  Copy "wpface"
  1239. X             over "yourprinter" interface file created in step 4.
  1240. X             Edit the new "yourprinter" file replacing the references
  1241. X             to "PRINTER" with "yourprinter" name.
  1242. X
  1243. X         7.  That's all.  Hope this helps out.  I'll be glad to pass
  1244. X             along any enhancements or changes that we come across.
  1245. X
  1246. X                                          Mike Wilson
  1247. X                                          S.A.  Sys Supp Br.
  1248. X                                          Seattle DO ISD
  1249. X
  1250. X
  1251. END_OF_FILE
  1252. if test 4179 -ne `wc -c <'ISPIN/misc/wrdprfct.doc'`; then
  1253.     echo shar: \"'ISPIN/misc/wrdprfct.doc'\" unpacked with wrong size!
  1254. fi
  1255. # end of 'ISPIN/misc/wrdprfct.doc'
  1256. fi
  1257. echo shar: End of archive 14 \(of 15\).
  1258. cp /dev/null ark14isdone
  1259. MISSING=""
  1260. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  1261.     if test ! -f ark${I}isdone ; then
  1262.     MISSING="${MISSING} ${I}"
  1263.     fi
  1264. done
  1265. if test "${MISSING}" = "" ; then
  1266.     echo You have unpacked all 15 archives.
  1267.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1268. else
  1269.     echo You still need to unpack the following archives:
  1270.     echo "        " ${MISSING}
  1271. fi
  1272. ##  End of shell archive.
  1273. exit 0
  1274.  
  1275.