home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / pty4 / part01 next >
Encoding:
Text File  |  1992-02-18  |  78.7 KB  |  2,988 lines

  1. Newsgroups: comp.sources.unix
  2. From: brnstnd@nyu.edu (Dan Bernstein)
  3. Subject: v25i127: Generalized interface to pseudo-tty devices, Part01/09
  4. Sender: unix-sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: brnstnd@nyu.edu (Dan Bernstein)
  8. Posting-Number: Volume 25, Issue 127
  9. Archive-Name: pty4/part01
  10.  
  11. [ What can I say?  It slices, it dices, it washes dishes, it walks the dog.
  12.   It "just works", meaning that if you follow the directions you'll get a
  13.   working package without any pulling of hair or gnashing of teeth or other
  14.   standard porting activities.  Here's BLURB, to convince you that it's worth
  15.   unpacking and installing.                    --vix ]
  16.  
  17. pty is meant as the sole interface between pseudo-terminals and the rest
  18. of the system. Rich Salz said of pty 3.0: ``This is the Ginsu knife (it
  19. slices, it dices, it never rusts) that Dan has been talking about in
  20. comp.unix.wizards/internals for some time now. It is a mind-blower.''
  21. But I just couldn't leave well enough alone, so here's pty 4.0, a vastly
  22. improved rewrite of the entire package. A taste of what it has to offer:
  23.  
  24. * Improved security - pty 3.0 offered tty security ahead of its time---
  25. several months afterwards, Sun released a ``critical'' security patch
  26. with essentially the same security tests. Now pty 4.0 offers proven
  27. security. Although you can install and use the package without
  28. privileges, system administrators can install pty 4.0 so that it
  29. _guarantees_ that nobody else has access to your tty. I'm offering a
  30. cash reward for anyone who can subvert these guarantees.
  31.  
  32. * Session management - If you run your shell under pty, and the
  33. connection is hung up, you can log in again and reconnect. The session
  34. management model is extremely simple---it has just three primitives---
  35. yet powerful enough to accomplish tricky tasks, such as recording the
  36. output from a process after the process has started. A paper in the
  37. package, ``An introduction to session management,'' leads even novice
  38. users through competent use of session management commands.
  39.  
  40. * Automatic installation - pty 4.0 comes with a completely automated
  41. configure/compile/install/verify-configuration setup. It will configure
  42. itself properly for most popular systems without human input.
  43.  
  44. * Modularity - When I say that pty is meant as the sole interface to
  45. pseudo-terminals, I mean it! pty doesn't get in the way of direct,
  46. efficient pseudo-terminal I/O. So you can use it as a component of other
  47. programs which add input line editing, virtual screen support, or other
  48. fancy features. pty handles just one job, and handles it so cleanly that
  49. you'll never have to duplicate pseudo-terminal code in another program.
  50.  
  51. * Free utilities - pty 4.0 comes with even more useful utilities than
  52. pty 3.0. It includes ten improved clones of standard utilities, notably
  53. a version of ``script'' which makes a proper utmp entry; and thirty new
  54. tools ranging from administrative helpers to ``tscript'', which records
  55. an interactive session _including the timing between characters_. Power
  56. users will appreciate ``nobuf'', which uses pty to transparently turn
  57. off stdio buffering in any program.
  58.  
  59. * Free libraries - The pty package comes with several of my favorite
  60. libraries: env, fmt, getopt, radixsort, ralloc, scan, sigdfl, sigsched,
  61. sod, timer, username. You can use all of these for your own programs.
  62.  
  63. * POSIX support - pty 4.0 works without trouble under popular POSIX/BSD
  64. systems, including Ultrix 4.1 and SunOS 4.1.1. All the job control
  65. features have been adapted to work with POSIX job control. pty should
  66. also be included with BSD 4.4.
  67.  
  68. * Detailed documentation - Let your worries about incomplete program
  69. documentation be over. The pty package includes more than five thousand
  70. lines of documentation: forty quick-reference man pages; papers on
  71. controlling ttys, job control, session management, and user log files;
  72. extensive notes on pty internals and porting issues; and more.
  73.  
  74. Okay, enough hype. What's pty good for? Once upon a time nethack would,
  75. if you were lucky, produce characters with both a ring of polymorph and
  76. a ring of polymorph control. I wanted to run nethack inside a script
  77. which would keep rerolling characters until it saw that combination.
  78. (Playing by the rules was never my forte.) Unfortunately, nethack didn't
  79. like having its input and output redirected. So I wrote the first
  80. versions of pty. ``pty nethack'' worked just like ``nethack'' but could
  81. be invoked in the middle of a pipe inside a script. As the years went
  82. by, pty became somewhat more powerful and flexible, but its basic
  83. function has always remained the same: to run programs, especially
  84. ``interactive'' programs, under a pseudo-tty. Despite this single-minded
  85. attitude, pty has wormed its way into the solutions to dozens of
  86. problems, ranging from buffer control to automating telnet scripts to
  87. making rlogind secure. Pseudo-terminal code seems to spring up
  88. everywhere; pty is your weapon to slash that code to a single line.
  89. Enjoy!
  90.  
  91.     ---Dan Bernstein, brnstnd@nyu.edu
  92.  
  93. #! /bin/sh
  94. # This is a shell archive.  Remove anything before this line, then unpack
  95. # it by saving it into a file and typing "sh file".  To overwrite existing
  96. # files, type "sh file -c".  You can also feed this as standard input via
  97. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  98. # will see the following message at the end:
  99. #        "End of archive 1 (of 9)."
  100. # Contents:  BINARIES MANIFEST OBJECTS README UNSHAR.HDR argv0.1
  101. #   argv0.c biff.c checkptys.8 config config/devmty.h config/devsty.h
  102. #   config/fdsettrouble.h config/genericptr.h config/posix.h
  103. #   config/ptybin.h config/ptydir.h config/ptyext.h config/ptygroup.h
  104. #   config/ptylongname.h config/ptymodes.h config/ptyopts.h
  105. #   config/sessconnfile.h config/sessfile.h config/sysv.h
  106. #   config/ttyopts.h config/utmpfile.h config/wtmpfile.h ctrlv.c env.h
  107. #   excloff.c exclon.1 exclon.c fmt.h getopt.h getoptquiet.h lock.1
  108. #   mesg.1 mesg.c nobuf.sh ptycomm.h ptyerr.h ptyget.h ptylogs.h
  109. #   ptymaster.h ptymisc.h ptysecure.h ptysigler.h ptyslave.h
  110. #   ptytexts.h radixsort.h ralloc.h scan.h sclogrotate.sh scnowinit.sh
  111. #   script.sh script.tidy.1 script.tidy.sh sess.sh sessconnlog.h
  112. #   sesslist.1 sesslog.h sessmenu.1 sessname.1 sessnowinit.sh
  113. #   sessrotate.sh sigdfl.h sigsched.h sod.h talkacros.7 timer.h
  114. #   tiocsti.1 tiocsti.c tplay.1 tscript.sh tty.1 tty.c ttydetach.1
  115. #   ttyprotect.sh username.h users.1 utmpinit.8 utmpinit.c waitfor.1
  116. #   waitfor.c wall.1 whoami.1 whoami.c wtmprotate.8 wtmprotate.sh
  117. # Wrapped by vixie@cognition.pa.dec.com on Wed Feb 19 13:35:00 1992
  118. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  119. if test -f 'BINARIES' -a "${1}" != "-c" ; then 
  120.   echo shar: Will not clobber existing file \"'BINARIES'\"
  121. else
  122. echo shar: Extracting \"'BINARIES'\" \(342 characters\)
  123. sed "s/^X//" >'BINARIES' <<'END_OF_FILE'
  124. CHECKCONF
  125. INSTALL
  126. argv0
  127. biff
  128. checkptys
  129. condom
  130. ctrlv
  131. disconnect
  132. exclon
  133. excloff
  134. lock
  135. mesg
  136. nobuf
  137. pty
  138. reconnect
  139. sclogrotate
  140. scnowinit
  141. script
  142. script.tidy
  143. sess
  144. sesskill
  145. sesslist
  146. sessmenu
  147. sessname
  148. sessnowinit
  149. sessrotate
  150. sesswhere
  151. sesswho
  152. tiocsti
  153. tplay
  154. trecord
  155. tscript
  156. tty
  157. ttydetach
  158. ttyprotect
  159. users
  160. utmpinit
  161. waitfor
  162. wall
  163. who
  164. whoami
  165. write
  166. wtmprotate
  167. END_OF_FILE
  168. if test 342 -ne `wc -c <'BINARIES'`; then
  169.     echo shar: \"'BINARIES'\" unpacked with wrong size!
  170. fi
  171. # end of 'BINARIES'
  172. fi
  173. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  174.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  175. else
  176. echo shar: Extracting \"'MANIFEST'\" \(5490 characters\)
  177. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  178. X   File Name        Archive #    Description
  179. X-----------------------------------------------------------
  180. X BINARIES                   1    
  181. X BLURB                      4    
  182. X CALLS                      6    
  183. X CHANGES                    3    
  184. X CHECKCONF.c                3    
  185. X COPYRIGHT                  2    
  186. X CTTYS.draft1               6    
  187. X FILES                      2    
  188. X FORMLETTER                 2    
  189. X IMPACT                     3    
  190. X INSTALL.c                  4    
  191. X JOBCTRL.draft3             9    
  192. X MANIFEST                   1    
  193. X Makefile                   6    
  194. X NEW                        5    
  195. X NOTES                      4    
  196. X OBJECTS                    1    
  197. X QUESTIONS                  5    
  198. X README                     1    
  199. X SECURITY                   4    
  200. X SESS.draft2                7    
  201. X SYSCONF                    4    
  202. X TESTS                      4    
  203. X ULOGS.draft1               5    
  204. X UNSHAR.HDR                 1    
  205. X WTF                        3    
  206. X argv0.1                    1    
  207. X argv0.c                    1    
  208. X biff.1                     2    
  209. X biff.c                     1    
  210. X checkptys.8                1    
  211. X checkptys.c                4    
  212. X condom.1                   2    
  213. X config                     1    
  214. X config/devmty.h            1    
  215. X config/devsty.h            1    
  216. X config/fdsettrouble.h      1    
  217. X config/genericptr.h        1    
  218. X config/posix.h             1    
  219. X config/ptybin.h            1    
  220. X config/ptydir.h            1    
  221. X config/ptyext.h            1    
  222. X config/ptygroup.h          1    
  223. X config/ptylongname.h       1    
  224. X config/ptymodes.h          1    
  225. X config/ptyopts.h           1    
  226. X config/sessconnfile.h      1    
  227. X config/sessfile.h          1    
  228. X config/sysv.h              1    
  229. X config/ttyopts.h           1    
  230. X config/utmpfile.h          1    
  231. X config/wtmpfile.h          1    
  232. X ctrlv.c                    1    
  233. X disconnect.1               2    
  234. X disconnect.c               2    
  235. X env.c                      4    
  236. X env.h                      1    
  237. X excloff.c                  1    
  238. X exclon.1                   1    
  239. X exclon.c                   1    
  240. X fmt.c                      4    
  241. X fmt.h                      1    
  242. X getopt.c                   3    
  243. X getopt.h                   1    
  244. X getoptquiet.c              2    
  245. X getoptquiet.h              1    
  246. X lock.1                     1    
  247. X lock.c                     2    
  248. X mesg.1                     1    
  249. X mesg.c                     1    
  250. X nobuf.sh                   1    
  251. X pty-basic.1                3    
  252. X pty-opts.1                 6    
  253. X pty.1                      5    
  254. X ptycomm.c                  3    
  255. X ptycomm.h                  1    
  256. X ptyerr.c                   2    
  257. X ptyerr.h                   1    
  258. X ptyget.c                   3    
  259. X ptyget.h                   1    
  260. X ptylogs.c                  2    
  261. X ptylogs.h                  1    
  262. X ptymain.c                  7    
  263. X ptymaster.c                8    
  264. X ptymaster.h                1    
  265. X ptymisc.c                  2    
  266. X ptymisc.h                  1    
  267. X ptysecure.c                5    
  268. X ptysecure.h                1    
  269. X ptysigler.c                5    
  270. X ptysigler.h                1    
  271. X ptyslave.c                 3    
  272. X ptyslave.h                 1    
  273. X ptytexts.c                 3    
  274. X ptytexts.h                 1    
  275. X ptytty.c                   6    
  276. X ptytty.h                   2    
  277. X radixsort.3                3    
  278. X radixsort.c                8    
  279. X radixsort.h                1    
  280. X ralloc.c                   3    
  281. X ralloc.h                   1    
  282. X reconnect.1                2    
  283. X reconnect.c                2    
  284. X scan.c                     4    
  285. X scan.h                     1    
  286. X sclogrotate.sh             1    
  287. X scnowinit.sh               1    
  288. X script.1                   2    
  289. X script.sh                  1    
  290. X script.tidy.1              1    
  291. X script.tidy.sh             1    
  292. X sess.1                     2    
  293. X sess.sh                    1    
  294. X sessconnlog.c              2    
  295. X sessconnlog.h              1    
  296. X sesskill.1                 2    
  297. X sesskill.c                 2    
  298. X sesslist.1                 1    
  299. X sesslist.c                 3    
  300. X sesslog.c                  2    
  301. X sesslog.h                  1    
  302. X sessmenu.1                 1    
  303. X sessmenu.c                 3    
  304. X sessname.1                 1    
  305. X sessname.c                 3    
  306. X sessnowinit.sh             1    
  307. X sessrotate.sh              1    
  308. X sesswhere.1                2    
  309. X sesswhere.c                2    
  310. X sesswho.1                  2    
  311. X sesswho.c                  2    
  312. X sigdfl.3                   2    
  313. X sigdfl.c                   3    
  314. X sigdfl.h                   1    
  315. X sigsched.3                 6    
  316. X sigsched.c                 7    
  317. X sigsched.h                 1    
  318. X sod.h                      1    
  319. X talkacros.7                1    
  320. X timer.c                    5    
  321. X timer.h                    1    
  322. X tiocsti.1                  1    
  323. X tiocsti.c                  1    
  324. X tplay.1                    1    
  325. X tplay.c                    2    
  326. X trecord.1                  2    
  327. X trecord.c                  2    
  328. X tscript.1                  2    
  329. X tscript.sh                 1    
  330. X tty.1                      1    
  331. X tty.c                      1    
  332. X ttydetach.1                1    
  333. X ttydetach.c                2    
  334. X ttydfl.7                   2    
  335. X ttyprotect.sh              1    
  336. X username.c                 2    
  337. X username.h                 1    
  338. X users.1                    1    
  339. X users.c                    2    
  340. X utmpinit.8                 1    
  341. X utmpinit.c                 1    
  342. X waitfor.1                  1    
  343. X waitfor.c                  1    
  344. X wall.1                     1    
  345. X wall.c                     2    
  346. X who.1                      2    
  347. X who.c                      3    
  348. X whoami.1                   1    
  349. X whoami.c                   1    
  350. X write.1                    2    
  351. X write.c                    3    
  352. X wtmprotate.8               1    
  353. X wtmprotate.sh              1    
  354. END_OF_FILE
  355. if test 5490 -ne `wc -c <'MANIFEST'`; then
  356.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  357. fi
  358. # end of 'MANIFEST'
  359. fi
  360. if test -f 'OBJECTS' -a "${1}" != "-c" ; then 
  361.   echo shar: Will not clobber existing file \"'OBJECTS'\"
  362. else
  363. echo shar: Extracting \"'OBJECTS'\" \(515 characters\)
  364. sed "s/^X//" >'OBJECTS' <<'END_OF_FILE'
  365. argv0.o
  366. biff.o
  367. checkptys.o
  368. ctrlv.o
  369. disconnect.o
  370. env.o
  371. exclon.o
  372. excloff.o
  373. fmt.o
  374. getopt.o
  375. getoptquiet.o
  376. lock.o
  377. mesg.o
  378. ptycomm.o
  379. ptyerr.o
  380. ptyget.o
  381. ptylogs.o
  382. ptymain.o
  383. ptymaster.o
  384. ptymisc.o
  385. ptysecure.o
  386. ptysigler.o
  387. ptyslave.o
  388. ptytexts.o
  389. ptytty.o
  390. radixsort.o
  391. ralloc.o
  392. reconnect.o
  393. scan.o
  394. sessconnlog.o
  395. sesskill.o
  396. sesslist.o
  397. sesslog.o
  398. sessmenu.o
  399. sessname.o
  400. sesswhere.o
  401. sesswho.o
  402. sigdfl.o
  403. sigsched.o
  404. timer.o
  405. tiocsti.o
  406. tplay.o
  407. trecord.o
  408. tty.o
  409. ttydetach.o
  410. username.o
  411. users.o
  412. utmpinit.o
  413. waitfor.o
  414. wall.o
  415. who.o
  416. whoami.o
  417. write.o
  418. END_OF_FILE
  419. if test 515 -ne `wc -c <'OBJECTS'`; then
  420.     echo shar: \"'OBJECTS'\" unpacked with wrong size!
  421. fi
  422. # end of 'OBJECTS'
  423. fi
  424. if test -f 'README' -a "${1}" != "-c" ; then 
  425.   echo shar: Will not clobber existing file \"'README'\"
  426. else
  427. echo shar: Extracting \"'README'\" \(4710 characters\)
  428. sed "s/^X//" >'README' <<'END_OF_FILE'
  429. pty version 4.0, February 9, 1992.
  430. Copyright (c) 1992, Daniel J. Bernstein.
  431. All rights reserved.
  432. X
  433. X0. Read WTF if you want to know what all these files are for.
  434. X1. Run SYSCONF. Check the bottom of README for any notes relevant to
  435. X   your system.
  436. X2. Make and run CHECKCONF. Edit config/* if necessary. If you don't have
  437. X   privileges, make sure to change config/ptybin.h, config/ptydir.h, and
  438. X   config/sess*.h. If you make any changes to config/*.h, you may want
  439. X   to make and run CHECKCONF again. (If you don't have privileges, you
  440. X   may also want to change flagxonlysecure = 0 to flagxonlysecure = -1
  441. X   in ptymain.c line 36; this will eliminate a warning message each time
  442. X   you use pty.)
  443. X3. Make.
  444. X4. Make INSTALL. (This doesn't actually install pty; it only makes the
  445. X   INSTALL program, which you run in step 7.)
  446. X5. If you have privileges, and you don't have a tty group (group 4),
  447. X   make one.
  448. X6. If you have privileges, and you want to run pty as its own uid rather
  449. X   than root, make a pty uid.
  450. X7. As root, run INSTALL, or ``INSTALL root'' if pty should run as root.
  451. X   If you don't have privileges, run INSTALL anyway, and don't worry
  452. X   about the error messages. Tricks: yes skip | ./INSTALL to see all the
  453. X   steps of installation without executing any; yes ok | ./INSTALL to do
  454. X   complete installation without having to confirm each step.
  455. X8. Change /dev/tty* to be owned by pty if (1) pty isn't running as root
  456. X   but (2) you still want to take advantage of pty's security features.
  457. X   (If you want, you can chown only some of the ttys---tty[t-z]*, say.
  458. X   Then pty will stick to those. In this case you should probably edit
  459. X   config/ptyext.h to match.) Also change /dev/pty* to be owner pty and
  460. X   mode 0600 if you want to prevent denial of service attacks; keep in
  461. X   mind that this will stop valid non-root programs from opening ttys,
  462. X   and that it will not close the dozens of other denial of service
  463. X   attacks on your machine. (You may want to chmod and chown only a few
  464. X   of the ptys, to keep them free for pty just in case.)
  465. X9. If you want, invoke wtmprotate, sessrotate, or sclogrotate from your
  466. X   daily, weekly, or monthly cron scripts. (wtmprotate may already be
  467. X   handled by your vendor's scripts.) Also invoke utmpinit, sessnowinit,
  468. X   and scnowinit from /etc/rc.local. Don't worry about these if you
  469. X   don't have privileges.
  470. X10. Run checkptys. If you want, arrange to have checkptys run
  471. X    periodically by cron.
  472. X11. If you want to make sure that pty works, look through TESTS and see
  473. X    whether your setup works the same way.
  474. X12. Fill out FORMLETTER and send it to me.
  475. X
  476. Thanks to Scott Schwartz for his extensive comments; Paul Graham for
  477. utmpinit and for bug reports; Eliot Moss for all his work with pty 3.0,
  478. much of which inspired changes in pty 4.0; Maarten Litmaath for mtty;
  479. Seth Robertson for all his help; Keith Waclena for some incisive
  480. comments on pty 3.0's configuration scripts; Larry McVoy for admitting
  481. he was wrong about POSIX; Kartik Subbarao and Icarus Sparry for testing;
  482. and the cast of thousands for feature requests and suggestions. Thanks
  483. also to Dave Curry for checking pty's security.
  484. X
  485. Probably the best documentation to start with is SESS.draft2. Then try
  486. pty-basic.1, then pty.1, then pty-opts.1. pty can do a lot of stuff---
  487. don't expect to absorb it all at once.
  488. X
  489. pty is known to work in at least one configuration on each of the
  490. following machines:
  491. X
  492. X  Sun 4/280, SunOS 4.0.3
  493. X    note that because of an OS bug (fixed in SunOS 4.1), pty -t will
  494. X    fail from non-job-control shells (like sh) unless pty runs as root
  495. X  Sun 4/490, SunOS 4.1.1
  496. X    tested by KS
  497. X  Sun 3/160, SunOS 4.1.1
  498. X    thanks to Seth Robertson
  499. X  Sun 3/50, SunOS 4.1.1
  500. X  Sun SLC, SunOS 4.1.1
  501. X    tested by IS
  502. X  VAX 8600, BSD 4.3+NFS (Mt. Xinu)
  503. X  DECStation 5400, Ultrix 4.1 (Rev. 52)
  504. X    must add -YPOSIX -DPOSIX to CC in Makefile
  505. X  DECStation 5820, Ultrix 4.1 (Rev. 200)
  506. X    must add -YPOSIX -DPOSIX to CC in Makefile
  507. X
  508. Other notes for the future:
  509. X
  510. X  Convex UNIX 9.0
  511. X    must add -pcc -DPASS8=0 -DEXTB=15 to CC in Makefile; fd passing has
  512. X    a very weird bug, need to look at it in depth
  513. X  BSD 4.4
  514. X    seems to work with the new fd passing system, but the machine
  515. X    crashes; various CSRG/BSD folks are trying to find the kernel bug
  516. X  SVR4
  517. X    three people working on the port
  518. X  AIX
  519. X    two people working on the port
  520. X  IRIS (which?)
  521. X    must add -D_BSD_COMPAT -DIRIS_UGH_PTYS to CC in Makefile; must add
  522. X    -lbsd to PTYLIBS in Makefile; must define TTY_TERMIO in
  523. X    config/ttyopts.h; must define SYSV in config/sysv.h
  524. X
  525. X``Bizarre uses for pty... My favorite is: pty -0 jive | pty fn. Fn is the
  526. client for a networked chat system. The result is a killer. :-)'' ---Sean Casey
  527. END_OF_FILE
  528. if test 4710 -ne `wc -c <'README'`; then
  529.     echo shar: \"'README'\" unpacked with wrong size!
  530. fi
  531. # end of 'README'
  532. fi
  533. if test -f 'UNSHAR.HDR' -a "${1}" != "-c" ; then 
  534.   echo shar: Will not clobber existing file \"'UNSHAR.HDR'\"
  535. else
  536. echo shar: Extracting \"'UNSHAR.HDR'\" \(0 characters\)
  537. sed "s/^X//" >'UNSHAR.HDR' <<'END_OF_FILE'
  538. END_OF_FILE
  539. if test 0 -ne `wc -c <'UNSHAR.HDR'`; then
  540.     echo shar: \"'UNSHAR.HDR'\" unpacked with wrong size!
  541. fi
  542. # end of 'UNSHAR.HDR'
  543. fi
  544. if test -f 'argv0.1' -a "${1}" != "-c" ; then 
  545.   echo shar: Will not clobber existing file \"'argv0.1'\"
  546. else
  547. echo shar: Extracting \"'argv0.1'\" \(605 characters\)
  548. sed "s/^X//" >'argv0.1' <<'END_OF_FILE'
  549. X.TH argv0 1
  550. X.SH NAME
  551. argv0 \- run a program with a specified zeroth argument
  552. X.SH SYNOPSIS
  553. X.B argv0
  554. X.I realname
  555. X.I program
  556. X[
  557. X.I arg ...
  558. X]
  559. X.SH DESCRIPTION
  560. X.B argv0
  561. runs
  562. the program stored as
  563. X.I realname
  564. on disk,
  565. with the given
  566. arguments.
  567. It sets the zeroth argument of
  568. the program to
  569. X.I program.
  570. X.SH EXAMPLES
  571. X.EX
  572. argv0 /bin/csh -bin/csh
  573. X.EE
  574. X
  575. Run the shell with a hyphen as its first name.
  576. This is how
  577. X.B login(1)
  578. runs shells;
  579. X.B csh
  580. will think it is a login shell
  581. and behave accordingly.
  582. X
  583. X.EX
  584. argv0 sendmail mailq
  585. X.EE
  586. X
  587. Run
  588. X.B sendmail
  589. with a zeroth argument of
  590. X.B mailq.
  591. X.SH "SEE ALSO"
  592. execve(2),
  593. execvp(3)
  594. END_OF_FILE
  595. if test 605 -ne `wc -c <'argv0.1'`; then
  596.     echo shar: \"'argv0.1'\" unpacked with wrong size!
  597. fi
  598. # end of 'argv0.1'
  599. fi
  600. if test -f 'argv0.c' -a "${1}" != "-c" ; then 
  601.   echo shar: Will not clobber existing file \"'argv0.c'\"
  602. else
  603. echo shar: Extracting \"'argv0.c'\" \(241 characters\)
  604. sed "s/^X//" >'argv0.c' <<'END_OF_FILE'
  605. X#include <stdio.h>
  606. X
  607. main(argc,argv)
  608. int argc;
  609. char *argv[];
  610. X{
  611. X if (argc < 3)
  612. X  {
  613. X   fputs("Usage: argv0 realname program [ arg ... ]\n",stderr);
  614. X   exit(1);
  615. X  }
  616. X execvp(argv[1],argv + 2);
  617. X perror("argv0: fatal: cannot execute");
  618. X exit(4);
  619. X}
  620. END_OF_FILE
  621. if test 241 -ne `wc -c <'argv0.c'`; then
  622.     echo shar: \"'argv0.c'\" unpacked with wrong size!
  623. fi
  624. # end of 'argv0.c'
  625. fi
  626. if test -f 'biff.c' -a "${1}" != "-c" ; then 
  627.   echo shar: Will not clobber existing file \"'biff.c'\"
  628. else
  629. echo shar: Extracting \"'biff.c'\" \(599 characters\)
  630. sed "s/^X//" >'biff.c' <<'END_OF_FILE'
  631. X/* Public domain. */
  632. X
  633. X#include <sys/types.h>
  634. X#include <sys/stat.h>
  635. X#include <stdio.h>
  636. X
  637. X#define BIFFBIT 0100
  638. X
  639. main(argc,argv)
  640. int argc;
  641. char *argv[];
  642. X{
  643. X struct stat st;
  644. X
  645. X if (fstat(0,&st) == -1)
  646. X   exit(2); /* XXX */
  647. X
  648. X if (argc == 1)
  649. X   if (st.st_mode & BIFFBIT)
  650. X     printf("is y\n");
  651. X   else
  652. X     printf("is n\n");
  653. X else
  654. X   switch(argv[1][0])
  655. X    {
  656. X     case 'y':
  657. X       fchmod(0,(int) (st.st_mode | BIFFBIT));
  658. X       break;
  659. X     case 'n':
  660. X       fchmod(0,(int) (st.st_mode & ~BIFFBIT));
  661. X       break;
  662. X     default:
  663. X       fprintf(stderr,"usage: biff [y] [n]\n");
  664. X       exit(2);
  665. X    }
  666. X exit(0);
  667. X}
  668. END_OF_FILE
  669. if test 599 -ne `wc -c <'biff.c'`; then
  670.     echo shar: \"'biff.c'\" unpacked with wrong size!
  671. fi
  672. # end of 'biff.c'
  673. fi
  674. if test -f 'checkptys.8' -a "${1}" != "-c" ; then 
  675.   echo shar: Will not clobber existing file \"'checkptys.8'\"
  676. else
  677. echo shar: Extracting \"'checkptys.8'\" \(525 characters\)
  678. sed "s/^X//" >'checkptys.8' <<'END_OF_FILE'
  679. X.TH checkptys 8
  680. X.SH NAME
  681. checkptys \- check pseudo-terminal use and pty installation
  682. X.SH SYNOPSIS
  683. X.B checkptys
  684. X.SH DESCRIPTION
  685. X.B checkptys
  686. produces a report on the entire pseudo-terminal system,
  687. including users currently logged on,
  688. the protection of special files such as
  689. X/etc/utmp,
  690. and the setup of the
  691. X.B pty
  692. package.
  693. X
  694. It is assumed that
  695. X.B checkptys
  696. will be run with the same effective uid as
  697. X.B pty.
  698. You may want to run it from the daily cron script.
  699. X.SH BUGS
  700. This man page is woefully incomplete.
  701. X.SH "SEE ALSO"
  702. pty(1)
  703. END_OF_FILE
  704. if test 525 -ne `wc -c <'checkptys.8'`; then
  705.     echo shar: \"'checkptys.8'\" unpacked with wrong size!
  706. fi
  707. # end of 'checkptys.8'
  708. fi
  709. if test ! -d 'config' ; then
  710.     echo shar: Creating directory \"'config'\"
  711.     mkdir 'config'
  712. fi
  713. if test -f 'config/devmty.h' -a "${1}" != "-c" ; then 
  714.   echo shar: Will not clobber existing file \"'config/devmty.h'\"
  715. else
  716. echo shar: Extracting \"'config/devmty.h'\" \(148 characters\)
  717. sed "s/^X//" >'config/devmty.h' <<'END_OF_FILE'
  718. X#ifndef CONFIG_DEVMTY_H
  719. X#define CONFIG_DEVMTY_H
  720. X
  721. X#define DEVMTY "/dev/pty"
  722. X
  723. X/* DEVMTY is the prefix for all master sides of pseudo-ttys. */
  724. X
  725. X#endif
  726. END_OF_FILE
  727. if test 148 -ne `wc -c <'config/devmty.h'`; then
  728.     echo shar: \"'config/devmty.h'\" unpacked with wrong size!
  729. fi
  730. # end of 'config/devmty.h'
  731. fi
  732. if test -f 'config/devsty.h' -a "${1}" != "-c" ; then 
  733.   echo shar: Will not clobber existing file \"'config/devsty.h'\"
  734. else
  735. echo shar: Extracting \"'config/devsty.h'\" \(142 characters\)
  736. sed "s/^X//" >'config/devsty.h' <<'END_OF_FILE'
  737. X#ifndef CONFIG_DEVSTY_H
  738. X#define CONFIG_DEVSTY_H
  739. X
  740. X#define DEVSTY "/dev/tty"
  741. X
  742. X/* DEVSTY is the prefix of slave sides of pseudo-ttys. */
  743. X
  744. X#endif
  745. END_OF_FILE
  746. if test 142 -ne `wc -c <'config/devsty.h'`; then
  747.     echo shar: \"'config/devsty.h'\" unpacked with wrong size!
  748. fi
  749. # end of 'config/devsty.h'
  750. fi
  751. if test -f 'config/fdsettrouble.h' -a "${1}" != "-c" ; then 
  752.   echo shar: Will not clobber existing file \"'config/fdsettrouble.h'\"
  753. else
  754. echo shar: Extracting \"'config/fdsettrouble.h'\" \(180 characters\)
  755. sed "s/^X//" >'config/fdsettrouble.h' <<'END_OF_FILE'
  756. X#ifndef CONFIG_FD_SET_TROUBLE_H
  757. X#define CONFIG_FD_SET_TROUBLE_H
  758. X
  759. X#undef LACKING_FD_ZERO
  760. X#undef DESPERATE_FD_SET
  761. X
  762. X/* sysconf expects lines 4 and 5 */
  763. X
  764. X/* XXX: deprecated */
  765. X
  766. X#endif
  767. END_OF_FILE
  768. if test 180 -ne `wc -c <'config/fdsettrouble.h'`; then
  769.     echo shar: \"'config/fdsettrouble.h'\" unpacked with wrong size!
  770. fi
  771. # end of 'config/fdsettrouble.h'
  772. fi
  773. if test -f 'config/genericptr.h' -a "${1}" != "-c" ; then 
  774.   echo shar: Will not clobber existing file \"'config/genericptr.h'\"
  775. else
  776. echo shar: Extracting \"'config/genericptr.h'\" \(292 characters\)
  777. sed "s/^X//" >'config/genericptr.h' <<'END_OF_FILE'
  778. X#ifndef CONFIG_GENERICPTR_H
  779. X#define CONFIG_GENERICPTR_H
  780. X
  781. X#define GENERICPTR char *
  782. X
  783. X/* GENERICPTR is a pointer-to-memory type, for use with ioctl. */
  784. X/* char * is safe with all C compilers. void * is safe only with ANSI */
  785. X/* but may produce fewer warnings under an ANSI compiler. */
  786. X
  787. X#endif
  788. END_OF_FILE
  789. if test 292 -ne `wc -c <'config/genericptr.h'`; then
  790.     echo shar: \"'config/genericptr.h'\" unpacked with wrong size!
  791. fi
  792. # end of 'config/genericptr.h'
  793. fi
  794. if test -f 'config/posix.h' -a "${1}" != "-c" ; then 
  795.   echo shar: Will not clobber existing file \"'config/posix.h'\"
  796. else
  797. echo shar: Extracting \"'config/posix.h'\" \(292 characters\)
  798. sed "s/^X//" >'config/posix.h' <<'END_OF_FILE'
  799. X#ifndef CONFIG_POSIX_H
  800. X#define CONFIG_POSIX_H
  801. X
  802. X#undef POSIX_SILLINESS
  803. X
  804. X/* must have #undef POSIX_SILLINESS or #define POSIX_SILLINESS
  805. X   on line 4 of this file */
  806. X
  807. X/* this was originally -DPOSIX rather than -DPOSIX_SILLINESS,
  808. X   but that conflicts with Ultrix 4.0's POSIX handling */
  809. X
  810. X#endif
  811. END_OF_FILE
  812. if test 292 -ne `wc -c <'config/posix.h'`; then
  813.     echo shar: \"'config/posix.h'\" unpacked with wrong size!
  814. fi
  815. # end of 'config/posix.h'
  816. fi
  817. if test -f 'config/ptybin.h' -a "${1}" != "-c" ; then 
  818.   echo shar: Will not clobber existing file \"'config/ptybin.h'\"
  819. else
  820. echo shar: Extracting \"'config/ptybin.h'\" \(92 characters\)
  821. sed "s/^X//" >'config/ptybin.h' <<'END_OF_FILE'
  822. X#ifndef CONFIG_PTYBIN_H
  823. X#define CONFIG_PTYBIN_H
  824. X
  825. X#define PTYBIN "/usr/local/ptybin"
  826. X
  827. X#endif
  828. END_OF_FILE
  829. if test 92 -ne `wc -c <'config/ptybin.h'`; then
  830.     echo shar: \"'config/ptybin.h'\" unpacked with wrong size!
  831. fi
  832. # end of 'config/ptybin.h'
  833. fi
  834. if test -f 'config/ptydir.h' -a "${1}" != "-c" ; then 
  835.   echo shar: Will not clobber existing file \"'config/ptydir.h'\"
  836. else
  837. echo shar: Extracting \"'config/ptydir.h'\" \(225 characters\)
  838. sed "s/^X//" >'config/ptydir.h' <<'END_OF_FILE'
  839. X#ifndef CONFIG_PTYDIR_H
  840. X#define CONFIG_PTYDIR_H
  841. X
  842. X#define PTYDIR "/usr/local/etc/pty"
  843. X
  844. X/* PTYDIR is where pty will store its communications files. */
  845. X/* It must be owned by the same uid that pty runs as, mode 0700. */
  846. X
  847. X#endif
  848. END_OF_FILE
  849. if test 225 -ne `wc -c <'config/ptydir.h'`; then
  850.     echo shar: \"'config/ptydir.h'\" unpacked with wrong size!
  851. fi
  852. # end of 'config/ptydir.h'
  853. fi
  854. if test -f 'config/ptyext.h' -a "${1}" != "-c" ; then 
  855.   echo shar: Will not clobber existing file \"'config/ptyext.h'\"
  856. else
  857. echo shar: Extracting \"'config/ptyext.h'\" \(283 characters\)
  858. sed "s/^X//" >'config/ptyext.h' <<'END_OF_FILE'
  859. X#ifndef CONFIG_PTYEXT_H
  860. X#define CONFIG_PTYEXT_H
  861. X
  862. X#define PTYEXT1 "pqrstuvwxyzabcdefghijklmno"
  863. X#define PTYEXT2 "0123456789abcdef"
  864. X
  865. X/* Note that PTYEXT2[0] must indicate the leader of each bank. */
  866. X
  867. X/* Note also that the order here determines the order of the session logs. */
  868. X
  869. X#endif
  870. END_OF_FILE
  871. if test 283 -ne `wc -c <'config/ptyext.h'`; then
  872.     echo shar: \"'config/ptyext.h'\" unpacked with wrong size!
  873. fi
  874. # end of 'config/ptyext.h'
  875. fi
  876. if test -f 'config/ptygroup.h' -a "${1}" != "-c" ; then 
  877.   echo shar: Will not clobber existing file \"'config/ptygroup.h'\"
  878. else
  879. echo shar: Extracting \"'config/ptygroup.h'\" \(80 characters\)
  880. sed "s/^X//" >'config/ptygroup.h' <<'END_OF_FILE'
  881. X#ifndef CONFIG_PTYGROUP_H
  882. X#define CONFIG_PTYGROUP_H
  883. X
  884. X#define PTYGROUP 4
  885. X
  886. X#endif
  887. END_OF_FILE
  888. if test 80 -ne `wc -c <'config/ptygroup.h'`; then
  889.     echo shar: \"'config/ptygroup.h'\" unpacked with wrong size!
  890. fi
  891. # end of 'config/ptygroup.h'
  892. fi
  893. if test -f 'config/ptylongname.h' -a "${1}" != "-c" ; then 
  894.   echo shar: Will not clobber existing file \"'config/ptylongname.h'\"
  895. else
  896. echo shar: Extracting \"'config/ptylongname.h'\" \(96 characters\)
  897. sed "s/^X//" >'config/ptylongname.h' <<'END_OF_FILE'
  898. X#ifndef CONFIG_PTY_LONGNAME_H
  899. X#define CONFIG_PTY_LONGNAME_H
  900. X
  901. X#define PTYLONGNAMELEN 100
  902. X
  903. X#endif
  904. END_OF_FILE
  905. if test 96 -ne `wc -c <'config/ptylongname.h'`; then
  906.     echo shar: \"'config/ptylongname.h'\" unpacked with wrong size!
  907. fi
  908. # end of 'config/ptylongname.h'
  909. fi
  910. if test -f 'config/ptymodes.h' -a "${1}" != "-c" ; then 
  911.   echo shar: Will not clobber existing file \"'config/ptymodes.h'\"
  912. else
  913. echo shar: Extracting \"'config/ptymodes.h'\" \(129 characters\)
  914. sed "s/^X//" >'config/ptymodes.h' <<'END_OF_FILE'
  915. X#ifndef CONFIG_PTYMODES_H
  916. X#define CONFIG_PTYMODES_H
  917. X
  918. X#define PTYMODE_USED 0600
  919. X#define PTYMODE_UNUSED 0666 /* whimper */
  920. X
  921. X#endif
  922. END_OF_FILE
  923. if test 129 -ne `wc -c <'config/ptymodes.h'`; then
  924.     echo shar: \"'config/ptymodes.h'\" unpacked with wrong size!
  925. fi
  926. # end of 'config/ptymodes.h'
  927. fi
  928. if test -f 'config/ptyopts.h' -a "${1}" != "-c" ; then 
  929.   echo shar: Will not clobber existing file \"'config/ptyopts.h'\"
  930. else
  931. echo shar: Extracting \"'config/ptyopts.h'\" \(187 characters\)
  932. sed "s/^X//" >'config/ptyopts.h' <<'END_OF_FILE'
  933. X#ifndef CONFIG_PTYOPTS_H
  934. X#define CONFIG_PTYOPTS_H
  935. X
  936. X#undef PTY_MUSTNOT_SESSION
  937. X#undef PTY_MUSTNOT_UTMPHOST
  938. X#undef PTY_MUSTNOT_UTMP
  939. X#undef PTY_MUSTNOT_WTMP
  940. X#undef PTY_MUSTNOT_CHOWN
  941. X
  942. X#endif
  943. END_OF_FILE
  944. if test 187 -ne `wc -c <'config/ptyopts.h'`; then
  945.     echo shar: \"'config/ptyopts.h'\" unpacked with wrong size!
  946. fi
  947. # end of 'config/ptyopts.h'
  948. fi
  949. if test -f 'config/sessconnfile.h' -a "${1}" != "-c" ; then 
  950.   echo shar: Will not clobber existing file \"'config/sessconnfile.h'\"
  951. else
  952. echo shar: Extracting \"'config/sessconnfile.h'\" \(165 characters\)
  953. sed "s/^X//" >'config/sessconnfile.h' <<'END_OF_FILE'
  954. X#ifndef CONFIG_SESSCONNFILE_H
  955. X#define CONFIG_SESSCONNFILE_H
  956. X
  957. X#define SESSCONNLOG_FILE "/usr/local/etc/sclog"
  958. X#define SESSCONNNOW_FILE "/usr/local/etc/scnow"
  959. X
  960. X#endif
  961. END_OF_FILE
  962. if test 165 -ne `wc -c <'config/sessconnfile.h'`; then
  963.     echo shar: \"'config/sessconnfile.h'\" unpacked with wrong size!
  964. fi
  965. # end of 'config/sessconnfile.h'
  966. fi
  967. if test -f 'config/sessfile.h' -a "${1}" != "-c" ; then 
  968.   echo shar: Will not clobber existing file \"'config/sessfile.h'\"
  969. else
  970. echo shar: Extracting \"'config/sessfile.h'\" \(153 characters\)
  971. sed "s/^X//" >'config/sessfile.h' <<'END_OF_FILE'
  972. X#ifndef CONFIG_SESSFILE_H
  973. X#define CONFIG_SESSFILE_H
  974. X
  975. X#define SESSLOG_FILE "/usr/local/etc/sesslog"
  976. X#define SESSNOW_FILE "/usr/local/etc/sessnow"
  977. X
  978. X#endif
  979. END_OF_FILE
  980. if test 153 -ne `wc -c <'config/sessfile.h'`; then
  981.     echo shar: \"'config/sessfile.h'\" unpacked with wrong size!
  982. fi
  983. # end of 'config/sessfile.h'
  984. fi
  985. if test -f 'config/sysv.h' -a "${1}" != "-c" ; then 
  986.   echo shar: Will not clobber existing file \"'config/sysv.h'\"
  987. else
  988. echo shar: Extracting \"'config/sysv.h'\" \(65 characters\)
  989. sed "s/^X//" >'config/sysv.h' <<'END_OF_FILE'
  990. X#ifndef CONFIG_SYSV_H
  991. X#define CONFIG_SYSV_H
  992. X
  993. X#undef SYSV
  994. X
  995. X#endif
  996. END_OF_FILE
  997. if test 65 -ne `wc -c <'config/sysv.h'`; then
  998.     echo shar: \"'config/sysv.h'\" unpacked with wrong size!
  999. fi
  1000. # end of 'config/sysv.h'
  1001. fi
  1002. if test -f 'config/ttyopts.h' -a "${1}" != "-c" ; then 
  1003.   echo shar: Will not clobber existing file \"'config/ttyopts.h'\"
  1004. else
  1005. echo shar: Extracting \"'config/ttyopts.h'\" \(155 characters\)
  1006. sed "s/^X//" >'config/ttyopts.h' <<'END_OF_FILE'
  1007. X#ifndef CONFIG_TTYOPTS_H
  1008. X#define CONFIG_TTYOPTS_H
  1009. X
  1010. X#define TTY_WINDOWS
  1011. X#undef TTY_AUXCHARS
  1012. X#undef TTY_TERMIO
  1013. X
  1014. X/* TTY_WINDOWS must be on line 4. */
  1015. X
  1016. X#endif
  1017. END_OF_FILE
  1018. if test 155 -ne `wc -c <'config/ttyopts.h'`; then
  1019.     echo shar: \"'config/ttyopts.h'\" unpacked with wrong size!
  1020. fi
  1021. # end of 'config/ttyopts.h'
  1022. fi
  1023. if test -f 'config/utmpfile.h' -a "${1}" != "-c" ; then 
  1024.   echo shar: Will not clobber existing file \"'config/utmpfile.h'\"
  1025. else
  1026. echo shar: Extracting \"'config/utmpfile.h'\" \(322 characters\)
  1027. sed "s/^X//" >'config/utmpfile.h' <<'END_OF_FILE'
  1028. X#ifndef CONFIG_UTMPFILE_H
  1029. X#define CONFIG_UTMPFILE_H
  1030. X
  1031. X/* XXX: we should #include <utmp.h> here, but it's usually not protected,
  1032. so we have to pass on to the user the burden of including it first. */
  1033. X
  1034. X#ifndef UTMP_FILE
  1035. X#ifdef _PATH_UTMP
  1036. X#define UTMP_FILE _PATH_UTMP
  1037. X#else
  1038. X#define UTMP_FILE "/etc/utmp"
  1039. X#endif
  1040. X#endif
  1041. X
  1042. X#endif
  1043. END_OF_FILE
  1044. if test 322 -ne `wc -c <'config/utmpfile.h'`; then
  1045.     echo shar: \"'config/utmpfile.h'\" unpacked with wrong size!
  1046. fi
  1047. # end of 'config/utmpfile.h'
  1048. fi
  1049. if test -f 'config/wtmpfile.h' -a "${1}" != "-c" ; then 
  1050.   echo shar: Will not clobber existing file \"'config/wtmpfile.h'\"
  1051. else
  1052. echo shar: Extracting \"'config/wtmpfile.h'\" \(326 characters\)
  1053. sed "s/^X//" >'config/wtmpfile.h' <<'END_OF_FILE'
  1054. X#ifndef CONFIG_WTMPFILE_H
  1055. X#define CONFIG_WTMPFILE_H
  1056. X
  1057. X/* XXX: we should #include <utmp.h> here, but it's usually not protected,
  1058. so we have to pass on to the user the burden of including it first. */
  1059. X
  1060. X#ifndef WTMP_FILE
  1061. X#ifdef _PATH_WTMP
  1062. X#define WTMP_FILE _PATH_WTMP
  1063. X#else
  1064. X#define WTMP_FILE "/usr/adm/wtmp"
  1065. X#endif
  1066. X#endif
  1067. X
  1068. X#endif
  1069. END_OF_FILE
  1070. if test 326 -ne `wc -c <'config/wtmpfile.h'`; then
  1071.     echo shar: \"'config/wtmpfile.h'\" unpacked with wrong size!
  1072. fi
  1073. # end of 'config/wtmpfile.h'
  1074. fi
  1075. if test -f 'ctrlv.c' -a "${1}" != "-c" ; then 
  1076.   echo shar: Will not clobber existing file \"'ctrlv.c'\"
  1077. else
  1078. echo shar: Extracting \"'ctrlv.c'\" \(370 characters\)
  1079. sed "s/^X//" >'ctrlv.c' <<'END_OF_FILE'
  1080. X#include "ptymisc.h"
  1081. X
  1082. static char buf[64];
  1083. static char outbuf[1000];
  1084. X
  1085. main()
  1086. X{
  1087. X int r;
  1088. X int i;
  1089. X
  1090. X while ((r = read(0,buf,sizeof(buf))) > 0)
  1091. X  {
  1092. X   for (i = 0;i < r;++i)
  1093. X    {
  1094. X     outbuf[2 * i] = 22;
  1095. X     outbuf[2 * i + 1] = buf[i];
  1096. X    }
  1097. X   outbuf[2 * r] = 4;
  1098. X   bwrite(1,outbuf,2 * r + 1);
  1099. X  }
  1100. X for (i = 0;i < 30;++i)
  1101. X   outbuf[i] = 4;
  1102. X bwrite(1,outbuf,i);
  1103. X exit(0);
  1104. X}
  1105. END_OF_FILE
  1106. if test 370 -ne `wc -c <'ctrlv.c'`; then
  1107.     echo shar: \"'ctrlv.c'\" unpacked with wrong size!
  1108. fi
  1109. # end of 'ctrlv.c'
  1110. fi
  1111. if test -f 'env.h' -a "${1}" != "-c" ; then 
  1112.   echo shar: Will not clobber existing file \"'env.h'\"
  1113. else
  1114. echo shar: Extracting \"'env.h'\" \(202 characters\)
  1115. sed "s/^X//" >'env.h' <<'END_OF_FILE'
  1116. X#ifndef ENV_H
  1117. X#define ENV_H
  1118. X
  1119. extern int env_init();
  1120. extern int env_put();
  1121. extern int env_put2();
  1122. extern int env_unset();
  1123. extern char *env_get();
  1124. extern char *env_pick();
  1125. X
  1126. extern char **environ;
  1127. X
  1128. X#endif
  1129. END_OF_FILE
  1130. if test 202 -ne `wc -c <'env.h'`; then
  1131.     echo shar: \"'env.h'\" unpacked with wrong size!
  1132. fi
  1133. # end of 'env.h'
  1134. fi
  1135. if test -f 'excloff.c' -a "${1}" != "-c" ; then 
  1136.   echo shar: Will not clobber existing file \"'excloff.c'\"
  1137. else
  1138. echo shar: Extracting \"'excloff.c'\" \(110 characters\)
  1139. sed "s/^X//" >'excloff.c' <<'END_OF_FILE'
  1140. X/* Public domain. */
  1141. X#include <sys/ioctl.h>
  1142. X
  1143. main()
  1144. X{
  1145. X (void) ioctl(1,(unsigned long) TIOCNXCL,(char *) 0);
  1146. X}
  1147. END_OF_FILE
  1148. if test 110 -ne `wc -c <'excloff.c'`; then
  1149.     echo shar: \"'excloff.c'\" unpacked with wrong size!
  1150. fi
  1151. # end of 'excloff.c'
  1152. fi
  1153. if test -f 'exclon.1' -a "${1}" != "-c" ; then 
  1154.   echo shar: Will not clobber existing file \"'exclon.1'\"
  1155. else
  1156. echo shar: Extracting \"'exclon.1'\" \(729 characters\)
  1157. sed "s/^X//" >'exclon.1' <<'END_OF_FILE'
  1158. X.TH excl 1
  1159. X.SH NAME
  1160. exclon, excloff \- reserve tty for exclusive use
  1161. X.SH SYNOPSIS
  1162. X.B exclon
  1163. X.PP
  1164. X.B excloff
  1165. X.SH DESCRIPTION
  1166. The
  1167. X.B exclon
  1168. command reserves your terminal for exclusive use with
  1169. the TIOCEXCL ioctl.
  1170. This means that any attempt to open your terminal,
  1171. including through /dev/tty,
  1172. will fail.
  1173. X
  1174. X.B write
  1175. is affected by
  1176. X.B exclon,
  1177. but
  1178. X.B talk
  1179. is not.
  1180. This feature has made
  1181. X.B exclon
  1182. a popular tool for people who prefer
  1183. the
  1184. X.B talk
  1185. style of communication.
  1186. X
  1187. To unreserve your terminal, use
  1188. X.B excloff.
  1189. It is polite to do this at the end of a session,
  1190. though it is automatic when the terminal is closed.
  1191. X.SH AUTHOR
  1192. I hesitate to claim authorship for a one-statement program.
  1193. X.SH "SEE ALSO"
  1194. talk(1), stty(1), ioctl(2), tty(4)
  1195. END_OF_FILE
  1196. if test 729 -ne `wc -c <'exclon.1'`; then
  1197.     echo shar: \"'exclon.1'\" unpacked with wrong size!
  1198. fi
  1199. # end of 'exclon.1'
  1200. fi
  1201. if test -f 'exclon.c' -a "${1}" != "-c" ; then 
  1202.   echo shar: Will not clobber existing file \"'exclon.c'\"
  1203. else
  1204. echo shar: Extracting \"'exclon.c'\" \(110 characters\)
  1205. sed "s/^X//" >'exclon.c' <<'END_OF_FILE'
  1206. X/* Public domain. */
  1207. X#include <sys/ioctl.h>
  1208. X
  1209. main()
  1210. X{
  1211. X (void) ioctl(1,(unsigned long) TIOCEXCL,(char *) 0);
  1212. X}
  1213. END_OF_FILE
  1214. if test 110 -ne `wc -c <'exclon.c'`; then
  1215.     echo shar: \"'exclon.c'\" unpacked with wrong size!
  1216. fi
  1217. # end of 'exclon.c'
  1218. fi
  1219. if test -f 'fmt.h' -a "${1}" != "-c" ; then 
  1220.   echo shar: Will not clobber existing file \"'fmt.h'\"
  1221. else
  1222. echo shar: Extracting \"'fmt.h'\" \(769 characters\)
  1223. sed "s/^X//" >'fmt.h' <<'END_OF_FILE'
  1224. X#ifndef FMT_H
  1225. X#define FMT_H
  1226. X
  1227. X#define FMT_ULONG 39 /* enough space to hold 2^128 - 1 in decimal */
  1228. X#define FMT_LEN ((char *) 0) /* convenient abbreviation */
  1229. X
  1230. extern unsigned int fmt_uint();
  1231. extern unsigned int fmt_xint();
  1232. extern unsigned int fmt_nbbint();
  1233. extern unsigned int fmt_ushort();
  1234. extern unsigned int fmt_xshort();
  1235. extern unsigned int fmt_nbbshort();
  1236. extern unsigned int fmt_ulong();
  1237. extern unsigned int fmt_xlong();
  1238. extern unsigned int fmt_nbblong();
  1239. X
  1240. extern unsigned int fmt_plusminus();
  1241. extern unsigned int fmt_minus();
  1242. extern unsigned int fmt_0x();
  1243. X
  1244. extern unsigned int fmt_strncpy();
  1245. extern unsigned int fmt_memcpy();
  1246. extern unsigned int fmt_vis();
  1247. extern unsigned int fmt_nvis();
  1248. extern unsigned int fmt_rvis();
  1249. extern unsigned int fmt_unrvis();
  1250. X
  1251. X#endif
  1252. END_OF_FILE
  1253. if test 769 -ne `wc -c <'fmt.h'`; then
  1254.     echo shar: \"'fmt.h'\" unpacked with wrong size!
  1255. fi
  1256. # end of 'fmt.h'
  1257. fi
  1258. if test -f 'getopt.h' -a "${1}" != "-c" ; then 
  1259.   echo shar: Will not clobber existing file \"'getopt.h'\"
  1260. else
  1261. echo shar: Extracting \"'getopt.h'\" \(459 characters\)
  1262. sed "s/^X//" >'getopt.h' <<'END_OF_FILE'
  1263. X#ifndef GETOPT_H
  1264. X#define GETOPT_H
  1265. X
  1266. X#ifndef GETOPTORIGDEF
  1267. X#define getopt getoptmine
  1268. X#define optarg getoptarg
  1269. X#define optind getoptind
  1270. X#define opterr getopterr
  1271. X#define optpos getoptpos
  1272. X#define optproblem getoptproblem
  1273. X#define optprogname getoptprogname
  1274. X#define opteof getopteof
  1275. X#endif
  1276. X
  1277. extern int getopt();
  1278. extern char *optarg;
  1279. extern int optind;
  1280. extern int opterr;
  1281. extern int optpos;
  1282. extern int optproblem;
  1283. extern char *optprogname;
  1284. extern int opteof;
  1285. X
  1286. X#endif
  1287. END_OF_FILE
  1288. if test 459 -ne `wc -c <'getopt.h'`; then
  1289.     echo shar: \"'getopt.h'\" unpacked with wrong size!
  1290. fi
  1291. # end of 'getopt.h'
  1292. fi
  1293. if test -f 'getoptquiet.h' -a "${1}" != "-c" ; then 
  1294.   echo shar: Will not clobber existing file \"'getoptquiet.h'\"
  1295. else
  1296. echo shar: Extracting \"'getoptquiet.h'\" \(459 characters\)
  1297. sed "s/^X//" >'getoptquiet.h' <<'END_OF_FILE'
  1298. X#ifndef GETOPT_H
  1299. X#define GETOPT_H
  1300. X
  1301. X#ifndef GETOPTORIGDEF
  1302. X#define getopt getoptmine
  1303. X#define optarg getoptarg
  1304. X#define optind getoptind
  1305. X#define opterr getopterr
  1306. X#define optpos getoptpos
  1307. X#define optproblem getoptproblem
  1308. X#define optprogname getoptprogname
  1309. X#define opteof getopteof
  1310. X#endif
  1311. X
  1312. extern int getopt();
  1313. extern char *optarg;
  1314. extern int optind;
  1315. extern int opterr;
  1316. extern int optpos;
  1317. extern int optproblem;
  1318. extern char *optprogname;
  1319. extern int opteof;
  1320. X
  1321. X#endif
  1322. END_OF_FILE
  1323. if test 459 -ne `wc -c <'getoptquiet.h'`; then
  1324.     echo shar: \"'getoptquiet.h'\" unpacked with wrong size!
  1325. fi
  1326. # end of 'getoptquiet.h'
  1327. fi
  1328. if test -f 'lock.1' -a "${1}" != "-c" ; then 
  1329.   echo shar: Will not clobber existing file \"'lock.1'\"
  1330. else
  1331. echo shar: Extracting \"'lock.1'\" \(589 characters\)
  1332. sed "s/^X//" >'lock.1' <<'END_OF_FILE'
  1333. X.TH lock 1
  1334. X.SH NAME
  1335. lock \- reserve a terminal
  1336. X.SH SYNOPSIS
  1337. X.B lock
  1338. X.SH DESCRIPTION
  1339. X.B lock
  1340. requests a password from the user, reads it again for verification,
  1341. and then sits around doing nothing until the password is typed a third
  1342. time.
  1343. X.PP
  1344. This clone version of
  1345. X.B lock
  1346. corrects several of the original's failings, by being much simpler:
  1347. it doesn't accept
  1348. X.I hasta la vista;
  1349. it doesn't accept
  1350. the root password;
  1351. it doesn't time out;
  1352. and it does print a message for each bad password.
  1353. X.SH VERSION
  1354. lock version 2.0, 7/27/91.
  1355. X.SH AUTHOR
  1356. Placed into the public domain by Daniel J. Bernstein.
  1357. END_OF_FILE
  1358. if test 589 -ne `wc -c <'lock.1'`; then
  1359.     echo shar: \"'lock.1'\" unpacked with wrong size!
  1360. fi
  1361. # end of 'lock.1'
  1362. fi
  1363. if test -f 'mesg.1' -a "${1}" != "-c" ; then 
  1364.   echo shar: Will not clobber existing file \"'mesg.1'\"
  1365. else
  1366. echo shar: Extracting \"'mesg.1'\" \(805 characters\)
  1367. sed "s/^X//" >'mesg.1' <<'END_OF_FILE'
  1368. X.TH mesg 1
  1369. X.SH NAME
  1370. mesg \- permit or deny messages
  1371. X.SH SYNOPSIS
  1372. X.B mesg
  1373. X[
  1374. X.B n
  1375. X] [
  1376. X.B y
  1377. X]
  1378. X.SH DESCRIPTION
  1379. After
  1380. X.B mesg y,
  1381. other users can
  1382. use
  1383. X.B write(1)
  1384. or
  1385. X.B talk(1)
  1386. to send messages to your terminal.
  1387. X.B mesg n
  1388. turns this off.
  1389. X.B mesg
  1390. applies to your current terminal session;
  1391. typically you'd put a
  1392. X.B mesg y
  1393. into your
  1394. X.B \&.login,
  1395. X.B \&.cshrc,
  1396. or
  1397. X.B \&.profile.
  1398. X
  1399. X.B mesg
  1400. without an argument tells you your current
  1401. messaging status.
  1402. X
  1403. X.B mesg
  1404. requires its input to be your terminal session
  1405. X(or at least a session you own). All it really
  1406. does is handle the group-write bit on the terminal.
  1407. X
  1408. X.B mesg
  1409. only looks at the first letter of its first argument.
  1410. X.SH "EXIT VALUE"
  1411. Without an argument,
  1412. X.I mesg
  1413. exits with value 0 if messages are receivable,
  1414. X1 if not,
  1415. X2 upon error.
  1416. X.SH "SEE ALSO"
  1417. write(1), talk(1)
  1418. END_OF_FILE
  1419. if test 805 -ne `wc -c <'mesg.1'`; then
  1420.     echo shar: \"'mesg.1'\" unpacked with wrong size!
  1421. fi
  1422. # end of 'mesg.1'
  1423. fi
  1424. if test -f 'mesg.c' -a "${1}" != "-c" ; then 
  1425.   echo shar: Will not clobber existing file \"'mesg.c'\"
  1426. else
  1427. echo shar: Extracting \"'mesg.c'\" \(599 characters\)
  1428. sed "s/^X//" >'mesg.c' <<'END_OF_FILE'
  1429. X/* Public domain. */
  1430. X
  1431. X#include <sys/types.h>
  1432. X#include <sys/stat.h>
  1433. X#include <stdio.h>
  1434. X
  1435. X#define MESGBIT 0020
  1436. X
  1437. main(argc,argv)
  1438. int argc;
  1439. char *argv[];
  1440. X{
  1441. X struct stat st;
  1442. X
  1443. X if (fstat(0,&st) == -1)
  1444. X   exit(2); /* XXX */
  1445. X
  1446. X if (argc == 1)
  1447. X   if (st.st_mode & MESGBIT)
  1448. X     printf("is y\n");
  1449. X   else
  1450. X     printf("is n\n");
  1451. X else
  1452. X   switch(argv[1][0])
  1453. X    {
  1454. X     case 'y':
  1455. X       fchmod(0,(int) (st.st_mode | MESGBIT));
  1456. X       break;
  1457. X     case 'n':
  1458. X       fchmod(0,(int) (st.st_mode & ~MESGBIT));
  1459. X       break;
  1460. X     default:
  1461. X       fprintf(stderr,"usage: mesg [y] [n]\n");
  1462. X       exit(2);
  1463. X    }
  1464. X exit(0);
  1465. X}
  1466. END_OF_FILE
  1467. if test 599 -ne `wc -c <'mesg.c'`; then
  1468.     echo shar: \"'mesg.c'\" unpacked with wrong size!
  1469. fi
  1470. # end of 'mesg.c'
  1471. fi
  1472. if test -f 'nobuf.sh' -a "${1}" != "-c" ; then 
  1473.   echo shar: Will not clobber existing file \"'nobuf.sh'\"
  1474. else
  1475. echo shar: Extracting \"'nobuf.sh'\" \(44 characters\)
  1476. sed "s/^X//" >'nobuf.sh' <<'END_OF_FILE'
  1477. X#!/bin/sh
  1478. ctrlv | pty -0dpCR8 -xf ${1+"$@"}
  1479. END_OF_FILE
  1480. if test 44 -ne `wc -c <'nobuf.sh'`; then
  1481.     echo shar: \"'nobuf.sh'\" unpacked with wrong size!
  1482. fi
  1483. # end of 'nobuf.sh'
  1484. fi
  1485. if test -f 'ptycomm.h' -a "${1}" != "-c" ; then 
  1486.   echo shar: Will not clobber existing file \"'ptycomm.h'\"
  1487. else
  1488. echo shar: Extracting \"'ptycomm.h'\" \(198 characters\)
  1489. sed "s/^X//" >'ptycomm.h' <<'END_OF_FILE'
  1490. X#ifndef PTY_COMM_H
  1491. X#define PTY_COMM_H
  1492. X
  1493. extern int comm_unlink();
  1494. extern int comm_read();
  1495. extern int comm_accept();
  1496. extern int comm_write();
  1497. extern int comm_putfd();
  1498. extern int comm_getfd();
  1499. X
  1500. X#endif
  1501. END_OF_FILE
  1502. if test 198 -ne `wc -c <'ptycomm.h'`; then
  1503.     echo shar: \"'ptycomm.h'\" unpacked with wrong size!
  1504. fi
  1505. # end of 'ptycomm.h'
  1506. fi
  1507. if test -f 'ptyerr.h' -a "${1}" != "-c" ; then 
  1508.   echo shar: Will not clobber existing file \"'ptyerr.h'\"
  1509. else
  1510. echo shar: Extracting \"'ptyerr.h'\" \(408 characters\)
  1511. sed "s/^X//" >'ptyerr.h' <<'END_OF_FILE'
  1512. X#ifndef PTY_ERR_H
  1513. X#define PTY_ERR_H
  1514. X
  1515. extern void die();
  1516. extern void warn();
  1517. extern void warn_disable();
  1518. extern void info();
  1519. X
  1520. X#define DIE_USAGE 1
  1521. X#define DIE_NOCTTY 2
  1522. X#define DIE_GETMODES 3
  1523. X#define DIE_SETMODES 4
  1524. X#define DIE_NOPTYS 5
  1525. X#define DIE_SETUP 6
  1526. X#define DIE_FORK 7
  1527. X#define DIE_PTYDIR 8
  1528. X#define DIE_NOMEM 9
  1529. X#define DIE_IMPOSSIBLE 10
  1530. X#define DIE_COMM 11
  1531. X#define DIE_ELSE 16
  1532. X#define DIE_EXIST 17
  1533. X
  1534. X#endif
  1535. END_OF_FILE
  1536. if test 408 -ne `wc -c <'ptyerr.h'`; then
  1537.     echo shar: \"'ptyerr.h'\" unpacked with wrong size!
  1538. fi
  1539. # end of 'ptyerr.h'
  1540. fi
  1541. if test -f 'ptyget.h' -a "${1}" != "-c" ; then 
  1542.   echo shar: Will not clobber existing file \"'ptyget.h'\"
  1543. else
  1544. echo shar: Extracting \"'ptyget.h'\" \(99 characters\)
  1545. sed "s/^X//" >'ptyget.h' <<'END_OF_FILE'
  1546. X#ifndef PTY_GETPTY_H
  1547. X#define PTY_GETPTY_H
  1548. X
  1549. extern int getfreepty();
  1550. extern int ungetpty();
  1551. X
  1552. X#endif
  1553. END_OF_FILE
  1554. if test 99 -ne `wc -c <'ptyget.h'`; then
  1555.     echo shar: \"'ptyget.h'\" unpacked with wrong size!
  1556. fi
  1557. # end of 'ptyget.h'
  1558. fi
  1559. if test -f 'ptylogs.h' -a "${1}" != "-c" ; then 
  1560.   echo shar: Will not clobber existing file \"'ptylogs.h'\"
  1561. else
  1562. echo shar: Extracting \"'ptylogs.h'\" \(137 characters\)
  1563. sed "s/^X//" >'ptylogs.h' <<'END_OF_FILE'
  1564. X#ifndef PTY_LOGS_H
  1565. X#define PTY_LOGS_H
  1566. X
  1567. extern int utmp_on();
  1568. extern int utmp_off();
  1569. extern int wtmp_on();
  1570. extern int wtmp_off();
  1571. X
  1572. X#endif
  1573. END_OF_FILE
  1574. if test 137 -ne `wc -c <'ptylogs.h'`; then
  1575.     echo shar: \"'ptylogs.h'\" unpacked with wrong size!
  1576. fi
  1577. # end of 'ptylogs.h'
  1578. fi
  1579. if test -f 'ptymaster.h' -a "${1}" != "-c" ; then 
  1580.   echo shar: Will not clobber existing file \"'ptymaster.h'\"
  1581. else
  1582. echo shar: Extracting \"'ptymaster.h'\" \(73 characters\)
  1583. sed "s/^X//" >'ptymaster.h' <<'END_OF_FILE'
  1584. X#ifndef PTY_MASTER_H
  1585. X#define PTY_MASTER_H
  1586. X
  1587. extern void master();
  1588. X
  1589. X#endif
  1590. END_OF_FILE
  1591. if test 73 -ne `wc -c <'ptymaster.h'`; then
  1592.     echo shar: \"'ptymaster.h'\" unpacked with wrong size!
  1593. fi
  1594. # end of 'ptymaster.h'
  1595. fi
  1596. if test -f 'ptymisc.h' -a "${1}" != "-c" ; then 
  1597.   echo shar: Will not clobber existing file \"'ptymisc.h'\"
  1598. else
  1599. echo shar: Extracting \"'ptymisc.h'\" \(271 characters\)
  1600. sed "s/^X//" >'ptymisc.h' <<'END_OF_FILE'
  1601. X#ifndef PTY_MISC_H
  1602. X#define PTY_MISC_H
  1603. X
  1604. extern long now();
  1605. extern int gaargh();
  1606. extern int forceopen();
  1607. extern int respeq();
  1608. extern int bread();
  1609. extern int bwrite();
  1610. extern int lflock();
  1611. extern int lfunlock();
  1612. extern int setnonblock();
  1613. extern int unsetnonblock();
  1614. X
  1615. X#endif
  1616. END_OF_FILE
  1617. if test 271 -ne `wc -c <'ptymisc.h'`; then
  1618.     echo shar: \"'ptymisc.h'\" unpacked with wrong size!
  1619. fi
  1620. # end of 'ptymisc.h'
  1621. fi
  1622. if test -f 'ptysecure.h' -a "${1}" != "-c" ; then 
  1623.   echo shar: Will not clobber existing file \"'ptysecure.h'\"
  1624. else
  1625. echo shar: Extracting \"'ptysecure.h'\" \(101 characters\)
  1626. sed "s/^X//" >'ptysecure.h' <<'END_OF_FILE'
  1627. X#ifndef PTY_SECURE_H
  1628. X#define PTY_SECURE_H
  1629. X
  1630. extern int ptysecure();
  1631. extern int ptyunsecure();
  1632. X
  1633. X#endif
  1634. END_OF_FILE
  1635. if test 101 -ne `wc -c <'ptysecure.h'`; then
  1636.     echo shar: \"'ptysecure.h'\" unpacked with wrong size!
  1637. fi
  1638. # end of 'ptysecure.h'
  1639. fi
  1640. if test -f 'ptysigler.h' -a "${1}" != "-c" ; then 
  1641.   echo shar: Will not clobber existing file \"'ptysigler.h'\"
  1642. else
  1643. echo shar: Extracting \"'ptysigler.h'\" \(73 characters\)
  1644. sed "s/^X//" >'ptysigler.h' <<'END_OF_FILE'
  1645. X#ifndef PTY_SIGLER_H
  1646. X#define PTY_SIGLER_H
  1647. X
  1648. extern void sigler();
  1649. X
  1650. X#endif
  1651. END_OF_FILE
  1652. if test 73 -ne `wc -c <'ptysigler.h'`; then
  1653.     echo shar: \"'ptysigler.h'\" unpacked with wrong size!
  1654. fi
  1655. # end of 'ptysigler.h'
  1656. fi
  1657. if test -f 'ptyslave.h' -a "${1}" != "-c" ; then 
  1658.   echo shar: Will not clobber existing file \"'ptyslave.h'\"
  1659. else
  1660. echo shar: Extracting \"'ptyslave.h'\" \(70 characters\)
  1661. sed "s/^X//" >'ptyslave.h' <<'END_OF_FILE'
  1662. X#ifndef PTY_SLAVE_H
  1663. X#define PTY_SLAVE_H
  1664. X
  1665. extern void slave();
  1666. X
  1667. X#endif
  1668. END_OF_FILE
  1669. if test 70 -ne `wc -c <'ptyslave.h'`; then
  1670.     echo shar: \"'ptyslave.h'\" unpacked with wrong size!
  1671. fi
  1672. # end of 'ptyslave.h'
  1673. fi
  1674. if test -f 'ptytexts.h' -a "${1}" != "-c" ; then 
  1675.   echo shar: Will not clobber existing file \"'ptytexts.h'\"
  1676. else
  1677. echo shar: Extracting \"'ptytexts.h'\" \(196 characters\)
  1678. sed "s/^X//" >'ptytexts.h' <<'END_OF_FILE'
  1679. X#ifndef PTY_TEXTS_H
  1680. X#define PTY_TEXTS_H
  1681. X
  1682. extern char *ptyauthor;
  1683. extern char *ptyversion;
  1684. extern char *ptycopyright;
  1685. extern char *ptywarranty;
  1686. extern char *ptyusage;
  1687. extern char *ptyhelp;
  1688. X
  1689. X#endif
  1690. END_OF_FILE
  1691. if test 196 -ne `wc -c <'ptytexts.h'`; then
  1692.     echo shar: \"'ptytexts.h'\" unpacked with wrong size!
  1693. fi
  1694. # end of 'ptytexts.h'
  1695. fi
  1696. if test -f 'radixsort.h' -a "${1}" != "-c" ; then 
  1697.   echo shar: Will not clobber existing file \"'radixsort.h'\"
  1698. else
  1699. echo shar: Extracting \"'radixsort.h'\" \(174 characters\)
  1700. sed "s/^X//" >'radixsort.h' <<'END_OF_FILE'
  1701. X#ifndef RADIXSORT_H
  1702. X#define RADIXSORT_H
  1703. X
  1704. extern int radixsort3();
  1705. extern int radixsort4();
  1706. extern int radixsort5();
  1707. extern int radixsort7();
  1708. X
  1709. extern int radixsort();
  1710. X
  1711. X#endif
  1712. END_OF_FILE
  1713. if test 174 -ne `wc -c <'radixsort.h'`; then
  1714.     echo shar: \"'radixsort.h'\" unpacked with wrong size!
  1715. fi
  1716. # end of 'radixsort.h'
  1717. fi
  1718. if test -f 'ralloc.h' -a "${1}" != "-c" ; then 
  1719.   echo shar: Will not clobber existing file \"'ralloc.h'\"
  1720. else
  1721. echo shar: Extracting \"'ralloc.h'\" \(257 characters\)
  1722. sed "s/^X//" >'ralloc.h' <<'END_OF_FILE'
  1723. X#ifndef RALLOC_H
  1724. X#define RALLOC_H
  1725. X
  1726. extern char *ralloc();
  1727. extern void rfree();
  1728. extern int rcount();
  1729. extern int rallocinstall();
  1730. extern void rallocneverfail();
  1731. X
  1732. X#define RFREE(x) rfree((char *) (x))
  1733. X#define RALLOC(t,x) ((t *) ralloc((x) * sizeof(t)))
  1734. X
  1735. X#endif
  1736. END_OF_FILE
  1737. if test 257 -ne `wc -c <'ralloc.h'`; then
  1738.     echo shar: \"'ralloc.h'\" unpacked with wrong size!
  1739. fi
  1740. # end of 'ralloc.h'
  1741. fi
  1742. if test -f 'scan.h' -a "${1}" != "-c" ; then 
  1743.   echo shar: Will not clobber existing file \"'scan.h'\"
  1744. else
  1745. echo shar: Extracting \"'scan.h'\" \(732 characters\)
  1746. sed "s/^X//" >'scan.h' <<'END_OF_FILE'
  1747. X#ifndef SCAN_H
  1748. X#define SCAN_H
  1749. X
  1750. extern unsigned int scan_uint();
  1751. extern unsigned int scan_xint();
  1752. extern unsigned int scan_nbbint();
  1753. extern unsigned int scan_ushort();
  1754. extern unsigned int scan_xshort();
  1755. extern unsigned int scan_nbbshort();
  1756. extern unsigned int scan_ulong();
  1757. extern unsigned int scan_xlong();
  1758. extern unsigned int scan_nbblong();
  1759. X
  1760. extern unsigned int scan_plusminus();
  1761. extern unsigned int scan_0x();
  1762. X
  1763. extern unsigned int scan_whitenskip();
  1764. extern unsigned int scan_nonwhitenskip();
  1765. extern unsigned int scan_charsetnskip();
  1766. extern unsigned int scan_noncharsetnskip();
  1767. X/* XXX: these aren't unique in the first 8 characters. i don't care. */
  1768. X
  1769. extern unsigned int scan_strncmp();
  1770. extern unsigned int scan_memcmp();
  1771. X
  1772. X#endif
  1773. END_OF_FILE
  1774. if test 732 -ne `wc -c <'scan.h'`; then
  1775.     echo shar: \"'scan.h'\" unpacked with wrong size!
  1776. fi
  1777. # end of 'scan.h'
  1778. fi
  1779. if test -f 'sclogrotate.sh' -a "${1}" != "-c" ; then 
  1780.   echo shar: Will not clobber existing file \"'sclogrotate.sh'\"
  1781. else
  1782. echo shar: Extracting \"'sclogrotate.sh'\" \(634 characters\)
  1783. sed "s/^X//" >'sclogrotate.sh' <<'END_OF_FILE'
  1784. WARNING: Do not change this file without changing Makefile accordingly!
  1785. X#include "config/sessconnfile.h"
  1786. XX!/bin/sh
  1787. XX if you want to save SESSCONNLOG_FILE.7, do it now!
  1788. mv SESSCONNLOG_FILE.6 SESSCONNLOG_FILE.7
  1789. mv SESSCONNLOG_FILE.5 SESSCONNLOG_FILE.6
  1790. mv SESSCONNLOG_FILE.4 SESSCONNLOG_FILE.5
  1791. mv SESSCONNLOG_FILE.3 SESSCONNLOG_FILE.4
  1792. mv SESSCONNLOG_FILE.2 SESSCONNLOG_FILE.3
  1793. mv SESSCONNLOG_FILE.1 SESSCONNLOG_FILE.2
  1794. mv SESSCONNLOG_FILE.0 SESSCONNLOG_FILE.1
  1795. ln SESSCONNLOG_FILE SESSCONNLOG_FILE.0
  1796. cp SESSCONNLOG_FILE SESSCONNLOG_FILE.new; : > SESSCONNLOG_FILE.new
  1797. chmod 644 SESSCONNLOG_FILE.new; mv SESSCONNLOG_FILE.new SESSCONNLOG_FILE
  1798. END_OF_FILE
  1799. if test 634 -ne `wc -c <'sclogrotate.sh'`; then
  1800.     echo shar: \"'sclogrotate.sh'\" unpacked with wrong size!
  1801. fi
  1802. # end of 'sclogrotate.sh'
  1803. fi
  1804. if test -f 'scnowinit.sh' -a "${1}" != "-c" ; then 
  1805.   echo shar: Will not clobber existing file \"'scnowinit.sh'\"
  1806. else
  1807. echo shar: Extracting \"'scnowinit.sh'\" \(164 characters\)
  1808. sed "s/^X//" >'scnowinit.sh' <<'END_OF_FILE'
  1809. WARNING: Do not change this file without changing Makefile accordingly!
  1810. X#include "config/sessconnfile.h"
  1811. XX!/bin/sh
  1812. X: > SESSCONNNOW_FILE; chmod 644 SESSCONNNOW_FILE
  1813. END_OF_FILE
  1814. if test 164 -ne `wc -c <'scnowinit.sh'`; then
  1815.     echo shar: \"'scnowinit.sh'\" unpacked with wrong size!
  1816. fi
  1817. # end of 'scnowinit.sh'
  1818. fi
  1819. if test -f 'script.sh' -a "${1}" != "-c" ; then 
  1820.   echo shar: Will not clobber existing file \"'script.sh'\"
  1821. else
  1822. echo shar: Extracting \"'script.sh'\" \(281 characters\)
  1823. sed "s/^X//" >'script.sh' <<'END_OF_FILE'
  1824. X#!/bin/sh
  1825. X# XXX: propagate stops!
  1826. X# Public domain.
  1827. case "$@" in
  1828. X"") set typescript ${1+"$@"} ;;
  1829. X"-a") set typescript ${1+"$@"} ;;
  1830. esac
  1831. echo "Script started, teeing $@"
  1832. X{ echo 'Script started on '`date`;
  1833. X  pty -s "${SHELL-/bin/sh}";
  1834. X  echo 'Script done on '`date`
  1835. X} | tee ${1+"$@"}
  1836. END_OF_FILE
  1837. if test 281 -ne `wc -c <'script.sh'`; then
  1838.     echo shar: \"'script.sh'\" unpacked with wrong size!
  1839. fi
  1840. # end of 'script.sh'
  1841. fi
  1842. if test -f 'script.tidy.1' -a "${1}" != "-c" ; then 
  1843.   echo shar: Will not clobber existing file \"'script.tidy.1'\"
  1844. else
  1845. echo shar: Extracting \"'script.tidy.1'\" \(318 characters\)
  1846. sed "s/^X//" >'script.tidy.1' <<'END_OF_FILE'
  1847. X.TH script.tidy 1
  1848. X.SH NAME
  1849. script.tidy \- remove extra carriage returns and backspaces
  1850. X.SH SYNOPSIS
  1851. X.B script.tidy
  1852. X.SH DESCRIPTION
  1853. This filter
  1854. does a bit of postprocessing,
  1855. typically on a typescript produced by
  1856. X.B script.
  1857. It removes extra carriage returns
  1858. and wipes out backspaced characters.
  1859. X.SH "SEE ALSO"
  1860. script(1)
  1861. END_OF_FILE
  1862. if test 318 -ne `wc -c <'script.tidy.1'`; then
  1863.     echo shar: \"'script.tidy.1'\" unpacked with wrong size!
  1864. fi
  1865. # end of 'script.tidy.1'
  1866. fi
  1867. if test -f 'script.tidy.sh' -a "${1}" != "-c" ; then 
  1868.   echo shar: Will not clobber existing file \"'script.tidy.sh'\"
  1869. else
  1870. echo shar: Extracting \"'script.tidy.sh'\" \(62 characters\)
  1871. sed "s/^X//" >'script.tidy.sh' <<'END_OF_FILE'
  1872. X#!/bin/sh
  1873. X# Public domain.
  1874. exec sed 's/3$//
  1875. X:x
  1876. s/[^8]8//
  1877. t x'
  1878. END_OF_FILE
  1879. if test 62 -ne `wc -c <'script.tidy.sh'`; then
  1880.     echo shar: \"'script.tidy.sh'\" unpacked with wrong size!
  1881. fi
  1882. # end of 'script.tidy.sh'
  1883. fi
  1884. if test -f 'sess.sh' -a "${1}" != "-c" ; then 
  1885.   echo shar: Will not clobber existing file \"'sess.sh'\"
  1886. else
  1887. echo shar: Extracting \"'sess.sh'\" \(44 characters\)
  1888. sed "s/^X//" >'sess.sh' <<'END_OF_FILE'
  1889. X#!/bin/sh
  1890. X# Public domain.
  1891. exec pty -s "$@"
  1892. END_OF_FILE
  1893. if test 44 -ne `wc -c <'sess.sh'`; then
  1894.     echo shar: \"'sess.sh'\" unpacked with wrong size!
  1895. fi
  1896. # end of 'sess.sh'
  1897. fi
  1898. if test -f 'sessconnlog.h' -a "${1}" != "-c" ; then 
  1899.   echo shar: Will not clobber existing file \"'sessconnlog.h'\"
  1900. else
  1901. echo shar: Extracting \"'sessconnlog.h'\" \(451 characters\)
  1902. sed "s/^X//" >'sessconnlog.h' <<'END_OF_FILE'
  1903. X#ifndef SESSCONNLOG_H
  1904. X#define SESSCONNLOG_H
  1905. X
  1906. X#define SESSCONNLOG_EXTLEN 4
  1907. X#define SESSCONNLOG_REMOTELEN 116 /* reasonable for the moment... */
  1908. X
  1909. struct sessconnlog
  1910. X {
  1911. X  char ext[SESSCONNLOG_EXTLEN];
  1912. X  long date;
  1913. X  int siglerpid; /* 0 for unused---currently inaccurate otherwise */
  1914. X  char remote[SESSCONNLOG_REMOTELEN]; /* always 0-terminated */
  1915. X }
  1916. X;
  1917. X
  1918. extern int sessconnlog();
  1919. extern void sessconnlog_fill();
  1920. extern void sessconnlog_disable();
  1921. X
  1922. X#endif
  1923. END_OF_FILE
  1924. if test 451 -ne `wc -c <'sessconnlog.h'`; then
  1925.     echo shar: \"'sessconnlog.h'\" unpacked with wrong size!
  1926. fi
  1927. # end of 'sessconnlog.h'
  1928. fi
  1929. if test -f 'sesslist.1' -a "${1}" != "-c" ; then 
  1930.   echo shar: Will not clobber existing file \"'sesslist.1'\"
  1931. else
  1932. echo shar: Extracting \"'sesslist.1'\" \(611 characters\)
  1933. sed "s/^X//" >'sesslist.1' <<'END_OF_FILE'
  1934. X.TH sesslist 1
  1935. X.SH NAME
  1936. sesslist \- list all pty sessions you own
  1937. X.SH SYNOPSIS
  1938. X.B sesslist
  1939. X[
  1940. X.B\-0
  1941. X]
  1942. X.SH DESCRIPTION
  1943. X.B sesslist
  1944. lists on its standard output
  1945. all
  1946. X.B pty
  1947. sessions owned by the current user id.
  1948. Given
  1949. X.B\-0,
  1950. X.B sesslist
  1951. will separate output lines by null instead of newline.
  1952. X
  1953. The output format is meant for human consumption
  1954. and is not completely defined.
  1955. It is not compatible with previous versions of
  1956. X.B sesslist
  1957. and may change in future versions.
  1958. X
  1959. This version of
  1960. X.B sesslist
  1961. includes non-sessions
  1962. started by
  1963. X.B pty.
  1964. X.SH DIAGNOSTICS
  1965. Self-explanatory.
  1966. X.SH "SEE ALSO"
  1967. pty(1),
  1968. sess(1),
  1969. sessname(1)
  1970. END_OF_FILE
  1971. if test 611 -ne `wc -c <'sesslist.1'`; then
  1972.     echo shar: \"'sesslist.1'\" unpacked with wrong size!
  1973. fi
  1974. # end of 'sesslist.1'
  1975. fi
  1976. if test -f 'sesslog.h' -a "${1}" != "-c" ; then 
  1977.   echo shar: Will not clobber existing file \"'sesslog.h'\"
  1978. else
  1979. echo shar: Extracting \"'sesslog.h'\" \(373 characters\)
  1980. sed "s/^X//" >'sesslog.h' <<'END_OF_FILE'
  1981. X#ifndef SESSLOG_H
  1982. X#define SESSLOG_H
  1983. X
  1984. X#define SESSLOG_EXTLEN 4
  1985. X#define SESSLOG_USERLEN 16 /* no harm in planning for the future */
  1986. X
  1987. struct sesslog
  1988. X {
  1989. X  char ext[SESSLOG_EXTLEN];
  1990. X  char username[SESSLOG_USERLEN];
  1991. X  int uid;
  1992. X  int masterpid; /* 0 if it's an ending */
  1993. X  long date;
  1994. X }
  1995. X;
  1996. X
  1997. extern int sesslog();
  1998. extern void sesslog_fill();
  1999. extern void sesslog_disable();
  2000. X
  2001. X#endif
  2002. END_OF_FILE
  2003. if test 373 -ne `wc -c <'sesslog.h'`; then
  2004.     echo shar: \"'sesslog.h'\" unpacked with wrong size!
  2005. fi
  2006. # end of 'sesslog.h'
  2007. fi
  2008. if test -f 'sessmenu.1' -a "${1}" != "-c" ; then 
  2009.   echo shar: Will not clobber existing file \"'sessmenu.1'\"
  2010. else
  2011. echo shar: Extracting \"'sessmenu.1'\" \(649 characters\)
  2012. sed "s/^X//" >'sessmenu.1' <<'END_OF_FILE'
  2013. X.TH sessmenu 1
  2014. X.SH NAME
  2015. sessmenu \- give a menu of disconnected sessions
  2016. X.SH SYNOPSIS
  2017. X.B sessmenu
  2018. X.I program
  2019. X[
  2020. X.I arg ...
  2021. X]
  2022. X.SH DESCRIPTION
  2023. Normally
  2024. X.B sessmenu
  2025. runs
  2026. X.I program
  2027. with the given arguments
  2028. under a
  2029. X.B pty
  2030. session.
  2031. However, if you have one or more disconnected sessions,
  2032. X.B sessmenu
  2033. lists them and shows what processes they have running.
  2034. To reconnect to one of the sessions, type its name.
  2035. Otherwise press return
  2036. and
  2037. X.B sessmenu
  2038. will start a new session as usual.
  2039. X
  2040. X.B sessmenu
  2041. expects to be run from a network connection,
  2042. on a tty in character mode,
  2043. or on some raw device.
  2044. It does all its own echoing.
  2045. X.SH "SEE ALSO"
  2046. sess(1),
  2047. sesslist(1)
  2048. END_OF_FILE
  2049. if test 649 -ne `wc -c <'sessmenu.1'`; then
  2050.     echo shar: \"'sessmenu.1'\" unpacked with wrong size!
  2051. fi
  2052. # end of 'sessmenu.1'
  2053. fi
  2054. if test -f 'sessname.1' -a "${1}" != "-c" ; then 
  2055.   echo shar: Will not clobber existing file \"'sessname.1'\"
  2056. else
  2057. echo shar: Extracting \"'sessname.1'\" \(720 characters\)
  2058. sed "s/^X//" >'sessname.1' <<'END_OF_FILE'
  2059. X.TH sessname 1
  2060. X.SH NAME
  2061. sessname \- provide a more descriptive name for the current pty session
  2062. X.SH SYNOPSIS
  2063. X.B sessname
  2064. X[
  2065. X.B\-s\fIext
  2066. X] [
  2067. X.I name
  2068. X]
  2069. X.SH DESCRIPTION
  2070. X.B sessname
  2071. adds
  2072. X.I name
  2073. to the information listed by
  2074. X.B sesslist
  2075. for the current
  2076. X.B pty
  2077. session.
  2078. X
  2079. X.I name
  2080. is in addition to the
  2081. base name of the session,
  2082. which is the last two characters of the
  2083. pseudo-terminal filename.
  2084. X
  2085. Without an argument,
  2086. X.B sessname
  2087. prints the name of the current session.
  2088. X
  2089. Normally
  2090. X.B sessname
  2091. uses the session specified by environment variable PTY.
  2092. Given
  2093. X.B\-s,
  2094. it will use session
  2095. X.I ext
  2096. instead.
  2097. X.SH DIAGNOSTICS
  2098. Self-explanatory.
  2099. X.SH RESTRICTIONS
  2100. X.I name
  2101. is limited to 100 characters.
  2102. X.SH "SEE ALSO"
  2103. pty(1),
  2104. sess(1),
  2105. sesslist(1)
  2106. END_OF_FILE
  2107. if test 720 -ne `wc -c <'sessname.1'`; then
  2108.     echo shar: \"'sessname.1'\" unpacked with wrong size!
  2109. fi
  2110. # end of 'sessname.1'
  2111. fi
  2112. if test -f 'sessnowinit.sh' -a "${1}" != "-c" ; then 
  2113.   echo shar: Will not clobber existing file \"'sessnowinit.sh'\"
  2114. else
  2115. echo shar: Extracting \"'sessnowinit.sh'\" \(152 characters\)
  2116. sed "s/^X//" >'sessnowinit.sh' <<'END_OF_FILE'
  2117. WARNING: Do not change this file without changing Makefile accordingly!
  2118. X#include "config/sessfile.h"
  2119. XX!/bin/sh
  2120. X: > SESSNOW_FILE; chmod 644 SESSNOW_FILE
  2121. END_OF_FILE
  2122. if test 152 -ne `wc -c <'sessnowinit.sh'`; then
  2123.     echo shar: \"'sessnowinit.sh'\" unpacked with wrong size!
  2124. fi
  2125. # end of 'sessnowinit.sh'
  2126. fi
  2127. if test -f 'sessrotate.sh' -a "${1}" != "-c" ; then 
  2128.   echo shar: Will not clobber existing file \"'sessrotate.sh'\"
  2129. else
  2130. echo shar: Extracting \"'sessrotate.sh'\" \(538 characters\)
  2131. sed "s/^X//" >'sessrotate.sh' <<'END_OF_FILE'
  2132. WARNING: Do not change this file without changing Makefile accordingly!
  2133. X#include "config/sessfile.h"
  2134. XX!/bin/sh
  2135. XX if you want to save SESSLOG_FILE.7, do it now!
  2136. mv SESSLOG_FILE.6 SESSLOG_FILE.7
  2137. mv SESSLOG_FILE.5 SESSLOG_FILE.6
  2138. mv SESSLOG_FILE.4 SESSLOG_FILE.5
  2139. mv SESSLOG_FILE.3 SESSLOG_FILE.4
  2140. mv SESSLOG_FILE.2 SESSLOG_FILE.3
  2141. mv SESSLOG_FILE.1 SESSLOG_FILE.2
  2142. mv SESSLOG_FILE.0 SESSLOG_FILE.1
  2143. ln SESSLOG_FILE SESSLOG_FILE.0
  2144. cp SESSLOG_FILE SESSLOG_FILE.new; : > SESSLOG_FILE.new
  2145. chmod 644 SESSLOG_FILE.new; mv SESSLOG_FILE.new SESSLOG_FILE
  2146. END_OF_FILE
  2147. if test 538 -ne `wc -c <'sessrotate.sh'`; then
  2148.     echo shar: \"'sessrotate.sh'\" unpacked with wrong size!
  2149. fi
  2150. # end of 'sessrotate.sh'
  2151. fi
  2152. if test -f 'sigdfl.h' -a "${1}" != "-c" ; then 
  2153.   echo shar: Will not clobber existing file \"'sigdfl.h'\"
  2154. else
  2155. echo shar: Extracting \"'sigdfl.h'\" \(234 characters\)
  2156. sed "s/^X//" >'sigdfl.h' <<'END_OF_FILE'
  2157. X#ifndef SIGDFL_H
  2158. X#define SIGDFL_H
  2159. X
  2160. extern int sigdfl();
  2161. X
  2162. extern int sigdfl_tstp();
  2163. extern int sigdfl_stop();
  2164. extern int sigdfl_ttin();
  2165. extern int sigdfl_ttou();
  2166. X
  2167. extern int sigdfl_abrt(); /* professional version of abort() */
  2168. X
  2169. X#endif
  2170. END_OF_FILE
  2171. if test 234 -ne `wc -c <'sigdfl.h'`; then
  2172.     echo shar: \"'sigdfl.h'\" unpacked with wrong size!
  2173. fi
  2174. # end of 'sigdfl.h'
  2175. fi
  2176. if test -f 'sigsched.h' -a "${1}" != "-c" ; then 
  2177.   echo shar: Will not clobber existing file \"'sigsched.h'\"
  2178. else
  2179. echo shar: Extracting \"'sigsched.h'\" \(732 characters\)
  2180. sed "s/^X//" >'sigsched.h' <<'END_OF_FILE'
  2181. X#ifndef SIGSCHED_H
  2182. X#define SIGSCHED_H
  2183. X
  2184. typedef struct
  2185. X {
  2186. X  int type;
  2187. X  union { int n; char *c; } u;
  2188. X }
  2189. ss_sig;
  2190. X
  2191. typedef struct
  2192. X {
  2193. X  int (*sched)();
  2194. X  int (*unsched)();
  2195. X  union { int n; char *c; } u;
  2196. X }
  2197. ss_extern;
  2198. X
  2199. typedef void ss_thread();
  2200. typedef int ss_id;
  2201. typedef char *ss_idptr;
  2202. X
  2203. extern ss_sig *ss_asap();
  2204. extern ss_sig *ss_signal();
  2205. extern ss_sig *ss_sigread();
  2206. extern ss_sig *ss_sigwrite();
  2207. extern ss_sig *ss_sigexcept();
  2208. X
  2209. extern int ss_addsig();
  2210. X
  2211. extern void ss_externsetsig();
  2212. X
  2213. extern int ss_schedvwait();
  2214. extern int ss_schedwait();
  2215. extern int ss_sched();
  2216. extern int ss_schedonce();
  2217. extern int ss_unschedv();
  2218. extern int ss_unsched();
  2219. X
  2220. extern void ss_forcewait();
  2221. extern void ss_unforcewait();
  2222. X
  2223. extern int ss_exec();
  2224. X
  2225. X#endif
  2226. END_OF_FILE
  2227. if test 732 -ne `wc -c <'sigsched.h'`; then
  2228.     echo shar: \"'sigsched.h'\" unpacked with wrong size!
  2229. fi
  2230. # end of 'sigsched.h'
  2231. fi
  2232. if test -f 'sod.h' -a "${1}" != "-c" ; then 
  2233.   echo shar: Will not clobber existing file \"'sod.h'\"
  2234. else
  2235. echo shar: Extracting \"'sod.h'\" \(508 characters\)
  2236. sed "s/^X//" >'sod.h' <<'END_OF_FILE'
  2237. X#ifndef SOD_H
  2238. X#define SOD_H
  2239. X
  2240. X/* a half-hearted attempt at a generic stack library */
  2241. X
  2242. X#define SODdecl(foostack,foo) \
  2243. typedef struct foostack { struct foostack *next; foo data; } *foostack
  2244. X  /* note that user must supply semicolon */
  2245. X
  2246. X#define SODnext(x) ((x)->next)
  2247. X#define SODdata(x) ((x)->data)
  2248. X#define SODalloc(t,x,ralloc) ((t) ((ralloc)(sizeof(*x))))
  2249. X#define SODpush(x,y) ((y)->next = (x),(x) = (y))
  2250. X#define SODpop(x,y) ((y) = (x),(x) = (x)->next)
  2251. X#define SODfree(u,rfree) ((rfree)((char *)(u)))
  2252. X
  2253. X#endif
  2254. END_OF_FILE
  2255. if test 508 -ne `wc -c <'sod.h'`; then
  2256.     echo shar: \"'sod.h'\" unpacked with wrong size!
  2257. fi
  2258. # end of 'sod.h'
  2259. fi
  2260. if test -f 'talkacros.7' -a "${1}" != "-c" ; then 
  2261.   echo shar: Will not clobber existing file \"'talkacros.7'\"
  2262. else
  2263. echo shar: Extracting \"'talkacros.7'\" \(712 characters\)
  2264. sed "s/^X//" >'talkacros.7' <<'END_OF_FILE'
  2265. X.TH talkacros 7
  2266. X.SH NAME
  2267. talkacros \- some acronyms commonly used in screen conversation
  2268. X.SH DESCRIPTION
  2269. Many abbreviations are commonly used between people engaged in
  2270. low-delay typed conversations.
  2271. Here are a few of them:
  2272. X.TP 5
  2273. jam
  2274. Just a minute.
  2275. X.TP
  2276. X\:-)
  2277. Smiley-face.
  2278. X(Look at it sideways.)
  2279. This can mean anything
  2280. from a grin to a grimace,
  2281. depending on the context.
  2282. X.TP
  2283. X\:-(
  2284. XFrown.
  2285. X.TP
  2286. t
  2287. True (from LISP).
  2288. X.TP
  2289. ayt
  2290. Are you there?
  2291. X(An answer of no
  2292. means that the other person is
  2293. busy with something else.)
  2294. X.TP
  2295. ga
  2296. Go ahead.
  2297. X.TP
  2298. tyl
  2299. Talk to you later.
  2300. X.TP
  2301. oo
  2302. Over and out.
  2303. X.PP
  2304. X.SH BUGS
  2305. The author's biases have almost completely determined
  2306. the selection of acronyms for this list.
  2307. X.SH "SEE ALSO"
  2308. talk(1), write(1)
  2309. END_OF_FILE
  2310. if test 712 -ne `wc -c <'talkacros.7'`; then
  2311.     echo shar: \"'talkacros.7'\" unpacked with wrong size!
  2312. fi
  2313. # end of 'talkacros.7'
  2314. fi
  2315. if test -f 'timer.h' -a "${1}" != "-c" ; then 
  2316.   echo shar: Will not clobber existing file \"'timer.h'\"
  2317. else
  2318. echo shar: Extracting \"'timer.h'\" \(521 characters\)
  2319. sed "s/^X//" >'timer.h' <<'END_OF_FILE'
  2320. X#ifndef TIMER_H
  2321. X#define TIMER_H
  2322. X
  2323. X#include "sigsched.h"
  2324. X
  2325. X#define TIMER_REAL ((timer_type) 0)
  2326. X#define TIMER_VIRTUAL ((timer_type) 1)
  2327. X#define TIMER_PROF ((timer_type) 2)
  2328. X#define TIMER_NUM ((timer_type) 3)
  2329. X
  2330. typedef int timer_type;
  2331. typedef struct { unsigned long sec; unsigned long usec; } timer_clock;
  2332. typedef struct { ss_sig sig; ss_extern x; timer_type t; timer_clock when; } timer_sig;
  2333. X
  2334. extern int timer_now();
  2335. extern void timer_sum();
  2336. extern int timer_diff();
  2337. extern void timer_setsig();
  2338. extern int timer_init();
  2339. X
  2340. X#endif
  2341. END_OF_FILE
  2342. if test 521 -ne `wc -c <'timer.h'`; then
  2343.     echo shar: \"'timer.h'\" unpacked with wrong size!
  2344. fi
  2345. # end of 'timer.h'
  2346. fi
  2347. if test -f 'tiocsti.1' -a "${1}" != "-c" ; then 
  2348.   echo shar: Will not clobber existing file \"'tiocsti.1'\"
  2349. else
  2350. echo shar: Extracting \"'tiocsti.1'\" \(250 characters\)
  2351. sed "s/^X//" >'tiocsti.1' <<'END_OF_FILE'
  2352. X.TH tiocsti 1
  2353. X.SH NAME
  2354. tiocsti \- simulate terminal input
  2355. X.SH SYNOPSIS
  2356. X.B tiocsti
  2357. X[
  2358. X.I arg
  2359. X] ...
  2360. X.SH DESCRIPTION
  2361. X.B tiocsti
  2362. X``types'' each of its arguments on the
  2363. current terminal, separated by spaces,
  2364. as if you had typed them.
  2365. X.SH "SEE ALSO"
  2366. tty(4)
  2367. END_OF_FILE
  2368. if test 250 -ne `wc -c <'tiocsti.1'`; then
  2369.     echo shar: \"'tiocsti.1'\" unpacked with wrong size!
  2370. fi
  2371. # end of 'tiocsti.1'
  2372. fi
  2373. if test -f 'tiocsti.c' -a "${1}" != "-c" ; then 
  2374.   echo shar: Will not clobber existing file \"'tiocsti.c'\"
  2375. else
  2376. echo shar: Extracting \"'tiocsti.c'\" \(322 characters\)
  2377. sed "s/^X//" >'tiocsti.c' <<'END_OF_FILE'
  2378. X/* Public domain. */
  2379. X#include <sys/ioctl.h>
  2380. X
  2381. main(argc,argv)
  2382. int argc;
  2383. char *argv[];
  2384. X{
  2385. X int j;
  2386. X char *s;
  2387. X
  2388. X if (ioctl(3,TIOCGPGRP,(char *) &j) == -1)
  2389. X   (void) dup2(0,3);
  2390. X
  2391. X for (j = 1;j < argc;j++)
  2392. X  {
  2393. X   for (s = argv[j];*s;s++)
  2394. X     (void) ioctl(3,TIOCSTI,s);
  2395. X   if (j < argc - 1)
  2396. X     (void) ioctl(3,TIOCSTI," ");
  2397. X  }
  2398. X}
  2399. END_OF_FILE
  2400. if test 322 -ne `wc -c <'tiocsti.c'`; then
  2401.     echo shar: \"'tiocsti.c'\" unpacked with wrong size!
  2402. fi
  2403. # end of 'tiocsti.c'
  2404. fi
  2405. if test -f 'tplay.1' -a "${1}" != "-c" ; then 
  2406.   echo shar: Will not clobber existing file \"'tplay.1'\"
  2407. else
  2408. echo shar: Extracting \"'tplay.1'\" \(399 characters\)
  2409. sed "s/^X//" >'tplay.1' <<'END_OF_FILE'
  2410. X.TH tplay 1
  2411. X.SH NAME
  2412. tplay \- play back a tape-recorded input
  2413. X.SH SYNTAX
  2414. X.B tplay
  2415. X.SH DESCRIPTION
  2416. X.B tplay
  2417. replays a
  2418. X.I tape
  2419. recorded by
  2420. X.B trecord.
  2421. It pauses to produce the same timing as the original input to
  2422. X.B trecord
  2423. X(down to the resolution of the system clock).
  2424. X.SH VERSION
  2425. tplay version 1.0, 7/27/91.
  2426. X.SH AUTHOR
  2427. Placed into the public domain by Daniel J. Bernstein.
  2428. X.SH "SEE ALSO"
  2429. trecord(1)
  2430. END_OF_FILE
  2431. if test 399 -ne `wc -c <'tplay.1'`; then
  2432.     echo shar: \"'tplay.1'\" unpacked with wrong size!
  2433. fi
  2434. # end of 'tplay.1'
  2435. fi
  2436. if test -f 'tscript.sh' -a "${1}" != "-c" ; then 
  2437.   echo shar: Will not clobber existing file \"'tscript.sh'\"
  2438. else
  2439. echo shar: Extracting \"'tscript.sh'\" \(293 characters\)
  2440. sed "s/^X//" >'tscript.sh' <<'END_OF_FILE'
  2441. X#!/bin/sh
  2442. X# XXX: propagate stops!
  2443. X# Public domain.
  2444. case "$@" in
  2445. X"") set tapescript ${1+"$@"} ;;
  2446. X"-a") set tapescript ${1+"$@"} ;;
  2447. esac
  2448. echo "Tape started, teeing $@"
  2449. X{ echo 'Tape started on '`date`;
  2450. X  pty -s "${SHELL-/bin/sh}";
  2451. X  echo 'Tape done on '`date`
  2452. X} | trecord | tee ${1+"$@"} | tplay
  2453. END_OF_FILE
  2454. if test 293 -ne `wc -c <'tscript.sh'`; then
  2455.     echo shar: \"'tscript.sh'\" unpacked with wrong size!
  2456. fi
  2457. # end of 'tscript.sh'
  2458. fi
  2459. if test -f 'tty.1' -a "${1}" != "-c" ; then 
  2460.   echo shar: Will not clobber existing file \"'tty.1'\"
  2461. else
  2462. echo shar: Extracting \"'tty.1'\" \(311 characters\)
  2463. sed "s/^X//" >'tty.1' <<'END_OF_FILE'
  2464. X.TH tty 1
  2465. X.SH NAME
  2466. tty \- get terminal name
  2467. X.SH SYNOPSIS
  2468. X.B tty
  2469. X[
  2470. X.B\-s
  2471. X]
  2472. X.SH DESCRIPTION
  2473. X.B tty
  2474. prints the pathname of the user's terminal,
  2475. or
  2476. X``not a tty''
  2477. if its input is not a terminal.
  2478. X.B tty \-s
  2479. prints nothing.
  2480. X.SH "EXIT VALUE"
  2481. X0 if the input is a terminal,
  2482. X1 if it isn't (or if option processing fails).
  2483. END_OF_FILE
  2484. if test 311 -ne `wc -c <'tty.1'`; then
  2485.     echo shar: \"'tty.1'\" unpacked with wrong size!
  2486. fi
  2487. # end of 'tty.1'
  2488. fi
  2489. if test -f 'tty.c' -a "${1}" != "-c" ; then 
  2490.   echo shar: Will not clobber existing file \"'tty.c'\"
  2491. else
  2492. echo shar: Extracting \"'tty.c'\" \(684 characters\)
  2493. sed "s/^X//" >'tty.c' <<'END_OF_FILE'
  2494. X/* tty.c: clone of tty program
  2495. Daniel J. Bernstein, brnstnd@nyu.edu.
  2496. Depends on getopt.h.
  2497. Requires ttyname().
  2498. X7/22/91: Baseline. tty 1.0, public domain.
  2499. No known patent problems.
  2500. X
  2501. Documentation in tty.1.
  2502. X*/
  2503. X
  2504. X#include "getopt.h"
  2505. X
  2506. extern char *ttyname(); /* XXX: should have library for this */
  2507. X
  2508. main(argc,argv)
  2509. int argc;
  2510. char *argv[];
  2511. X{
  2512. X char *s;
  2513. X int opt;
  2514. X int flagsilent;
  2515. X
  2516. X flagsilent = 0;
  2517. X while ((opt = getopt(argc,argv,"s")) != opteof)
  2518. X   switch(opt)
  2519. X    {
  2520. X     case 's':
  2521. X       flagsilent = 1;
  2522. X       break;
  2523. X     case '?':
  2524. X     default:
  2525. X       exit(1);
  2526. X    }
  2527. X
  2528. X s = ttyname(0);
  2529. X
  2530. X if (!flagsilent)
  2531. X   if (s)
  2532. X     (void) puts(s);
  2533. X   else
  2534. X     (void) puts("not a tty");
  2535. X exit(!s);
  2536. X}
  2537. END_OF_FILE
  2538. if test 684 -ne `wc -c <'tty.c'`; then
  2539.     echo shar: \"'tty.c'\" unpacked with wrong size!
  2540. fi
  2541. # end of 'tty.c'
  2542. fi
  2543. if test -f 'ttydetach.1' -a "${1}" != "-c" ; then 
  2544.   echo shar: Will not clobber existing file \"'ttydetach.1'\"
  2545. else
  2546. echo shar: Extracting \"'ttydetach.1'\" \(384 characters\)
  2547. sed "s/^X//" >'ttydetach.1' <<'END_OF_FILE'
  2548. X.TH ttydetach 1
  2549. X.SH NAME
  2550. ttydetach \- run program without a controlling tty
  2551. X.SH SYNOPSIS
  2552. X.B ttydetach
  2553. X.I program
  2554. X[
  2555. X.I arg  ...
  2556. X]
  2557. X.SH DESCRIPTION
  2558. X.B ttydetach
  2559. removes its association with the current tty,
  2560. removes any PTY variable from the environment,
  2561. and
  2562. runs
  2563. X.I program
  2564. with the given arguments.
  2565. It may close or arbitrarily mangle
  2566. open tty descriptors.
  2567. X.SH "SEE ALSO"
  2568. pty(1),
  2569. tty(4)
  2570. END_OF_FILE
  2571. if test 384 -ne `wc -c <'ttydetach.1'`; then
  2572.     echo shar: \"'ttydetach.1'\" unpacked with wrong size!
  2573. fi
  2574. # end of 'ttydetach.1'
  2575. fi
  2576. if test -f 'ttyprotect.sh' -a "${1}" != "-c" ; then 
  2577.   echo shar: Will not clobber existing file \"'ttyprotect.sh'\"
  2578. else
  2579. echo shar: Extracting \"'ttyprotect.sh'\" \(44 characters\)
  2580. sed "s/^X//" >'ttyprotect.sh' <<'END_OF_FILE'
  2581. X#!/bin/sh
  2582. X# Public domain.
  2583. exec pty -0 "$@"
  2584. END_OF_FILE
  2585. if test 44 -ne `wc -c <'ttyprotect.sh'`; then
  2586.     echo shar: \"'ttyprotect.sh'\" unpacked with wrong size!
  2587. fi
  2588. # end of 'ttyprotect.sh'
  2589. fi
  2590. if test -f 'username.h' -a "${1}" != "-c" ; then 
  2591.   echo shar: Will not clobber existing file \"'username.h'\"
  2592. else
  2593. echo shar: Extracting \"'username.h'\" \(101 characters\)
  2594. sed "s/^X//" >'username.h' <<'END_OF_FILE'
  2595. X#ifndef USERNAME_H
  2596. X#define USERNAME_H
  2597. X
  2598. extern int uid2username();
  2599. extern int username2uid();
  2600. X
  2601. X#endif
  2602. END_OF_FILE
  2603. if test 101 -ne `wc -c <'username.h'`; then
  2604.     echo shar: \"'username.h'\" unpacked with wrong size!
  2605. fi
  2606. # end of 'username.h'
  2607. fi
  2608. if test -f 'users.1' -a "${1}" != "-c" ; then 
  2609.   echo shar: Will not clobber existing file \"'users.1'\"
  2610. else
  2611. echo shar: Extracting \"'users.1'\" \(554 characters\)
  2612. sed "s/^X//" >'users.1' <<'END_OF_FILE'
  2613. X.TH users 1
  2614. X.SH NAME
  2615. users \- show compact list of users who are logged on
  2616. X.SH SYNOPSIS
  2617. X.B users
  2618. X.SH DESCRIPTION
  2619. X.B users
  2620. lists the login names of the users currently on the system in a compact,
  2621. sorted,
  2622. one-line format.
  2623. X.SH COMPATIBILITY
  2624. Some versions of this program eliminate duplicates.
  2625. Some eliminate duplicates incorrectly.
  2626. This clone version prints each user exactly as many times
  2627. as /etc/utmp lists.
  2628. X.SH FILES
  2629. X/etc/utmp
  2630. X.SH VERSION
  2631. users version 2.0, 7/23/91.
  2632. X.SH AUTHOR
  2633. Placed into the public domain by Daniel J. Bernstein.
  2634. X.SH "SEE ALSO"
  2635. who(1)
  2636. END_OF_FILE
  2637. if test 554 -ne `wc -c <'users.1'`; then
  2638.     echo shar: \"'users.1'\" unpacked with wrong size!
  2639. fi
  2640. # end of 'users.1'
  2641. fi
  2642. if test -f 'utmpinit.8' -a "${1}" != "-c" ; then 
  2643.   echo shar: Will not clobber existing file \"'utmpinit.8'\"
  2644. else
  2645. echo shar: Extracting \"'utmpinit.8'\" \(353 characters\)
  2646. sed "s/^X//" >'utmpinit.8' <<'END_OF_FILE'
  2647. X.TH utmpinit 8
  2648. X.SH NAME
  2649. utmpinit \- clear /etc/utmp
  2650. X.SH SYNOPSIS
  2651. X.B utmpinit
  2652. X.SH DESCRIPTION
  2653. X.B utmpinit
  2654. fills in
  2655. X/etc/utmp
  2656. with properly initialized blank entries,
  2657. in the same order as specified by
  2658. X.B getttyent(3).
  2659. It should be run from
  2660. X.B rc.local
  2661. to initialize
  2662. X/etc/utmp
  2663. more professionally than
  2664. X.B init(8)
  2665. does.
  2666. X.SH "SEE ALSO"
  2667. getttyent(3),
  2668. init(8)
  2669. END_OF_FILE
  2670. if test 353 -ne `wc -c <'utmpinit.8'`; then
  2671.     echo shar: \"'utmpinit.8'\" unpacked with wrong size!
  2672. fi
  2673. # end of 'utmpinit.8'
  2674. fi
  2675. if test -f 'utmpinit.c' -a "${1}" != "-c" ; then 
  2676.   echo shar: Will not clobber existing file \"'utmpinit.c'\"
  2677. else
  2678. echo shar: Extracting \"'utmpinit.c'\" \(621 characters\)
  2679. sed "s/^X//" >'utmpinit.c' <<'END_OF_FILE'
  2680. X/* derived from contribution from paul graham <pjg@acsu.buffalo.edu> */
  2681. X
  2682. X#include <sys/types.h>
  2683. X#include <sys/file.h>
  2684. X#include <ttyent.h>
  2685. X#include <utmp.h>
  2686. X#include "config/utmpfile.h"
  2687. X#include "ptymisc.h"
  2688. X
  2689. main()
  2690. X{
  2691. X struct ttyent *tt;
  2692. X int fd;
  2693. X static struct utmp ut;
  2694. X
  2695. X fd = open(UTMP_FILE,O_WRONLY | O_TRUNC | O_CREAT,0644);
  2696. X if (fd == -1)
  2697. X   exit(1); /*XXX*/
  2698. X
  2699. X ut.ut_host[0] = 0;
  2700. X ut.ut_name[0] = 0;
  2701. X ut.ut_time = now(); /* XXX: init uses 0 */
  2702. X
  2703. X write(fd,(char *) &ut,sizeof(ut));
  2704. X while (tt = getttyent())
  2705. X  {
  2706. X   strncpy(ut.ut_line,tt->ty_name,sizeof(ut.ut_line));
  2707. X   write(fd,(char *) &ut,sizeof(ut)); /*XXX*/
  2708. X  }
  2709. X}
  2710. END_OF_FILE
  2711. if test 621 -ne `wc -c <'utmpinit.c'`; then
  2712.     echo shar: \"'utmpinit.c'\" unpacked with wrong size!
  2713. fi
  2714. # end of 'utmpinit.c'
  2715. fi
  2716. if test -f 'waitfor.1' -a "${1}" != "-c" ; then 
  2717.   echo shar: Will not clobber existing file \"'waitfor.1'\"
  2718. else
  2719. echo shar: Extracting \"'waitfor.1'\" \(544 characters\)
  2720. sed "s/^X//" >'waitfor.1' <<'END_OF_FILE'
  2721. X.TH waitfor 1
  2722. X.SH NAME
  2723. waitfor \- read input until it matches a fixed string
  2724. X.SH SYNOPSIS
  2725. X.B waitfor
  2726. X.I string
  2727. X.SH DESCRIPTION
  2728. X.B waitfor
  2729. reads characters from its input, one at a time,
  2730. until the end of the first occurrence of
  2731. X.I string.
  2732. It copies the characters to stderr.
  2733. It leaves the input file position
  2734. just after
  2735. X.I string.
  2736. X.SH "EXIT VALUE"
  2737. X.B waitfor
  2738. exits 0 if it finds
  2739. X.I string,
  2740. X1 if
  2741. X.I string
  2742. is not specified,
  2743. X2 if it is not able to allocate memory for an input buffer,
  2744. X3 upon an output error,
  2745. X4 upon an input error or end of file.
  2746. END_OF_FILE
  2747. if test 544 -ne `wc -c <'waitfor.1'`; then
  2748.     echo shar: \"'waitfor.1'\" unpacked with wrong size!
  2749. fi
  2750. # end of 'waitfor.1'
  2751. fi
  2752. if test -f 'waitfor.c' -a "${1}" != "-c" ; then 
  2753.   echo shar: Will not clobber existing file \"'waitfor.c'\"
  2754. else
  2755. echo shar: Extracting \"'waitfor.c'\" \(612 characters\)
  2756. sed "s/^X//" >'waitfor.c' <<'END_OF_FILE'
  2757. extern char *malloc();
  2758. X
  2759. main(argc,argv)
  2760. int argc;
  2761. char *argv[];
  2762. X{
  2763. X int len;
  2764. X char *s;
  2765. X int pos;
  2766. X char ch;
  2767. X int f;
  2768. X int p;
  2769. X if (!argv[1])
  2770. X   exit(1);
  2771. X len = strlen(argv[1]);
  2772. X if (!len)
  2773. X   len = 1;
  2774. X if (!(s = malloc(len)))
  2775. X   exit(2);
  2776. X pos = 0;
  2777. X f = 0;
  2778. X while (read(0,&ch,1) == 1)
  2779. X  {
  2780. X   if (write(2,&ch,1) != 1)
  2781. X     exit(3);
  2782. X   if (ch)
  2783. X    {
  2784. X     s[pos] = ch;
  2785. X     ++pos;
  2786. X     if (pos == len)
  2787. X      {
  2788. X       f = 1;
  2789. X       pos = 0;
  2790. X      }
  2791. X     if (f && (ch == argv[1][len - 1]))
  2792. X      {
  2793. X       for (p = 1;s[(pos + p) % len] == argv[1][p];++p)
  2794. X     ;
  2795. X       if (!argv[1][p])
  2796. X     exit(0);
  2797. X      }
  2798. X    }
  2799. X  }
  2800. X exit(4);
  2801. X}
  2802. END_OF_FILE
  2803. if test 612 -ne `wc -c <'waitfor.c'`; then
  2804.     echo shar: \"'waitfor.c'\" unpacked with wrong size!
  2805. fi
  2806. # end of 'waitfor.c'
  2807. fi
  2808. if test -f 'wall.1' -a "${1}" != "-c" ; then 
  2809.   echo shar: Will not clobber existing file \"'wall.1'\"
  2810. else
  2811. echo shar: Extracting \"'wall.1'\" \(513 characters\)
  2812. sed "s/^X//" >'wall.1' <<'END_OF_FILE'
  2813. X.TH wall 1
  2814. X.SH NAME
  2815. wall \- write to all users
  2816. X.SH SYNOPSIS
  2817. X.B wall
  2818. X.SH DESCRIPTION
  2819. X.B wall
  2820. prompts for a message with
  2821. X``Broadcast Message,''
  2822. then reads its standard input until end-of-file.
  2823. It then sends this message
  2824. to all logged in users.
  2825. X
  2826. Naturally,
  2827. X.B mesg
  2828. protections apply.
  2829. X
  2830. X.B wall
  2831. will refuse to send a message containing any control
  2832. characters (other than the initial beep).
  2833. X.SH FILES
  2834. X/dev/tty*
  2835. X.br
  2836. X/etc/utmp
  2837. X.SH RESTRICTIONS
  2838. The message is limited to 10000 characters.
  2839. X.SH "SEE ALSO"
  2840. mesg(1),
  2841. write(1)
  2842. END_OF_FILE
  2843. if test 513 -ne `wc -c <'wall.1'`; then
  2844.     echo shar: \"'wall.1'\" unpacked with wrong size!
  2845. fi
  2846. # end of 'wall.1'
  2847. fi
  2848. if test -f 'whoami.1' -a "${1}" != "-c" ; then 
  2849.   echo shar: Will not clobber existing file \"'whoami.1'\"
  2850. else
  2851. echo shar: Extracting \"'whoami.1'\" \(480 characters\)
  2852. sed "s/^X//" >'whoami.1' <<'END_OF_FILE'
  2853. X.TH whoami 1
  2854. X.SH NAME
  2855. whoami \- print effective username
  2856. X.SH SYNTAX
  2857. whoami
  2858. X.SH DESCRIPTION
  2859. X.B whoami
  2860. prints the username
  2861. corresponding to the effective userid,
  2862. or the numeric userid if no username is available.
  2863. X.SH COMPATIBILITY
  2864. X.B whoami
  2865. originated with BSD systems and typically is not available
  2866. under System V.
  2867. However, this is a straight clone.
  2868. X.SH VERSION
  2869. whoami version 1.0, 7/22/91.
  2870. X.SH AUTHOR
  2871. Placed into the public domain by Daniel J. Bernstein.
  2872. X.SH "SEE ALSO"
  2873. getuid(2)
  2874. END_OF_FILE
  2875. if test 480 -ne `wc -c <'whoami.1'`; then
  2876.     echo shar: \"'whoami.1'\" unpacked with wrong size!
  2877. fi
  2878. # end of 'whoami.1'
  2879. fi
  2880. if test -f 'whoami.c' -a "${1}" != "-c" ; then 
  2881.   echo shar: Will not clobber existing file \"'whoami.c'\"
  2882. else
  2883. echo shar: Extracting \"'whoami.c'\" \(347 characters\)
  2884. sed "s/^X//" >'whoami.c' <<'END_OF_FILE'
  2885. X/* whoami.c: clone of whoami program
  2886. Daniel J. Bernstein, brnstnd@nyu.edu.
  2887. Depends on username.h.
  2888. Requires puts() and geteuid().
  2889. X7/22/91: Baseline. whoami 1.0, public domain.
  2890. No known patent problems.
  2891. X
  2892. Documentation in whoami.1.
  2893. X*/
  2894. X
  2895. X#include "username.h"
  2896. X
  2897. main()
  2898. X{
  2899. X char *username;
  2900. X uid2username(geteuid(),&username);
  2901. X puts(username);
  2902. X exit(0);
  2903. X}
  2904. END_OF_FILE
  2905. if test 347 -ne `wc -c <'whoami.c'`; then
  2906.     echo shar: \"'whoami.c'\" unpacked with wrong size!
  2907. fi
  2908. # end of 'whoami.c'
  2909. fi
  2910. if test -f 'wtmprotate.8' -a "${1}" != "-c" ; then 
  2911.   echo shar: Will not clobber existing file \"'wtmprotate.8'\"
  2912. else
  2913. echo shar: Extracting \"'wtmprotate.8'\" \(464 characters\)
  2914. sed "s/^X//" >'wtmprotate.8' <<'END_OF_FILE'
  2915. X.TH wtmprotate 8
  2916. X.SH NAME
  2917. wtmprotate \- rotate /usr/adm/wtmp logs
  2918. X.SH SYNOPSIS
  2919. X.B wtmprotate
  2920. X.SH DESCRIPTION
  2921. X.B wtmprotate
  2922. saves a copy of /usr/adm/wtmp in
  2923. X/usr/adm/wtmp.0, then clears
  2924. X/usr/adm/wtmp.
  2925. It saves the old wtmp.0 in wtmp.1,
  2926. the old wtmp.1 in wtmp.2, and so on
  2927. up to wtmp.7.
  2928. Any previous wtmp.7 is removed.
  2929. X
  2930. X.B wtmprotate
  2931. should be run from a weekly or monthly
  2932. X.B cron
  2933. script
  2934. to prevent
  2935. X/usr/adm/wtmp
  2936. from filling up the disk.
  2937. X.SH "SEE ALSO"
  2938. utmpinit(8)
  2939. END_OF_FILE
  2940. if test 464 -ne `wc -c <'wtmprotate.8'`; then
  2941.     echo shar: \"'wtmprotate.8'\" unpacked with wrong size!
  2942. fi
  2943. # end of 'wtmprotate.8'
  2944. fi
  2945. if test -f 'wtmprotate.sh' -a "${1}" != "-c" ; then 
  2946.   echo shar: Will not clobber existing file \"'wtmprotate.sh'\"
  2947. else
  2948. echo shar: Extracting \"'wtmprotate.sh'\" \(487 characters\)
  2949. sed "s/^X//" >'wtmprotate.sh' <<'END_OF_FILE'
  2950. WARNING: Do not change this file without changing Makefile accordingly!
  2951. X#include <utmp.h>
  2952. X#include "config/wtmpfile.h"
  2953. XX!/bin/sh
  2954. XX if you want to save WTMP_FILE.7, do it now!
  2955. mv WTMP_FILE.6 WTMP_FILE.7
  2956. mv WTMP_FILE.5 WTMP_FILE.6
  2957. mv WTMP_FILE.4 WTMP_FILE.5
  2958. mv WTMP_FILE.3 WTMP_FILE.4
  2959. mv WTMP_FILE.2 WTMP_FILE.3
  2960. mv WTMP_FILE.1 WTMP_FILE.2
  2961. mv WTMP_FILE.0 WTMP_FILE.1
  2962. ln WTMP_FILE WTMP_FILE.0
  2963. cp WTMP_FILE WTMP_FILE.new; : > WTMP_FILE.new
  2964. chmod 644 WTMP_FILE.new; mv WTMP_FILE.new WTMP_FILE
  2965. END_OF_FILE
  2966. if test 487 -ne `wc -c <'wtmprotate.sh'`; then
  2967.     echo shar: \"'wtmprotate.sh'\" unpacked with wrong size!
  2968. fi
  2969. # end of 'wtmprotate.sh'
  2970. fi
  2971. echo shar: End of archive 1 \(of 9\).
  2972. cp /dev/null ark1isdone
  2973. MISSING=""
  2974. for I in 1 2 3 4 5 6 7 8 9 ; do
  2975.     if test ! -f ark${I}isdone ; then
  2976.     MISSING="${MISSING} ${I}"
  2977.     fi
  2978. done
  2979. if test "${MISSING}" = "" ; then
  2980.     echo You have unpacked all 9 archives.
  2981.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2982. else
  2983.     echo You still need to unpack the following archives:
  2984.     echo "        " ${MISSING}
  2985. fi
  2986. ##  End of shell archive.
  2987. exit 0
  2988.