home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2149 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  71.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: 2149

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 65 72 | 69 63 40 73 61 63 74 6f |From: er|ic@sacto|
|00000010| 68 30 2e 53 41 43 2e 43 | 41 2e 55 53 20 28 45 72 |h0.SAC.C|A.US (Er|
|00000020| 69 63 20 4a 2e 20 4e 69 | 68 69 6c 6c 29 0a 4e 65 |ic J. Ni|hill).Ne|
|00000030| 77 73 67 72 6f 75 70 73 | 3a 20 61 6c 74 2e 73 6f |wsgroups|: alt.so|
|00000040| 75 72 63 65 73 2c 70 75 | 62 6e 65 74 2e 73 6f 75 |urces,pu|bnet.sou|
|00000050| 72 63 65 73 0a 53 75 62 | 6a 65 63 74 3a 20 63 69 |rces.Sub|ject: ci|
|00000060| 74 33 30 31 2e 70 61 72 | 74 37 0a 4d 65 73 73 61 |t301.par|t7.Messa|
|00000070| 67 65 2d 49 44 3a 20 3c | 34 33 38 34 40 73 61 63 |ge-ID: <|4384@sac|
|00000080| 74 6f 68 30 2e 53 41 43 | 2e 43 41 2e 55 53 3e 0a |toh0.SAC|.CA.US>.|
|00000090| 44 61 74 65 3a 20 32 35 | 20 4e 6f 76 20 39 30 20 |Date: 25| Nov 90 |
|000000a0| 32 31 3a 33 34 3a 35 31 | 20 47 4d 54 0a 0a 23 21 |21:34:51| GMT..#!|
|000000b0| 20 2f 62 69 6e 2f 73 68 | 0a 23 20 54 68 69 73 20 | /bin/sh|.# This |
|000000c0| 69 73 20 61 20 73 68 65 | 6c 6c 20 61 72 63 68 69 |is a she|ll archi|
|000000d0| 76 65 2c 20 6d 65 61 6e | 69 6e 67 3a 0a 23 20 31 |ve, mean|ing:.# 1|
|000000e0| 2e 20 52 65 6d 6f 76 65 | 20 65 76 65 72 79 74 68 |. Remove| everyth|
|000000f0| 69 6e 67 20 61 62 6f 76 | 65 20 74 68 65 20 23 21 |ing abov|e the #!|
|00000100| 20 2f 62 69 6e 2f 73 68 | 20 6c 69 6e 65 2e 0a 23 | /bin/sh| line..#|
|00000110| 20 32 2e 20 53 61 76 65 | 20 74 68 65 20 72 65 73 | 2. Save| the res|
|00000120| 75 6c 74 69 6e 67 20 74 | 65 78 74 20 69 6e 20 61 |ulting t|ext in a|
|00000130| 20 66 69 6c 65 2e 0a 23 | 20 33 2e 20 45 78 65 63 | file..#| 3. Exec|
|00000140| 75 74 65 20 74 68 65 20 | 66 69 6c 65 20 77 69 74 |ute the |file wit|
|00000150| 68 20 2f 62 69 6e 2f 73 | 68 20 28 6e 6f 74 20 63 |h /bin/s|h (not c|
|00000160| 73 68 29 20 74 6f 20 63 | 72 65 61 74 65 3a 0a 23 |sh) to c|reate:.#|
|00000170| 09 73 6f 75 72 63 65 0a | 23 20 54 68 69 73 20 61 |.source.|# This a|
|00000180| 72 63 68 69 76 65 20 63 | 72 65 61 74 65 64 3a 20 |rchive c|reated: |
|00000190| 53 75 6e 20 4e 6f 76 20 | 32 35 20 31 32 3a 35 39 |Sun Nov |25 12:59|
|000001a0| 3a 35 30 20 31 39 39 30 | 0a 65 78 70 6f 72 74 20 |:50 1990|.export |
|000001b0| 50 41 54 48 3b 20 50 41 | 54 48 3d 2f 62 69 6e 3a |PATH; PA|TH=/bin:|
|000001c0| 2f 75 73 72 2f 62 69 6e | 3a 24 50 41 54 48 0a 69 |/usr/bin|:$PATH.i|
|000001d0| 66 20 74 65 73 74 20 21 | 20 2d 64 20 27 73 6f 75 |f test !| -d 'sou|
|000001e0| 72 63 65 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |rce'.the|n..echo |
|000001f0| 73 68 61 72 3a 20 22 63 | 72 65 61 74 69 6e 67 20 |shar: "c|reating |
|00000200| 64 69 72 65 63 74 6f 72 | 79 20 27 73 6f 75 72 63 |director|y 'sourc|
|00000210| 65 27 22 0a 09 6d 6b 64 | 69 72 20 27 73 6f 75 72 |e'"..mkd|ir 'sour|
|00000220| 63 65 27 0a 66 69 0a 65 | 63 68 6f 20 73 68 61 72 |ce'.fi.e|cho shar|
|00000230| 3a 20 22 65 6e 74 65 72 | 69 6e 67 20 64 69 72 65 |: "enter|ing dire|
|00000240| 63 74 6f 72 79 20 27 73 | 6f 75 72 63 65 27 22 0a |ctory 's|ource'".|
|00000250| 63 64 20 27 73 6f 75 72 | 63 65 27 0a 65 63 68 6f |cd 'sour|ce'.echo|
|00000260| 20 73 68 61 72 3a 20 22 | 65 78 74 72 61 63 74 69 | shar: "|extracti|
|00000270| 6e 67 20 27 63 68 61 74 | 2e 63 27 22 20 27 28 38 |ng 'chat|.c'" '(8|
|00000280| 32 31 38 20 63 68 61 72 | 61 63 74 65 72 73 29 27 |218 char|acters)'|
|00000290| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 63 68 61 |.if test| -f 'cha|
|000002a0| 74 2e 63 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |t.c'.the|n..echo |
|000002b0| 73 68 61 72 3a 20 22 77 | 69 6c 6c 20 6e 6f 74 20 |shar: "w|ill not |
|000002c0| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|000002d0| 69 6e 67 20 66 69 6c 65 | 20 27 63 68 61 74 2e 63 |ing file| 'chat.c|
|000002e0| 27 22 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |'".else.|cat << \|
|000002f0| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 63 68 61 74 |SHAR_EOF| > 'chat|
|00000300| 2e 63 27 0a 20 2f 2a 20 | 63 68 61 74 20 76 31 2e |.c'. /* |chat v1.|
|00000310| 33 0a 20 2a 20 0a 20 2a | 2f 0a 0a 23 64 65 66 69 |3. * . *|/..#defi|
|00000320| 6e 65 20 43 4f 4e 53 4f | 4c 45 20 22 2f 64 65 76 |ne CONSO|LE "/dev|
|00000330| 2f 63 6f 6e 73 6f 6c 65 | 22 0a 0a 23 69 6e 63 6c |/console|"..#incl|
|00000340| 75 64 65 20 3c 66 63 6e | 74 6c 2e 68 3e 0a 23 69 |ude <fcn|tl.h>.#i|
|00000350| 6e 63 6c 75 64 65 20 3c | 73 74 64 69 6f 2e 68 3e |nclude <|stdio.h>|
|00000360| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 63 74 79 70 65 |.#includ|e <ctype|
|00000370| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 79 |.h>.#inc|lude <sy|
|00000380| 73 2f 74 79 70 65 73 2e | 68 3e 0a 23 69 6e 63 6c |s/types.|h>.#incl|
|00000390| 75 64 65 20 3c 73 79 73 | 2f 73 74 61 74 2e 68 3e |ude <sys|/stat.h>|
|000003a0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 69 |.#includ|e <sys/i|
|000003b0| 6f 63 74 6c 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |octl.h>.|#include|
|000003c0| 20 3c 74 65 72 6d 69 6f | 2e 68 3e 0a 23 69 6e 63 | <termio|.h>.#inc|
|000003d0| 6c 75 64 65 20 3c 73 69 | 67 6e 61 6c 2e 68 3e 0a |lude <si|gnal.h>.|
|000003e0| 23 69 6e 63 6c 75 64 65 | 20 3c 75 74 6d 70 2e 68 |#include| <utmp.h|
|000003f0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 22 63 69 74 61 |>.#inclu|de "cita|
|00000400| 64 65 6c 2e 68 22 0a 0a | 69 6e 74 20 63 6f 6e 73 |del.h"..|int cons|
|00000410| 6f 6c 65 3b 0a 63 68 61 | 72 20 6f 6e 6c 69 6e 65 |ole;.cha|r online|
|00000420| 3b 0a 63 68 61 72 20 74 | 65 6d 70 5b 32 30 5d 3b |;.char t|emp[20];|
|00000430| 0a 0a 6c 6f 6e 67 20 6c | 73 65 65 6b 28 29 3b 0a |..long l|seek();.|
|00000440| 6c 6f 6e 67 20 61 74 6f | 6c 28 29 3b 0a 0a 0a 69 |long ato|l();...i|
|00000450| 6e 74 20 28 2a 73 6c 61 | 6d 63 61 72 72 69 65 72 |nt (*sla|mcarrier|
|00000460| 28 29 29 28 29 20 7b 0a | 09 69 66 20 28 6f 6e 6c |())() {.|.if (onl|
|00000470| 69 6e 65 3d 3d 31 29 20 | 77 72 69 74 65 28 63 6f |ine==1) |write(co|
|00000480| 6e 73 6f 6c 65 2c 22 2a | 6f 66 66 20 6c 69 6e 65 |nsole,"*|off line|
|00000490| 2a 20 20 50 72 65 73 73 | 20 63 74 72 6c 2d 63 20 |* Press| ctrl-c |
|000004a0| 74 6f 20 65 78 69 74 5c | 72 5c 6e 22 2c 33 34 29 |to exit\|r\n",34)|
|000004b0| 3b 0a 09 75 6e 6c 69 6e | 6b 28 22 2f 74 6d 70 2f |;..unlin|k("/tmp/|
|000004c0| 63 68 61 74 2e 6f 6e 6c | 69 6e 65 22 29 3b 0a 09 |chat.onl|ine");..|
|000004d0| 65 78 69 74 28 30 29 3b | 0a 7d 0a 0a 6d 61 69 6e |exit(0);|.}..main|
|000004e0| 28 61 72 67 63 2c 61 72 | 67 76 29 0a 69 6e 74 20 |(argc,ar|gv).int |
|000004f0| 61 72 67 63 3b 0a 63 68 | 61 72 20 2a 61 72 67 76 |argc;.ch|ar *argv|
|00000500| 5b 5d 3b 0a 7b 0a 09 69 | 6e 74 20 61 2c 62 2c 63 |[];.{..i|nt a,b,c|
|00000510| 2c 64 2c 65 3b 0a 09 69 | 6e 74 20 66 69 6c 65 3b |,d,e;..i|nt file;|
|00000520| 0a 09 63 68 61 72 20 61 | 61 61 5b 31 30 30 5d 3b |..char a|aa[100];|
|00000530| 0a 09 73 74 72 75 63 74 | 20 74 65 72 6d 69 6f 20 |..struct| termio |
|00000540| 74 65 72 6d 2c 73 61 76 | 65 69 6f 3b 0a 09 46 49 |term,sav|eio;..FI|
|00000550| 4c 45 20 2a 66 70 2c 2a | 61 72 63 3b 0a 0a 09 63 |LE *fp,*|arc;...c|
|00000560| 68 64 69 72 28 42 42 53 | 44 49 52 29 3b 0a 0a 09 |hdir(BBS|DIR);...|
|00000570| 69 66 20 28 21 73 74 72 | 6e 63 6d 70 28 74 74 79 |if (!str|ncmp(tty|
|00000580| 6e 61 6d 65 28 30 29 2c | 43 4f 4e 53 4f 4c 45 2c |name(0),|CONSOLE,|
|00000590| 73 74 72 6c 65 6e 28 43 | 4f 4e 53 4f 4c 45 29 29 |strlen(C|ONSOLE))|
|000005a0| 29 20 7b 0a 09 09 63 6f | 6e 63 68 61 74 28 61 72 |) {...co|nchat(ar|
|000005b0| 67 63 2c 61 72 67 76 29 | 3b 0a 09 09 65 78 69 74 |gc,argv)|;...exit|
|000005c0| 28 30 29 3b 0a 09 09 7d | 09 0a 0a 09 69 66 20 28 |(0);...}|....if (|
|000005d0| 69 73 63 6c 6f 67 28 29 | 3d 3d 30 29 20 7b 0a 09 |isclog()|==0) {..|
|000005e0| 09 70 72 69 6e 74 66 28 | 22 4e 6f 20 6f 6e 65 20 |.printf(|"No one |
|000005f0| 65 6c 73 65 20 69 73 20 | 6f 6e 6c 69 6e 65 2e 5c |else is |online.\|
|00000600| 6e 22 29 3b 0a 09 09 65 | 78 69 74 28 30 29 3b 0a |n");...e|xit(0);.|
|00000610| 09 09 7d 0a 0a 09 6f 6e | 6c 69 6e 65 3d 30 3b 0a |..}...on|line=0;.|
|00000620| 09 69 6f 63 74 6c 28 30 | 2c 54 43 47 45 54 41 2c |.ioctl(0|,TCGETA,|
|00000630| 26 73 61 76 65 69 6f 29 | 3b 0a 09 69 6f 63 74 6c |&saveio)|;..ioctl|
|00000640| 28 30 2c 54 43 47 45 54 | 41 2c 26 74 65 72 6d 29 |(0,TCGET|A,&term)|
|00000650| 3b 0a 0a 09 74 65 72 6d | 2e 63 5f 69 66 6c 61 67 |;...term|.c_iflag|
|00000660| 3d 33 33 36 36 3b 0a 09 | 74 65 72 6d 2e 63 5f 6f |=3366;..|term.c_o|
|00000670| 66 6c 61 67 3d 36 31 34 | 39 3b 0a 09 74 65 72 6d |flag=614|9;..term|
|00000680| 2e 63 5f 6c 66 6c 61 67 | 3d 35 39 3b 0a 09 74 65 |.c_lflag|=59;..te|
|00000690| 72 6d 2e 63 5f 6c 69 6e | 65 3d 30 3b 0a 09 74 65 |rm.c_lin|e=0;..te|
|000006a0| 72 6d 2e 63 5f 63 63 5b | 30 5d 3d 31 32 37 3b 0a |rm.c_cc[|0]=127;.|
|000006b0| 09 74 65 72 6d 2e 63 5f | 63 63 5b 31 5d 3d 32 38 |.term.c_|cc[1]=28|
|000006c0| 3b 0a 09 74 65 72 6d 2e | 63 5f 63 63 5b 32 5d 3d |;..term.|c_cc[2]=|
|000006d0| 38 3b 0a 09 74 65 72 6d | 2e 63 5f 63 63 5b 33 5d |8;..term|.c_cc[3]|
|000006e0| 3d 32 34 3b 0a 09 74 65 | 72 6d 2e 63 5f 63 63 5b |=24;..te|rm.c_cc[|
|000006f0| 34 5d 3d 34 3b 0a 09 74 | 65 72 6d 2e 63 5f 63 63 |4]=4;..t|erm.c_cc|
|00000700| 5b 35 5d 3d 32 35 35 3b | 0a 09 74 65 72 6d 2e 63 |[5]=255;|..term.c|
|00000710| 5f 63 63 5b 36 5d 3d 30 | 3b 0a 09 74 65 72 6d 2e |_cc[6]=0|;..term.|
|00000720| 63 5f 63 63 5b 37 5d 3d | 30 3b 0a 09 74 65 72 6d |c_cc[7]=|0;..term|
|00000730| 2e 63 5f 6c 66 6c 61 67 | 3d 30 3b 0a 09 74 65 72 |.c_lflag|=0;..ter|
|00000740| 6d 2e 63 5f 69 66 6c 61 | 67 3d 49 53 54 52 49 50 |m.c_ifla|g=ISTRIP|
|00000750| 3b 0a 09 69 6f 63 74 6c | 28 30 2c 54 43 53 45 54 |;..ioctl|(0,TCSET|
|00000760| 41 2c 26 74 65 72 6d 29 | 3b 0a 0a 09 66 70 3d 66 |A,&term)|;...fp=f|
|00000770| 6f 70 65 6e 28 22 2f 74 | 6d 70 2f 63 68 61 74 2e |open("/t|mp/chat.|
|00000780| 6e 61 6d 65 22 2c 22 77 | 22 29 3b 0a 09 66 70 72 |name","w|");..fpr|
|00000790| 69 6e 74 66 28 66 70 2c | 22 25 73 5c 6e 22 2c 74 |intf(fp,|"%s\n",t|
|000007a0| 74 79 6e 61 6d 65 28 30 | 29 29 3b 0a 09 66 63 6c |tyname(0|));..fcl|
|000007b0| 6f 73 65 28 66 70 29 3b | 0a 0a 09 63 6f 6e 73 6f |ose(fp);|...conso|
|000007c0| 6c 65 3d 6f 70 65 6e 28 | 43 4f 4e 53 4f 4c 45 2c |le=open(|CONSOLE,|
|000007d0| 4f 5f 57 52 4f 4e 4c 59 | 29 3b 0a 09 69 66 20 28 |O_WRONLY|);..if (|
|000007e0| 63 6f 6e 73 6f 6c 65 3c | 30 29 20 7b 0a 09 09 66 |console<|0) {...f|
|000007f0| 70 72 69 6e 74 66 28 73 | 74 64 65 72 72 2c 22 43 |printf(s|tderr,"C|
|00000800| 61 6e 27 74 20 61 63 63 | 65 73 73 20 25 73 5c 72 |an't acc|ess %s\r|
|00000810| 5c 6e 22 2c 43 4f 4e 53 | 4f 4c 45 29 3b 0a 09 09 |\n",CONS|OLE);...|
|00000820| 67 6f 74 6f 20 45 4e 44 | 3b 0a 09 09 7d 0a 0a 09 |goto END|;...}...|
|00000830| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 22 |fprintf(|stderr,"|
|00000840| 50 61 67 69 6e 67 20 25 | 73 2e 2e 2e 5c 72 5c 6e |Paging %|s...\r\n|
|00000850| 22 2c 43 4f 4e 53 4f 4c | 45 29 3b 0a 09 66 6f 72 |",CONSOL|E);..for|
|00000860| 20 28 61 3d 30 3b 20 61 | 3c 34 3b 20 2b 2b 61 29 | (a=0; a|<4; ++a)|
|00000870| 20 7b 0a 09 09 62 3d 37 | 3b 0a 09 09 77 72 69 74 | {...b=7|;...writ|
|00000880| 65 28 63 6f 6e 73 6f 6c | 65 2c 26 62 2c 31 29 3b |e(consol|e,&b,1);|
|00000890| 0a 09 09 77 72 69 74 65 | 28 31 2c 26 62 2c 31 29 |...write|(1,&b,1)|
|000008a0| 3b 0a 09 09 73 6c 65 65 | 70 28 31 29 3b 0a 09 09 |;...slee|p(1);...|
|000008b0| 7d 0a 09 70 72 69 6e 74 | 66 28 22 43 68 61 74 20 |}..print|f("Chat |
|000008c0| 6d 6f 64 65 20 2d 20 70 | 72 65 73 73 20 63 74 72 |mode - p|ress ctr|
|000008d0| 6c 2d 63 20 74 6f 20 65 | 78 69 74 20 69 66 5c 72 |l-c to e|xit if\r|
|000008e0| 5c 6e 22 29 3b 0a 09 70 | 72 69 6e 74 66 28 22 6e |\n");..p|rintf("n|
|000008f0| 6f 20 6f 6e 65 20 61 6e | 73 77 65 72 73 20 69 6e |o one an|swers in|
|00000900| 20 61 20 6d 69 6e 75 74 | 65 20 6f 72 20 73 6f 2e | a minut|e or so.|
|00000910| 2e 2e 5c 72 5c 6e 22 29 | 3b 0a 0a 41 3a 09 62 3d |..\r\n")|;..A:.b=|
|00000920| 30 3b 20 72 65 61 64 28 | 30 2c 26 62 2c 31 29 3b |0; read(|0,&b,1);|
|00000930| 09 09 09 2f 2a 20 72 65 | 61 64 20 61 20 63 68 61 |.../* re|ad a cha|
|00000940| 72 61 63 74 65 72 20 2a | 2f 0a 09 69 66 20 28 62 |racter *|/..if (b|
|00000950| 3d 3d 33 29 20 7b 0a 09 | 09 70 72 69 6e 74 66 28 |==3) {..|.printf(|
|00000960| 22 45 78 69 74 69 6e 67 | 20 63 68 61 74 20 6d 6f |"Exiting| chat mo|
|00000970| 64 65 5c 72 5c 6e 22 29 | 3b 0a 09 09 67 6f 74 6f |de\r\n")|;...goto|
|00000980| 20 45 4e 44 3b 0a 09 09 | 7d 0a 09 69 66 20 28 6f | END;...|}..if (o|
|00000990| 6e 6c 69 6e 65 3d 3d 31 | 29 20 7b 0a 09 09 63 3d |nline==1|) {...c=|
|000009a0| 31 30 3b 0a 09 09 77 72 | 69 74 65 28 63 6f 6e 73 |10;...wr|ite(cons|
|000009b0| 6f 6c 65 2c 26 62 2c 31 | 29 3b 20 77 72 69 74 65 |ole,&b,1|); write|
|000009c0| 28 31 2c 26 62 2c 31 29 | 3b 0a 09 09 70 75 74 63 |(1,&b,1)|;...putc|
|000009d0| 28 62 2c 61 72 63 29 3b | 20 66 66 6c 75 73 68 28 |(b,arc);| fflush(|
|000009e0| 61 72 63 29 3b 0a 09 09 | 69 66 20 28 62 3d 3d 31 |arc);...|if (b==1|
|000009f0| 33 29 20 7b 20 77 72 69 | 74 65 28 63 6f 6e 73 6f |3) { wri|te(conso|
|00000a00| 6c 65 2c 26 63 2c 31 29 | 3b 20 77 72 69 74 65 28 |le,&c,1)|; write(|
|00000a10| 31 2c 26 63 2c 31 29 3b | 20 7d 0a 09 09 67 6f 74 |1,&c,1);| }...got|
|00000a20| 6f 20 41 3b 0a 09 09 7d | 0a 09 2f 2a 20 6e 6f 74 |o A;...}|../* not|
|00000a30| 20 6f 6e 6c 69 6e 65 2c | 20 63 68 65 63 6b 20 66 | online,| check f|
|00000a40| 6f 72 20 66 6c 61 67 20 | 66 69 6c 65 20 2a 2f 0a |or flag |file */.|
|00000a50| 09 66 69 6c 65 3d 6f 70 | 65 6e 28 22 2f 74 6d 70 |.file=op|en("/tmp|
|00000a60| 2f 63 68 61 74 2e 6f 6e | 6c 69 6e 65 22 2c 4f 5f |/chat.on|line",O_|
|00000a70| 52 44 4f 4e 4c 59 29 3b | 20 63 6c 6f 73 65 28 66 |RDONLY);| close(f|
|00000a80| 69 6c 65 29 3b 0a 09 69 | 66 20 28 66 69 6c 65 3e |ile);..i|f (file>|
|00000a90| 28 2d 31 29 29 20 7b 0a | 09 09 6f 6e 6c 69 6e 65 |(-1)) {.|..online|
|00000aa0| 3d 31 3b 0a 09 09 75 6e | 6c 69 6e 6b 28 22 2f 74 |=1;...un|link("/t|
|00000ab0| 6d 70 2f 63 68 61 74 2e | 6f 6e 6c 69 6e 65 22 29 |mp/chat.|online")|
|00000ac0| 3b 0a 09 09 61 72 63 3d | 66 6f 70 65 6e 28 22 2f |;...arc=|fopen("/|
|00000ad0| 74 6d 70 2f 63 68 61 74 | 2e 66 69 66 6f 22 2c 22 |tmp/chat|.fifo","|
|00000ae0| 77 2b 22 29 3b 0a 09 09 | 73 70 72 69 6e 74 66 28 |w+");...|sprintf(|
|00000af0| 61 61 61 2c 22 4f 6e 6c | 69 6e 65 20 77 69 74 68 |aaa,"Onl|ine with|
|00000b00| 20 75 73 65 72 3a 20 25 | 73 5c 72 5c 6e 22 2c 61 | user: %|s\r\n",a|
|00000b10| 72 67 76 5b 31 5d 29 3b | 0a 09 09 66 70 72 69 6e |rgv[1]);|...fprin|
|00000b20| 74 66 28 61 72 63 2c 22 | 25 73 22 2c 61 61 61 29 |tf(arc,"|%s",aaa)|
|00000b30| 3b 0a 09 09 66 66 6c 75 | 73 68 28 61 72 63 29 3b |;...fflu|sh(arc);|
|00000b40| 0a 09 09 77 72 69 74 65 | 28 63 6f 6e 73 6f 6c 65 |...write|(console|
|00000b50| 2c 61 61 61 2c 73 74 72 | 6c 65 6e 28 61 61 61 29 |,aaa,str|len(aaa)|
|00000b60| 29 3b 20 61 61 61 5b 30 | 5d 3d 30 3b 0a 09 09 73 |); aaa[0|]=0;...s|
|00000b70| 69 67 6e 61 6c 28 53 49 | 47 48 55 50 2c 28 2a 73 |ignal(SI|GHUP,(*s|
|00000b80| 6c 61 6d 63 61 72 72 69 | 65 72 29 29 3b 0a 09 09 |lamcarri|er));...|
|00000b90| 77 72 69 74 65 28 63 6f | 6e 73 6f 6c 65 2c 26 62 |write(co|nsole,&b|
|00000ba0| 2c 31 29 3b 20 77 72 69 | 74 65 28 32 2c 26 62 2c |,1); wri|te(2,&b,|
|00000bb0| 31 29 3b 0a 09 09 70 75 | 74 63 28 62 2c 61 72 63 |1);...pu|tc(b,arc|
|00000bc0| 29 3b 20 66 66 6c 75 73 | 68 28 66 70 29 3b 0a 09 |); fflus|h(fp);..|
|00000bd0| 09 7d 0a 09 67 6f 74 6f | 20 41 3b 0a 0a 45 4e 44 |.}..goto| A;..END|
|00000be0| 3a 09 75 6e 6c 69 6e 6b | 28 22 2f 74 6d 70 2f 63 |:.unlink|("/tmp/c|
|00000bf0| 68 61 74 2e 6f 6e 6c 69 | 6e 65 22 29 3b 20 75 6e |hat.onli|ne"); un|
|00000c00| 6c 69 6e 6b 28 22 2f 74 | 6d 70 2f 63 68 61 74 2e |link("/t|mp/chat.|
|00000c10| 6e 61 6d 65 22 29 3b 0a | 09 69 66 20 28 6f 6e 6c |name");.|.if (onl|
|00000c20| 69 6e 65 3d 3d 31 29 0a | 09 09 77 72 69 74 65 28 |ine==1).|..write(|
|00000c30| 63 6f 6e 73 6f 6c 65 2c | 22 2a 6f 66 66 20 6c 69 |console,|"*off li|
|00000c40| 6e 65 2a 20 20 50 72 65 | 73 73 20 63 74 72 6c 2d |ne* Pre|ss ctrl-|
|00000c50| 63 20 74 6f 20 65 78 69 | 74 5c 72 5c 6e 22 2c 33 |c to exi|t\r\n",3|
|00000c60| 34 29 3b 0a 09 63 6c 6f | 73 65 28 63 6f 6e 73 6f |4);..clo|se(conso|
|00000c70| 6c 65 29 3b 0a 09 69 6f | 63 74 6c 28 30 2c 54 43 |le);..io|ctl(0,TC|
|00000c80| 53 45 54 41 2c 26 73 61 | 76 65 69 6f 29 3b 0a 09 |SETA,&sa|veio);..|
|00000c90| 75 6e 6c 69 6e 6b 28 22 | 2f 74 6d 70 2f 63 68 61 |unlink("|/tmp/cha|
|00000ca0| 74 2e 66 69 66 6f 22 29 | 3b 0a 09 65 78 69 74 28 |t.fifo")|;..exit(|
|00000cb0| 30 29 3b 0a 7d 0a 0a 63 | 6f 6e 63 68 61 74 28 61 |0);.}..c|onchat(a|
|00000cc0| 72 67 63 2c 61 72 67 76 | 29 0a 69 6e 74 20 61 72 |rgc,argv|).int ar|
|00000cd0| 67 63 3b 0a 63 68 61 72 | 20 2a 61 72 67 76 5b 5d |gc;.char| *argv[]|
|00000ce0| 3b 0a 7b 0a 09 69 6e 74 | 20 61 2c 62 2c 63 2c 64 |;.{..int| a,b,c,d|
|00000cf0| 2c 65 3b 0a 09 69 6e 74 | 20 63 6f 6e 73 6f 6c 65 |,e;..int| console|
|00000d00| 2c 66 69 6c 65 2c 66 69 | 6c 65 32 3b 0a 09 63 68 |,file,fi|le2;..ch|
|00000d10| 61 72 20 6f 6e 6c 69 6e | 65 3b 0a 09 63 68 61 72 |ar onlin|e;..char|
|00000d20| 20 61 61 61 5b 31 30 30 | 5d 2c 62 62 62 5b 31 30 | aaa[100|],bbb[10|
|00000d30| 30 5d 3b 0a 09 73 74 72 | 75 63 74 20 74 65 72 6d |0];..str|uct term|
|00000d40| 69 6f 20 74 65 72 6d 2c | 73 61 76 65 69 6f 3b 0a |io term,|saveio;.|
|00000d50| 09 46 49 4c 45 20 2a 61 | 72 63 3b 0a 0a 09 6f 6e |.FILE *a|rc;...on|
|00000d60| 6c 69 6e 65 3d 30 3b 0a | 09 69 6f 63 74 6c 28 30 |line=0;.|.ioctl(0|
|00000d70| 2c 54 43 47 45 54 41 2c | 26 73 61 76 65 69 6f 29 |,TCGETA,|&saveio)|
|00000d80| 3b 0a 09 69 6f 63 74 6c | 28 30 2c 54 43 47 45 54 |;..ioctl|(0,TCGET|
|00000d90| 41 2c 26 74 65 72 6d 29 | 3b 0a 0a 09 74 65 72 6d |A,&term)|;...term|
|00000da0| 2e 63 5f 69 66 6c 61 67 | 3d 33 33 36 36 3b 0a 09 |.c_iflag|=3366;..|
|00000db0| 74 65 72 6d 2e 63 5f 6f | 66 6c 61 67 3d 36 31 34 |term.c_o|flag=614|
|00000dc0| 39 3b 0a 09 74 65 72 6d | 2e 63 5f 6c 66 6c 61 67 |9;..term|.c_lflag|
|00000dd0| 3d 35 39 3b 0a 09 74 65 | 72 6d 2e 63 5f 6c 69 6e |=59;..te|rm.c_lin|
|00000de0| 65 3d 30 3b 0a 09 74 65 | 72 6d 2e 63 5f 63 63 5b |e=0;..te|rm.c_cc[|
|00000df0| 30 5d 3d 31 32 37 3b 0a | 09 74 65 72 6d 2e 63 5f |0]=127;.|.term.c_|
|00000e00| 63 63 5b 31 5d 3d 32 38 | 3b 0a 09 74 65 72 6d 2e |cc[1]=28|;..term.|
|00000e10| 63 5f 63 63 5b 32 5d 3d | 38 3b 0a 09 74 65 72 6d |c_cc[2]=|8;..term|
|00000e20| 2e 63 5f 63 63 5b 33 5d | 3d 32 34 3b 0a 09 74 65 |.c_cc[3]|=24;..te|
|00000e30| 72 6d 2e 63 5f 63 63 5b | 34 5d 3d 34 3b 0a 09 74 |rm.c_cc[|4]=4;..t|
|00000e40| 65 72 6d 2e 63 5f 63 63 | 5b 35 5d 3d 32 35 35 3b |erm.c_cc|[5]=255;|
|00000e50| 0a 09 74 65 72 6d 2e 63 | 5f 63 63 5b 36 5d 3d 30 |..term.c|_cc[6]=0|
|00000e60| 3b 0a 09 74 65 72 6d 2e | 63 5f 63 63 5b 37 5d 3d |;..term.|c_cc[7]=|
|00000e70| 30 3b 0a 09 74 65 72 6d | 2e 63 5f 6c 66 6c 61 67 |0;..term|.c_lflag|
|00000e80| 3d 30 3b 0a 09 74 65 72 | 6d 2e 63 5f 69 66 6c 61 |=0;..ter|m.c_ifla|
|00000e90| 67 3d 49 53 54 52 49 50 | 3b 0a 09 69 6f 63 74 6c |g=ISTRIP|;..ioctl|
|00000ea0| 28 30 2c 54 43 53 45 54 | 41 2c 26 74 65 72 6d 29 |(0,TCSET|A,&term)|
|00000eb0| 3b 0a 0a 09 66 69 6c 65 | 3d 6f 70 65 6e 28 22 2f |;...file|=open("/|
|00000ec0| 74 6d 70 2f 63 68 61 74 | 2e 6e 61 6d 65 22 2c 4f |tmp/chat|.name",O|
|00000ed0| 5f 52 44 4f 4e 4c 59 29 | 3b 0a 09 69 66 20 28 66 |_RDONLY)|;..if (f|
|00000ee0| 69 6c 65 3c 30 29 20 7b | 0a 20 09 09 70 72 69 6e |ile<0) {|. ..prin|
|00000ef0| 74 66 28 22 4e 6f 20 6f | 6e 65 20 68 61 73 20 72 |tf("No o|ne has r|
|00000f00| 65 71 75 65 73 74 65 64 | 20 61 20 63 68 61 74 2e |equested| a chat.|
|00000f10| 5c 72 5c 6e 22 29 3b 0a | 09 09 67 6f 74 6f 20 45 |\r\n");.|..goto E|
|00000f20| 4e 44 3b 0a 09 09 7d 0a | 0a 73 79 73 74 65 6d 28 |ND;...}.|.system(|
|00000f30| 0a 22 2f 65 74 63 2f 6d | 6b 6e 6f 64 20 2f 74 6d |."/etc/m|knod /tm|
|00000f40| 70 2f 63 68 61 74 2e 66 | 69 66 6f 20 70 3b 20 6e |p/chat.f|ifo p; n|
|00000f50| 6f 68 75 70 20 61 69 64 | 65 70 6f 73 74 20 3c 2f |ohup aid|epost </|
|00000f60| 74 6d 70 2f 63 68 61 74 | 2e 66 69 66 6f 20 32 3e |tmp/chat|.fifo 2>|
|00000f70| 2f 64 65 76 2f 6e 75 6c | 6c 20 26 22 29 3b 0a 09 |/dev/nul|l &");..|
|00000f80| 69 66 20 28 66 6f 72 6b | 28 29 3d 3d 30 29 20 61 |if (fork|()==0) a|
|00000f90| 69 64 65 70 6f 73 74 28 | 29 3b 0a 09 72 65 61 64 |idepost(|);..read|
|00000fa0| 28 66 69 6c 65 2c 62 62 | 62 2c 33 30 29 3b 20 63 |(file,bb|b,30); c|
|00000fb0| 6c 6f 73 65 28 66 69 6c | 65 29 3b 20 75 6e 6c 69 |lose(fil|e); unli|
|00000fc0| 6e 6b 28 22 2f 74 6d 70 | 2f 63 68 61 74 2e 6e 61 |nk("/tmp|/chat.na|
|00000fd0| 6d 65 22 29 3b 0a 09 66 | 6f 72 20 28 61 3d 30 3b |me");..f|or (a=0;|
|00000fe0| 20 61 3c 73 74 72 6c 65 | 6e 28 62 62 62 29 3b 20 | a<strle|n(bbb); |
|00000ff0| 2b 2b 61 29 20 69 66 20 | 28 62 62 62 5b 61 5d 3d |++a) if |(bbb[a]=|
|00001000| 3d 31 30 29 20 62 62 62 | 5b 61 5d 3d 30 3b 0a 09 |=10) bbb|[a]=0;..|
|00001010| 70 72 69 6e 74 66 28 22 | 43 6f 6e 6e 65 63 74 65 |printf("|Connecte|
|00001020| 64 20 74 6f 3a 20 25 73 | 5c 72 5c 6e 22 2c 62 62 |d to: %s|\r\n",bb|
|00001030| 62 29 3b 0a 09 66 69 6c | 65 3d 6f 70 65 6e 28 62 |b);..fil|e=open(b|
|00001040| 62 62 2c 4f 5f 57 52 4f | 4e 4c 59 29 3b 0a 09 69 |bb,O_WRO|NLY);..i|
|00001050| 66 20 28 66 69 6c 65 3c | 30 29 20 7b 0a 09 09 70 |f (file<|0) {...p|
|00001060| 72 69 6e 74 66 28 22 43 | 61 6e 27 74 20 6f 70 65 |rintf("C|an't ope|
|00001070| 6e 20 25 73 5c 72 5c 6e | 22 2c 62 62 62 29 3b 0a |n %s\r\n|",bbb);.|
|00001080| 09 09 67 6f 74 6f 20 45 | 4e 44 3b 0a 09 09 7d 0a |..goto E|ND;...}.|
|00001090| 09 66 69 6c 65 32 3d 63 | 72 65 61 74 28 22 2f 74 |.file2=c|reat("/t|
|000010a0| 6d 70 2f 63 68 61 74 2e | 6f 6e 6c 69 6e 65 22 2c |mp/chat.|online",|
|000010b0| 30 36 36 36 29 3b 20 63 | 6c 6f 73 65 28 66 69 6c |0666); c|lose(fil|
|000010c0| 65 32 29 3b 0a 09 73 70 | 72 69 6e 74 66 28 61 61 |e2);..sp|rintf(aa|
|000010d0| 61 2c 22 5c 6e 2a 61 6e | 73 77 65 72 2a 20 2d 20 |a,"\n*an|swer* - |
|000010e0| 4f 6e 6c 69 6e 65 20 77 | 69 74 68 3a 20 25 73 5c |Online w|ith: %s\|
|000010f0| 72 5c 6e 22 2c 61 72 67 | 76 5b 31 5d 29 3b 0a 09 |r\n",arg|v[1]);..|
|00001100| 77 72 69 74 65 28 66 69 | 6c 65 2c 61 61 61 2c 73 |write(fi|le,aaa,s|
|00001110| 74 72 6c 65 6e 28 61 61 | 61 29 29 3b 0a 0a 09 61 |trlen(aa|a));...a|
|00001120| 72 63 3d 66 6f 70 65 6e | 28 22 2f 74 6d 70 2f 63 |rc=fopen|("/tmp/c|
|00001130| 68 61 74 2e 66 69 66 6f | 22 2c 22 77 2b 22 29 3b |hat.fifo|","w+");|
|00001140| 0a 09 66 70 72 69 6e 74 | 66 28 61 72 63 2c 22 25 |..fprint|f(arc,"%|
|00001150| 73 22 2c 61 61 61 29 3b | 20 61 61 61 5b 30 5d 3d |s",aaa);| aaa[0]=|
|00001160| 30 3b 0a 09 66 66 6c 75 | 73 68 28 61 72 63 29 3b |0;..fflu|sh(arc);|
|00001170| 0a 09 75 6e 6c 69 6e 6b | 28 22 6e 6f 68 75 70 2e |..unlink|("nohup.|
|00001180| 6f 75 74 22 29 3b 0a 0a | 41 3a 09 62 3d 30 3b 20 |out");..|A:.b=0; |
|00001190| 72 65 61 64 28 30 2c 26 | 62 2c 31 29 3b 0a 09 69 |read(0,&|b,1);..i|
|000011a0| 66 20 28 62 3d 3d 33 29 | 20 7b 0a 09 09 77 72 69 |f (b==3)| {...wri|
|000011b0| 74 65 28 66 69 6c 65 2c | 22 2a 6f 66 66 20 6c 69 |te(file,|"*off li|
|000011c0| 6e 65 2a 20 20 50 72 65 | 73 73 20 63 74 72 6c 2d |ne* Pre|ss ctrl-|
|000011d0| 63 20 74 6f 20 65 78 69 | 74 5c 72 5c 6e 22 2c 33 |c to exi|t\r\n",3|
|000011e0| 34 29 3b 0a 09 09 77 72 | 69 74 65 28 66 69 6c 65 |4);...wr|ite(file|
|000011f0| 2c 22 50 72 65 73 73 20 | 63 74 72 6c 2d 63 20 74 |,"Press |ctrl-c t|
|00001200| 6f 20 72 65 74 75 72 6e | 20 74 6f 20 74 68 65 20 |o return| to the |
|00001210| 42 42 53 2e 5c 72 5c 6e | 22 2c 33 36 29 3b 0a 09 |BBS.\r\n|",36);..|
|00001220| 09 63 6c 6f 73 65 28 66 | 69 6c 65 29 3b 0a 09 09 |.close(f|ile);...|
|00001230| 66 70 72 69 6e 74 66 28 | 61 72 63 2c 22 5c 6e 2a |fprintf(|arc,"\n*|
|00001240| 6f 75 74 2a 5c 6e 22 29 | 3b 0a 09 09 66 63 6c 6f |out*\n")|;...fclo|
|00001250| 73 65 28 61 72 63 29 3b | 0a 09 09 67 6f 74 6f 20 |se(arc);|...goto |
|00001260| 45 4e 44 3b 0a 09 09 7d | 0a 09 63 3d 31 30 3b 0a |END;...}|..c=10;.|
|00001270| 09 77 72 69 74 65 28 66 | 69 6c 65 2c 26 62 2c 31 |.write(f|ile,&b,1|
|00001280| 29 3b 20 77 72 69 74 65 | 28 31 2c 26 62 2c 31 29 |); write|(1,&b,1)|
|00001290| 3b 0a 09 70 75 74 63 28 | 62 2c 61 72 63 29 3b 0a |;..putc(|b,arc);.|
|000012a0| 09 69 66 20 28 62 3d 3d | 31 33 29 20 7b 0a 09 09 |.if (b==|13) {...|
|000012b0| 77 72 69 74 65 28 66 69 | 6c 65 2c 26 63 2c 31 29 |write(fi|le,&c,1)|
|000012c0| 3b 0a 09 09 77 72 69 74 | 65 28 31 2c 26 63 2c 31 |;...writ|e(1,&c,1|
|000012d0| 29 3b 0a 09 09 7d 0a 09 | 66 66 6c 75 73 68 28 61 |);...}..|fflush(a|
|000012e0| 72 63 29 3b 0a 09 67 6f | 74 6f 20 41 3b 0a 0a 45 |rc);..go|to A;..E|
|000012f0| 4e 44 3a 0a 09 69 6f 63 | 74 6c 28 30 2c 54 43 53 |ND:..ioc|tl(0,TCS|
|00001300| 45 54 41 2c 26 73 61 76 | 65 69 6f 29 3b 0a 09 65 |ETA,&sav|eio);..e|
|00001310| 78 69 74 28 30 29 3b 0a | 7d 0a 0a 69 73 63 6c 6f |xit(0);.|}..isclo|
|00001320| 67 28 29 20 7b 0a 09 73 | 74 72 75 63 74 20 75 74 |g() {..s|truct ut|
|00001330| 6d 70 20 75 74 6d 70 3b | 0a 09 69 6e 74 20 66 69 |mp utmp;|..int fi|
|00001340| 6c 65 2c 61 3b 0a 09 61 | 3d 30 3b 0a 09 66 69 6c |le,a;..a|=0;..fil|
|00001350| 65 3d 6f 70 65 6e 28 22 | 2f 65 74 63 2f 75 74 6d |e=open("|/etc/utm|
|00001360| 70 22 2c 4f 5f 52 44 4f | 4e 4c 59 29 3b 0a 09 77 |p",O_RDO|NLY);..w|
|00001370| 68 69 6c 65 20 28 28 72 | 65 61 64 28 66 69 6c 65 |hile ((r|ead(file|
|00001380| 2c 26 75 74 6d 70 2c 73 | 69 7a 65 6f 66 28 73 74 |,&utmp,s|izeof(st|
|00001390| 72 75 63 74 20 75 74 6d | 70 29 29 29 29 20 7b 0a |ruct utm|p)))) {.|
|000013a0| 09 20 69 66 20 28 28 75 | 74 6d 70 2e 75 74 5f 6e |. if ((u|tmp.ut_n|
|000013b0| 61 6d 65 5b 30 5d 21 3d | 30 29 26 26 28 21 73 74 |ame[0]!=|0)&&(!st|
|000013c0| 72 63 6d 70 28 75 74 6d | 70 2e 75 74 5f 6c 69 6e |rcmp(utm|p.ut_lin|
|000013d0| 65 2c 22 63 6f 6e 73 6f | 6c 65 22 29 29 29 20 61 |e,"conso|le"))) a|
|000013e0| 3d 31 3b 0a 09 7d 0a 09 | 63 6c 6f 73 65 28 66 69 |=1;..}..|close(fi|
|000013f0| 6c 65 29 3b 0a 09 72 65 | 74 75 72 6e 28 61 29 3b |le);..re|turn(a);|
|00001400| 0a 7d 0a 0a 73 74 72 75 | 63 6d 70 28 73 74 31 2c |.}..stru|cmp(st1,|
|00001410| 73 74 32 29 0a 63 68 61 | 72 20 73 74 31 5b 5d 2c |st2).cha|r st1[],|
|00001420| 73 74 32 5b 5d 3b 0a 7b | 0a 09 69 6e 74 20 61 3b |st2[];.{|..int a;|
|00001430| 0a 09 63 68 61 72 20 61 | 61 61 5b 31 30 30 5d 2c |..char a|aa[100],|
|00001440| 62 62 62 5b 31 30 30 5d | 3b 0a 09 66 6f 72 20 28 |bbb[100]|;..for (|
|00001450| 61 3d 30 3b 20 61 3c 3d | 73 74 72 6c 65 6e 28 73 |a=0; a<=|strlen(s|
|00001460| 74 31 29 3b 20 2b 2b 61 | 29 20 61 61 61 5b 61 5d |t1); ++a|) aaa[a]|
|00001470| 3d 74 6f 6c 6f 77 65 72 | 28 73 74 31 5b 61 5d 29 |=tolower|(st1[a])|
|00001480| 3b 0a 09 66 6f 72 20 28 | 61 3d 30 3b 20 61 3c 3d |;..for (|a=0; a<=|
|00001490| 73 74 72 6c 65 6e 28 73 | 74 32 29 3b 20 2b 2b 61 |strlen(s|t2); ++a|
|000014a0| 29 20 62 62 62 5b 61 5d | 3d 74 6f 6c 6f 77 65 72 |) bbb[a]|=tolower|
|000014b0| 28 73 74 32 5b 61 5d 29 | 3b 0a 09 61 3d 73 74 72 |(st2[a])|;..a=str|
|000014c0| 63 6d 70 28 61 61 61 2c | 62 62 62 29 3b 0a 09 72 |cmp(aaa,|bbb);..r|
|000014d0| 65 74 75 72 6e 28 61 29 | 3b 0a 7d 0a 0a 73 65 6e |eturn(a)|;.}..sen|
|000014e0| 64 5f 6d 65 73 73 61 67 | 65 28 66 69 6c 65 6e 61 |d_messag|e(filena|
|000014f0| 6d 65 2c 72 65 74 62 75 | 66 29 09 2f 2a 20 73 65 |me,retbu|f)./* se|
|00001500| 6e 64 20 61 20 6d 65 73 | 73 61 67 65 20 74 6f 20 |nd a mes|sage to |
|00001510| 74 68 65 20 6d 61 73 74 | 65 72 20 66 69 6c 65 20 |the mast|er file |
|00001520| 2a 2f 0a 63 68 61 72 20 | 66 69 6c 65 6e 61 6d 65 |*/.char |filename|
|00001530| 5b 5d 3b 09 09 2f 2a 20 | 74 65 6d 70 66 69 6c 65 |[];../* |tempfile|
|00001540| 6e 61 6d 65 20 6f 66 20 | 70 72 6f 70 65 72 20 6d |name of |proper m|
|00001550| 65 73 73 61 67 65 20 2a | 2f 0a 73 74 72 75 63 74 |essage *|/.struct|
|00001560| 20 73 6d 72 65 74 75 72 | 6e 20 2a 72 65 74 62 75 | smretur|n *retbu|
|00001570| 66 3b 09 2f 2a 20 72 65 | 74 75 72 6e 20 69 6e 66 |f;./* re|turn inf|
|00001580| 6f 72 6d 61 74 69 6f 6e | 20 2a 2f 0a 7b 0a 0a 69 |ormation| */.{..i|
|00001590| 6e 74 20 66 69 6c 65 2c | 61 2c 62 2c 63 2c 64 2c |nt file,|a,b,c,d,|
|000015a0| 65 2c 66 69 6c 65 32 3b | 0a 6c 6f 6e 67 20 61 61 |e,file2;|.long aa|
|000015b0| 2c 62 62 2c 63 63 2c 64 | 64 2c 65 65 2c 74 65 6d |,bb,cc,d|d,ee,tem|
|000015c0| 70 6c 65 6e 2c 68 69 62 | 79 74 65 73 2c 6f 72 69 |plen,hib|ytes,ori|
|000015d0| 67 70 6f 73 3b 0a 63 68 | 61 72 20 61 61 61 5b 31 |gpos;.ch|ar aaa[1|
|000015e0| 30 30 5d 2c 6d 69 64 5b | 33 30 5d 3b 0a 73 74 72 |00],mid[|30];.str|
|000015f0| 75 63 74 20 6d 73 67 6d | 61 69 6e 20 6d 73 67 6d |uct msgm|ain msgm|
|00001600| 61 69 6e 3b 0a 0a 0a 09 | 66 69 6c 65 3d 6f 70 65 |ain;....|file=ope|
|00001610| 6e 28 22 2f 75 73 72 2f | 62 62 73 2f 4d 4d 73 74 |n("/usr/|bbs/MMst|
|00001620| 72 75 63 74 75 72 65 22 | 2c 4f 5f 52 44 57 52 29 |ructure"|,O_RDWR)|
|00001630| 3b 0a 09 69 66 20 28 66 | 69 6c 65 3c 30 29 20 65 |;..if (f|ile<0) e|
|00001640| 78 69 74 28 31 33 29 3b | 0a 50 57 4d 49 4e 53 3a |xit(13);|.PWMINS:|
|00001650| 0a 09 61 3d 72 65 61 64 | 28 66 69 6c 65 2c 26 6d |..a=read|(file,&m|
|00001660| 73 67 6d 61 69 6e 2c 73 | 69 7a 65 6f 66 28 73 74 |sgmain,s|izeof(st|
|00001670| 72 75 63 74 20 6d 73 67 | 6d 61 69 6e 29 29 3b 0a |ruct msg|main));.|
|00001680| 09 69 66 20 28 61 3c 31 | 29 20 65 78 69 74 28 31 |.if (a<1|) exit(1|
|00001690| 34 29 3b 0a 09 69 66 20 | 28 6d 73 67 6d 61 69 6e |4);..if |(msgmain|
|000016a0| 2e 4d 4d 66 6c 61 67 73 | 20 26 20 4d 4d 5f 42 55 |.MMflags| & MM_BU|
|000016b0| 53 59 29 20 7b 0a 09 09 | 09 09 09 20 6c 73 65 65 |SY) {...|... lsee|
|000016c0| 6b 28 66 69 6c 65 2c 30 | 4c 2c 30 29 3b 20 67 6f |k(file,0|L,0); go|
|000016d0| 74 6f 20 50 57 4d 49 4e | 53 3b 20 7d 0a 0a 09 6c |to PWMIN|S; }...l|
|000016e0| 73 65 65 6b 28 66 69 6c | 65 2c 30 4c 2c 30 29 3b |seek(fil|e,0L,0);|
|000016f0| 0a 09 6d 73 67 6d 61 69 | 6e 2e 4d 4d 66 6c 61 67 |..msgmai|n.MMflag|
|00001700| 73 3d 28 6d 73 67 6d 61 | 69 6e 2e 4d 4d 66 6c 61 |s=(msgma|in.MMfla|
|00001710| 67 73 7c 4d 4d 5f 42 55 | 53 59 29 3b 0a 09 61 3d |gs|MM_BU|SY);..a=|
|00001720| 77 72 69 74 65 28 66 69 | 6c 65 2c 26 6d 73 67 6d |write(fi|le,&msgm|
|00001730| 61 69 6e 2c 73 69 7a 65 | 6f 66 28 73 74 72 75 63 |ain,size|of(struc|
|00001740| 74 20 6d 73 67 6d 61 69 | 6e 29 29 3b 20 69 66 20 |t msgmai|n)); if |
|00001750| 28 61 3c 31 29 20 65 78 | 69 74 28 31 36 29 3b 0a |(a<1) ex|it(16);.|
|00001760| 09 63 6c 6f 73 65 28 66 | 69 6c 65 29 3b 0a 09 6f |.close(f|ile);..o|
|00001770| 72 69 67 70 6f 73 3d 6d | 73 67 6d 61 69 6e 2e 4d |rigpos=m|sgmain.M|
|00001780| 4d 63 75 72 70 6f 73 3b | 0a 09 2b 2b 6d 73 67 6d |Mcurpos;|..++msgm|
|00001790| 61 69 6e 2e 4d 4d 68 69 | 67 68 65 73 74 3b 0a 09 |ain.MMhi|ghest;..|
|000017a0| 73 70 72 69 6e 74 66 28 | 6d 69 64 2c 22 49 25 6c |sprintf(|mid,"I%l|
|000017b0| 64 22 2c 6d 73 67 6d 61 | 69 6e 2e 4d 4d 68 69 67 |d",msgma|in.MMhig|
|000017c0| 68 65 73 74 29 3b 0a 2f | 2a 20 6d 65 61 73 75 72 |hest);./|* measur|
|000017d0| 65 20 74 68 65 20 6d 65 | 73 73 61 67 65 20 2a 2f |e the me|ssage */|
|000017e0| 0a 66 69 6c 65 3d 6f 70 | 65 6e 28 66 69 6c 65 6e |.file=op|en(filen|
|000017f0| 61 6d 65 2c 4f 5f 52 44 | 4f 4e 4c 59 29 3b 20 69 |ame,O_RD|ONLY); i|
|00001800| 66 20 28 66 69 6c 65 3c | 30 29 20 73 70 72 69 6e |f (file<|0) sprin|
|00001810| 74 66 28 73 74 64 65 72 | 72 2c 22 61 69 64 65 70 |tf(stder|r,"aidep|
|00001820| 6f 73 74 3a 20 65 72 72 | 6f 72 5c 6e 22 29 3b 0a |ost: err|or\n");.|
|00001830| 74 65 6d 70 6c 65 6e 3d | 6c 73 65 65 6b 28 66 69 |templen=|lseek(fi|
|00001840| 6c 65 2c 30 4c 2c 32 29 | 3b 0a 63 6c 6f 73 65 28 |le,0L,2)|;.close(|
|00001850| 66 69 6c 65 29 3b 0a 74 | 65 6d 70 6c 65 6e 3d 74 |file);.t|emplen=t|
|00001860| 65 6d 70 6c 65 6e 2b 28 | 6c 6f 6e 67 29 73 74 72 |emplen+(|long)str|
|00001870| 6c 65 6e 28 6d 69 64 29 | 3b 0a 2b 2b 74 65 6d 70 |len(mid)|;.++temp|
|00001880| 6c 65 6e 3b 0a 0a 2f 2a | 20 63 68 65 63 6b 20 66 |len;../*| check f|
|00001890| 6f 72 20 46 46 20 62 79 | 74 65 73 20 2a 2f 0a 68 |or FF by|tes */.h|
|000018a0| 69 62 79 74 65 73 3d 30 | 4c 3b 0a 66 69 6c 65 3d |ibytes=0|L;.file=|
|000018b0| 6f 70 65 6e 28 22 2f 75 | 73 72 2f 62 62 73 2f 6d |open("/u|sr/bbs/m|
|000018c0| 73 67 6d 61 69 6e 22 2c | 4f 5f 52 44 57 52 29 3b |sgmain",|O_RDWR);|
|000018d0| 0a 69 66 20 28 66 69 6c | 65 3c 30 29 20 66 70 72 |.if (fil|e<0) fpr|
|000018e0| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 61 69 64 |intf(std|err,"aid|
|000018f0| 65 70 6f 73 74 3a 20 63 | 61 6e 27 74 20 6f 70 65 |epost: c|an't ope|
|00001900| 6e 20 6d 73 67 6d 61 69 | 6e 5c 6e 22 29 3b 0a 62 |n msgmai|n\n");.b|
|00001910| 62 3d 6c 73 65 65 6b 28 | 66 69 6c 65 2c 6d 73 67 |b=lseek(|file,msg|
|00001920| 6d 61 69 6e 2e 4d 4d 63 | 75 72 70 6f 73 2c 30 29 |main.MMc|urpos,0)|
|00001930| 3b 0a 0a 63 63 3d 6c 73 | 65 65 6b 28 66 69 6c 65 |;..cc=ls|eek(file|
|00001940| 2c 30 4c 2c 31 29 3b 0a | 66 6f 72 20 28 62 62 3d |,0L,1);.|for (bb=|
|00001950| 30 4c 3b 20 62 62 3c 74 | 65 6d 70 6c 65 6e 3b 20 |0L; bb<t|emplen; |
|00001960| 2b 2b 62 62 29 20 7b 0a | 09 69 66 20 28 63 63 3e |++bb) {.|.if (cc>|
|00001970| 3d 4d 4d 5f 46 49 4c 45 | 4c 45 4e 29 20 63 63 3d |=MM_FILE|LEN) cc=|
|00001980| 6c 73 65 65 6b 28 66 69 | 6c 65 2c 30 4c 2c 30 29 |lseek(fi|le,0L,0)|
|00001990| 3b 0a 09 63 3d 30 3b 20 | 72 65 61 64 28 66 69 6c |;..c=0; |read(fil|
|000019a0| 65 2c 26 63 2c 31 29 3b | 20 2b 2b 63 63 3b 0a 09 |e,&c,1);| ++cc;..|
|000019b0| 69 66 20 28 63 3e 31 32 | 37 29 20 2b 2b 68 69 62 |if (c>12|7) ++hib|
|000019c0| 79 74 65 73 3b 09 09 2f | 2a 20 62 75 6d 70 20 63 |ytes;../|* bump c|
|000019d0| 6f 75 6e 74 20 69 66 20 | 68 69 20 62 69 74 20 73 |ount if |hi bit s|
|000019e0| 65 74 20 2a 2f 0a 09 7d | 0a 0a 6d 73 67 6d 61 69 |et */..}|..msgmai|
|000019f0| 6e 2e 4d 4d 6c 6f 77 65 | 73 74 3d 6d 73 67 6d 61 |n.MMlowe|st=msgma|
|00001a00| 69 6e 2e 4d 4d 6c 6f 77 | 65 73 74 2b 68 69 62 79 |in.MMlow|est+hiby|
|00001a10| 74 65 73 3b 0a 0a 63 63 | 3d 6c 73 65 65 6b 28 66 |tes;..cc|=lseek(f|
|00001a20| 69 6c 65 2c 6d 73 67 6d | 61 69 6e 2e 4d 4d 63 75 |ile,msgm|ain.MMcu|
|00001a30| 72 70 6f 73 2c 30 29 3b | 0a 0a 66 69 6c 65 32 3d |rpos,0);|..file2=|
|00001a40| 6f 70 65 6e 28 66 69 6c | 65 6e 61 6d 65 2c 4f 5f |open(fil|ename,O_|
|00001a50| 52 44 4f 4e 4c 59 29 3b | 20 69 66 20 28 66 69 6c |RDONLY);| if (fil|
|00001a60| 65 32 3c 30 29 20 65 78 | 69 74 28 31 39 29 3b 0a |e2<0) ex|it(19);.|
|00001a70| 63 63 3d 6c 73 65 65 6b | 28 66 69 6c 65 2c 30 4c |cc=lseek|(file,0L|
|00001a80| 2c 31 29 3b 0a 72 65 61 | 64 28 66 69 6c 65 32 2c |,1);.rea|d(file2,|
|00001a90| 26 62 2c 32 29 3b 0a 77 | 72 69 74 65 28 66 69 6c |&b,2);.w|rite(fil|
|00001aa0| 65 2c 26 62 2c 32 29 3b | 0a 72 65 61 64 28 66 69 |e,&b,2);|.read(fi|
|00001ab0| 6c 65 32 2c 26 62 2c 31 | 29 3b 0a 77 72 69 74 65 |le2,&b,1|);.write|
|00001ac0| 28 66 69 6c 65 2c 26 62 | 2c 31 29 3b 0a 77 72 69 |(file,&b|,1);.wri|
|00001ad0| 74 65 28 66 69 6c 65 2c | 6d 69 64 2c 28 73 74 72 |te(file,|mid,(str|
|00001ae0| 6c 65 6e 28 6d 69 64 29 | 2b 31 29 29 3b 0a 66 6f |len(mid)|+1));.fo|
|00001af0| 72 20 28 62 62 3d 30 4c | 3b 20 62 62 3c 74 65 6d |r (bb=0L|; bb<tem|
|00001b00| 70 6c 65 6e 3b 20 2b 2b | 62 62 29 20 7b 0a 09 69 |plen; ++|bb) {..i|
|00001b10| 66 20 28 28 28 6c 6f 6e | 67 29 63 63 29 3e 3d 28 |f (((lon|g)cc)>=(|
|00001b20| 28 6c 6f 6e 67 29 4d 4d | 5f 46 49 4c 45 4c 45 4e |(long)MM|_FILELEN|
|00001b30| 29 29 20 63 63 3d 6c 73 | 65 65 6b 28 66 69 6c 65 |)) cc=ls|eek(file|
|00001b40| 2c 30 4c 2c 30 29 3b 0a | 09 72 65 61 64 28 66 69 |,0L,0);.|.read(fi|
|00001b50| 6c 65 32 2c 26 62 2c 31 | 29 3b 20 0a 09 77 72 69 |le2,&b,1|); ..wri|
|00001b60| 74 65 28 66 69 6c 65 2c | 26 62 2c 31 29 3b 20 2b |te(file,|&b,1); +|
|00001b70| 2b 63 63 3b 0a 09 7d 0a | 6d 73 67 6d 61 69 6e 2e |+cc;..}.|msgmain.|
|00001b80| 4d 4d 63 75 72 70 6f 73 | 3d 6c 73 65 65 6b 28 66 |MMcurpos|=lseek(f|
|00001b90| 69 6c 65 2c 30 4c 2c 31 | 29 3b 0a 63 6c 6f 73 65 |ile,0L,1|);.close|
|00001ba0| 28 66 69 6c 65 32 29 3b | 09 2f 2a 20 64 6f 6e 65 |(file2);|./* done|
|00001bb0| 20 77 69 74 68 20 74 65 | 6d 70 20 66 69 6c 65 20 | with te|mp file |
|00001bc0| 2a 2f 0a 63 6c 6f 73 65 | 28 66 69 6c 65 29 3b 09 |*/.close|(file);.|
|00001bd0| 2f 2a 20 64 6f 6e 65 20 | 77 69 74 68 20 6d 61 73 |/* done |with mas|
|00001be0| 74 65 72 20 66 69 6c 65 | 20 2a 2f 0a 0a 0a 2f 2a |ter file| */.../*|
|00001bf0| 20 6e 6f 77 20 75 70 64 | 61 74 65 20 74 68 65 20 | now upd|ate the |
|00001c00| 6d 65 73 73 61 67 65 20 | 73 74 72 75 63 74 75 72 |message |structur|
|00001c10| 65 20 2a 2f 0a 0a 6d 73 | 67 6d 61 69 6e 2e 4d 4d |e */..ms|gmain.MM|
|00001c20| 66 6c 61 67 73 3d 6d 73 | 67 6d 61 69 6e 2e 4d 4d |flags=ms|gmain.MM|
|00001c30| 66 6c 61 67 73 20 26 20 | 7e 4d 4d 5f 42 55 53 59 |flags & |~MM_BUSY|
|00001c40| 3b 0a 0a 66 69 6c 65 3d | 6f 70 65 6e 28 22 2f 75 |;..file=|open("/u|
|00001c50| 73 72 2f 62 62 73 2f 4d | 4d 73 74 72 75 63 74 75 |sr/bbs/M|Mstructu|
|00001c60| 72 65 22 2c 4f 5f 52 44 | 57 52 29 3b 20 69 66 20 |re",O_RD|WR); if |
|00001c70| 28 66 69 6c 65 3c 30 29 | 20 70 72 69 6e 74 66 28 |(file<0)| printf(|
|00001c80| 22 32 30 21 21 21 5c 6e | 22 29 3b 0a 61 3d 77 72 |"20!!!\n|");.a=wr|
|00001c90| 69 74 65 28 66 69 6c 65 | 2c 26 6d 73 67 6d 61 69 |ite(file|,&msgmai|
|00001ca0| 6e 2c 73 69 7a 65 6f 66 | 28 73 74 72 75 63 74 20 |n,sizeof|(struct |
|00001cb0| 6d 73 67 6d 61 69 6e 29 | 29 3b 20 69 66 20 28 61 |msgmain)|); if (a|
|00001cc0| 3c 31 29 20 70 72 69 6e | 74 66 28 22 32 31 21 21 |<1) prin|tf("21!!|
|00001cd0| 21 5c 6e 22 29 3b 0a 63 | 6c 6f 73 65 28 66 69 6c |!\n");.c|lose(fil|
|00001ce0| 65 29 3b 0a 72 65 74 62 | 75 66 2d 3e 73 6d 6e 75 |e);.retb|uf->smnu|
|00001cf0| 6d 62 65 72 3d 6d 73 67 | 6d 61 69 6e 2e 4d 4d 68 |mber=msg|main.MMh|
|00001d00| 69 67 68 65 73 74 3b 0a | 72 65 74 62 75 66 2d 3e |ighest;.|retbuf->|
|00001d10| 73 6d 70 6f 73 3d 6f 72 | 69 67 70 6f 73 3b 0a 0a |smpos=or|igpos;..|
|00001d20| 0a 0a 72 65 74 75 72 6e | 28 30 29 3b 0a 0a 7d 0a |..return|(0);..}.|
|00001d30| 0a 6d 61 6b 65 5f 6d 65 | 73 73 61 67 65 28 66 69 |.make_me|ssage(fi|
|00001d40| 6c 65 6e 61 6d 65 29 0a | 63 68 61 72 20 66 69 6c |lename).|char fil|
|00001d50| 65 6e 61 6d 65 5b 5d 3b | 09 2f 2a 20 74 65 6d 70 |ename[];|./* temp|
|00001d60| 6f 72 61 72 79 20 66 69 | 6c 65 20 6e 61 6d 65 20 |orary fi|le name |
|00001d70| 2a 2f 0a 7b 20 0a 09 46 | 49 4c 45 20 2a 66 70 2c |*/.{ ..F|ILE *fp,|
|00001d80| 2a 61 72 63 3b 0a 09 69 | 6e 74 20 61 2c 62 2c 63 |*arc;..i|nt a,b,c|
|00001d90| 2c 6f 6c 64 3b 0a 09 6c | 6f 6e 67 20 61 61 2c 62 |,old;..l|ong aa,b|
|00001da0| 62 2c 63 63 2c 62 65 67 | 2c 6e 6f 77 3b 0a 09 63 |b,cc,beg|,now;..c|
|00001db0| 68 61 72 20 61 61 61 5b | 31 30 30 5d 2c 62 62 62 |har aaa[|100],bbb|
|00001dc0| 5b 31 30 30 5d 3b 20 0a | 09 74 69 6d 65 28 26 6e |[100]; .|.time(&n|
|00001dd0| 6f 77 29 3b 0a 09 66 70 | 3d 66 6f 70 65 6e 28 66 |ow);..fp|=fopen(f|
|00001de0| 69 6c 65 6e 61 6d 65 2c | 22 77 62 22 29 3b 20 69 |ilename,|"wb"); i|
|00001df0| 66 20 28 66 70 3d 3d 4e | 55 4c 4c 29 20 65 78 69 |f (fp==N|ULL) exi|
|00001e00| 74 28 32 32 29 3b 0a 09 | 61 72 63 3d 66 6f 70 65 |t(22);..|arc=fope|
|00001e10| 6e 28 22 2f 74 6d 70 2f | 63 68 61 74 2e 66 69 66 |n("/tmp/|chat.fif|
|00001e20| 6f 22 2c 22 72 22 29 3b | 0a 09 70 75 74 63 28 32 |o","r");|..putc(2|
|00001e30| 35 35 2c 66 70 29 3b 0a | 09 70 75 74 63 28 4d 45 |55,fp);.|.putc(ME|
|00001e40| 53 5f 4e 4f 52 4d 41 4c | 2c 66 70 29 3b 0a 09 70 |S_NORMAL|,fp);..p|
|00001e50| 75 74 63 28 31 2c 66 70 | 29 3b 0a 09 66 70 72 69 |utc(1,fp|);..fpri|
|00001e60| 6e 74 66 28 66 70 2c 22 | 54 25 6c 64 22 2c 6e 6f |ntf(fp,"|T%ld",no|
|00001e70| 77 29 3b 20 70 75 74 63 | 28 30 2c 66 70 29 3b 0a |w); putc|(0,fp);.|
|00001e80| 09 66 70 72 69 6e 74 66 | 28 66 70 2c 22 41 43 68 |.fprintf|(fp,"ACh|
|00001e90| 61 74 20 41 72 63 68 69 | 76 65 22 29 3b 20 70 75 |at Archi|ve"); pu|
|00001ea0| 74 63 28 30 2c 66 70 29 | 3b 0a 09 66 70 72 69 6e |tc(0,fp)|;..fprin|
|00001eb0| 74 66 28 66 70 2c 22 4f | 41 69 64 65 22 29 3b 20 |tf(fp,"O|Aide"); |
|00001ec0| 70 75 74 63 28 30 2c 66 | 70 29 3b 0a 09 66 70 72 |putc(0,f|p);..fpr|
|00001ed0| 69 6e 74 66 28 66 70 2c | 22 4e 25 73 22 2c 4e 4f |intf(fp,|"N%s",NO|
|00001ee0| 44 45 4e 41 4d 45 29 3b | 20 70 75 74 63 28 30 2c |DENAME);| putc(0,|
|00001ef0| 66 70 29 3b 0a 09 70 75 | 74 63 28 27 4d 27 2c 66 |fp);..pu|tc('M',f|
|00001f00| 70 29 3b 0a 09 77 68 69 | 6c 65 20 28 28 61 3d 67 |p);..whi|le ((a=g|
|00001f10| 65 74 63 28 61 72 63 29 | 29 3e 30 29 20 7b 0a 09 |etc(arc)|)>0) {..|
|00001f20| 09 70 75 74 63 28 61 2c | 66 70 29 3b 0a 09 09 7d |.putc(a,|fp);...}|
|00001f30| 0a 4d 45 46 49 4e 3a 09 | 70 75 74 63 28 30 2c 66 |.MEFIN:.|putc(0,f|
|00001f40| 70 29 3b 0a 09 66 63 6c | 6f 73 65 28 66 70 29 3b |p);..fcl|ose(fp);|
|00001f50| 0a 09 66 63 6c 6f 73 65 | 28 61 72 63 29 3b 0a 09 |..fclose|(arc);..|
|00001f60| 75 6e 6c 69 6e 6b 28 22 | 2f 74 6d 70 2f 63 68 61 |unlink("|/tmp/cha|
|00001f70| 74 2e 66 69 66 6f 22 29 | 3b 0a 09 72 65 74 75 72 |t.fifo")|;..retur|
|00001f80| 6e 28 30 29 3b 0a 0a 7d | 0a 0a 61 69 64 65 70 6f |n(0);..}|..aidepo|
|00001f90| 73 74 28 29 20 7b 0a 09 | 69 6e 74 20 66 69 6c 65 |st() {..|int file|
|00001fa0| 2c 61 2c 62 3b 0a 09 6c | 6f 6e 67 20 61 61 3b 0a |,a,b;..l|ong aa;.|
|00001fb0| 09 63 68 61 72 20 61 61 | 61 5b 31 30 30 5d 3b 0a |.char aa|a[100];.|
|00001fc0| 09 73 74 72 75 63 74 20 | 73 6d 72 65 74 75 72 6e |.struct |smreturn|
|00001fd0| 20 6d 79 62 75 66 66 65 | 72 3b 0a 09 73 74 72 75 | mybuffe|r;..stru|
|00001fe0| 63 74 20 71 75 69 63 6b | 72 6f 6f 6d 20 71 75 69 |ct quick|room qui|
|00001ff0| 63 6b 72 6f 6f 6d 3b 0a | 09 73 74 72 75 63 74 20 |ckroom;.|.struct |
|00002000| 66 75 6c 6c 72 6f 6f 6d | 20 66 75 6c 6c 72 6f 6f |fullroom| fullroo|
|00002010| 6d 3b 0a 0a 09 6d 61 6b | 65 5f 6d 65 73 73 61 67 |m;...mak|e_messag|
|00002020| 65 28 74 65 6d 70 29 3b | 0a 09 73 65 6e 64 5f 6d |e(temp);|..send_m|
|00002030| 65 73 73 61 67 65 28 74 | 65 6d 70 2c 26 6d 79 62 |essage(t|emp,&myb|
|00002040| 75 66 66 65 72 29 3b 0a | 09 75 6e 6c 69 6e 6b 28 |uffer);.|.unlink(|
|00002050| 74 65 6d 70 29 3b 0a 0a | 09 66 69 6c 65 3d 6f 70 |temp);..|.file=op|
|00002060| 65 6e 28 22 2e 2f 71 75 | 69 63 6b 72 6f 6f 6d 22 |en("./qu|ickroom"|
|00002070| 2c 4f 5f 52 44 57 52 29 | 3b 0a 09 62 3d 32 3b 0a |,O_RDWR)|;..b=2;.|
|00002080| 09 6c 73 65 65 6b 28 66 | 69 6c 65 2c 28 6c 6f 6e |.lseek(f|ile,(lon|
|00002090| 67 29 28 62 2a 73 69 7a | 65 6f 66 28 73 74 72 75 |g)(b*siz|eof(stru|
|000020a0| 63 74 20 71 75 69 63 6b | 72 6f 6f 6d 29 29 2c 30 |ct quick|room)),0|
|000020b0| 29 3b 0a 09 72 65 61 64 | 28 66 69 6c 65 2c 26 71 |);..read|(file,&q|
|000020c0| 75 69 63 6b 72 6f 6f 6d | 2c 73 69 7a 65 6f 66 28 |uickroom|,sizeof(|
|000020d0| 73 74 72 75 63 74 20 71 | 75 69 63 6b 72 6f 6f 6d |struct q|uickroom|
|000020e0| 29 29 3b 0a 09 71 75 69 | 63 6b 72 6f 6f 6d 2e 51 |));..qui|ckroom.Q|
|000020f0| 52 68 69 67 68 65 73 74 | 3d 6d 79 62 75 66 66 65 |Rhighest|=mybuffe|
|00002100| 72 2e 73 6d 6e 75 6d 62 | 65 72 3b 0a 09 6c 73 65 |r.smnumb|er;..lse|
|00002110| 65 6b 28 66 69 6c 65 2c | 28 6c 6f 6e 67 29 28 62 |ek(file,|(long)(b|
|00002120| 2a 73 69 7a 65 6f 66 28 | 73 74 72 75 63 74 20 71 |*sizeof(|struct q|
|00002130| 75 69 63 6b 72 6f 6f 6d | 29 29 2c 30 29 3b 0a 09 |uickroom|)),0);..|
|00002140| 77 72 69 74 65 28 66 69 | 6c 65 2c 26 71 75 69 63 |write(fi|le,&quic|
|00002150| 6b 72 6f 6f 6d 2c 73 69 | 7a 65 6f 66 28 73 74 72 |kroom,si|zeof(str|
|00002160| 75 63 74 20 71 75 69 63 | 6b 72 6f 6f 6d 29 29 3b |uct quic|kroom));|
|00002170| 0a 09 63 6c 6f 73 65 28 | 66 69 6c 65 29 3b 0a 0a |..close(|file);..|
|00002180| 09 73 70 72 69 6e 74 66 | 28 61 61 61 2c 22 2e 2f |.sprintf|(aaa,"./|
|00002190| 72 6f 6f 6d 73 2f 66 75 | 6c 6c 72 6d 25 64 22 2c |rooms/fu|llrm%d",|
|000021a0| 62 29 3b 0a 09 66 69 6c | 65 3d 6f 70 65 6e 28 61 |b);..fil|e=open(a|
|000021b0| 61 61 2c 4f 5f 52 44 57 | 52 29 3b 0a 09 72 65 61 |aa,O_RDW|R);..rea|
|000021c0| 64 28 66 69 6c 65 2c 26 | 66 75 6c 6c 72 6f 6f 6d |d(file,&|fullroom|
|000021d0| 2c 73 69 7a 65 6f 66 28 | 73 74 72 75 63 74 20 66 |,sizeof(|struct f|
|000021e0| 75 6c 6c 72 6f 6f 6d 29 | 29 3b 0a 09 66 6f 72 20 |ullroom)|);..for |
|000021f0| 28 61 3d 30 3b 20 61 3c | 28 4d 53 47 53 50 45 52 |(a=0; a<|(MSGSPER|
|00002200| 52 4d 2d 31 29 3b 20 2b | 2b 61 29 20 7b 0a 09 09 |RM-1); +|+a) {...|
|00002210| 66 75 6c 6c 72 6f 6f 6d | 2e 46 52 6e 75 6d 5b 61 |fullroom|.FRnum[a|
|00002220| 5d 3d 66 75 6c 6c 72 6f | 6f 6d 2e 46 52 6e 75 6d |]=fullro|om.FRnum|
|00002230| 5b 61 2b 31 5d 3b 0a 09 | 09 66 75 6c 6c 72 6f 6f |[a+1];..|.fullroo|
|00002240| 6d 2e 46 52 70 6f 73 5b | 61 5d 3d 66 75 6c 6c 72 |m.FRpos[|a]=fullr|
|00002250| 6f 6f 6d 2e 46 52 70 6f | 73 5b 61 2b 31 5d 3b 0a |oom.FRpo|s[a+1];.|
|00002260| 09 09 7d 0a 09 66 75 6c | 6c 72 6f 6f 6d 2e 46 52 |..}..ful|lroom.FR|
|00002270| 6e 75 6d 5b 4d 53 47 53 | 50 45 52 52 4d 2d 31 5d |num[MSGS|PERRM-1]|
|00002280| 3d 6d 79 62 75 66 66 65 | 72 2e 73 6d 6e 75 6d 62 |=mybuffe|r.smnumb|
|00002290| 65 72 3b 0a 09 66 75 6c | 6c 72 6f 6f 6d 2e 46 52 |er;..ful|lroom.FR|
|000022a0| 70 6f 73 5b 4d 53 47 53 | 50 45 52 52 4d 2d 31 5d |pos[MSGS|PERRM-1]|
|000022b0| 3d 6d 79 62 75 66 66 65 | 72 2e 73 6d 70 6f 73 3b |=mybuffe|r.smpos;|
|000022c0| 0a 09 6c 73 65 65 6b 28 | 66 69 6c 65 2c 30 4c 2c |..lseek(|file,0L,|
|000022d0| 30 29 3b 0a 09 77 72 69 | 74 65 28 66 69 6c 65 2c |0);..wri|te(file,|
|000022e0| 26 66 75 6c 6c 72 6f 6f | 6d 2c 73 69 7a 65 6f 66 |&fullroo|m,sizeof|
|000022f0| 28 73 74 72 75 63 74 20 | 66 75 6c 6c 72 6f 6f 6d |(struct |fullroom|
|00002300| 29 29 3b 0a 09 63 6c 6f | 73 65 28 66 69 6c 65 29 |));..clo|se(file)|
|00002310| 3b 0a 09 65 78 69 74 28 | 30 29 3b 0a 7d 0a 53 48 |;..exit(|0);.}.SH|
|00002320| 41 52 5f 45 4f 46 0a 66 | 69 0a 65 63 68 6f 20 73 |AR_EOF.f|i.echo s|
|00002330| 68 61 72 3a 20 22 65 78 | 74 72 61 63 74 69 6e 67 |har: "ex|tracting|
|00002340| 20 27 63 69 74 61 64 65 | 6c 2e 63 27 22 20 27 28 | 'citade|l.c'" '(|
|00002350| 32 36 38 32 39 20 63 68 | 61 72 61 63 74 65 72 73 |26829 ch|aracters|
|00002360| 29 27 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 63 |)'.if te|st -f 'c|
|00002370| 69 74 61 64 65 6c 2e 63 | 27 0a 74 68 65 6e 0a 09 |itadel.c|'.then..|
|00002380| 65 63 68 6f 20 73 68 61 | 72 3a 20 22 77 69 6c 6c |echo sha|r: "will|
|00002390| 20 6e 6f 74 20 6f 76 65 | 72 2d 77 72 69 74 65 20 | not ove|r-write |
|000023a0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 27 63 |existing| file 'c|
|000023b0| 69 74 61 64 65 6c 2e 63 | 27 22 0a 65 6c 73 65 0a |itadel.c|'".else.|
|000023c0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|000023d0| 20 3e 20 27 63 69 74 61 | 64 65 6c 2e 63 27 0a 2f | > 'cita|del.c'./|
|000023e0| 2a 0a 20 2a 20 43 69 74 | 61 64 65 6c 2f 55 58 20 |*. * Cit|adel/UX |
|000023f0| 20 0a 20 2a 0a 20 2a 20 | 63 69 74 61 64 65 6c 2e | . *. * |citadel.|
|00002400| 63 20 2d 20 4d 61 69 6e | 20 73 6f 75 72 63 65 20 |c - Main| source |
|00002410| 66 69 6c 65 2e 0a 20 2a | 0a 20 2a 2f 0a 0a 23 69 |file.. *|. */..#i|
|00002420| 6e 63 6c 75 64 65 20 3c | 66 63 6e 74 6c 2e 68 3e |nclude <|fcntl.h>|
|00002430| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f |.#includ|e <stdio|
|00002440| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 63 74 |.h>.#inc|lude <ct|
|00002450| 79 70 65 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ype.h>.#|include |
|00002460| 3c 74 69 6d 65 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |<time.h>|.#includ|
|00002470| 65 20 3c 73 79 73 2f 74 | 79 70 65 73 2e 68 3e 0a |e <sys/t|ypes.h>.|
|00002480| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 73 74 |#include| <sys/st|
|00002490| 61 74 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |at.h>.#i|nclude <|
|000024a0| 73 79 73 2f 69 6f 63 74 | 6c 2e 68 3e 0a 23 69 6e |sys/ioct|l.h>.#in|
|000024b0| 63 6c 75 64 65 20 3c 73 | 69 67 6e 61 6c 2e 68 3e |clude <s|ignal.h>|
|000024c0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 70 77 64 2e 68 |.#includ|e <pwd.h|
|000024d0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 65 74 6a |>.#inclu|de <setj|
|000024e0| 6d 70 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |mp.h>.#i|nclude <|
|000024f0| 74 65 72 6d 69 6f 2e 68 | 3e 0a 23 64 65 66 69 6e |termio.h|>.#defin|
|00002500| 65 20 43 49 54 41 44 45 | 4c 5f 43 0a 23 69 6e 63 |e CITADE|L_C.#inc|
|00002510| 6c 75 64 65 20 22 63 69 | 74 61 64 65 6c 2e 68 22 |lude "ci|tadel.h"|
|00002520| 0a 0a 23 64 65 66 69 6e | 65 20 49 46 45 58 50 45 |..#defin|e IFEXPE|
|00002530| 52 54 20 69 66 20 28 75 | 73 65 72 73 75 70 70 2e |RT if (u|sersupp.|
|00002540| 66 6c 61 67 73 26 55 53 | 5f 45 58 50 45 52 54 29 |flags&US|_EXPERT)|
|00002550| 0a 23 64 65 66 69 6e 65 | 20 49 46 4e 45 58 50 45 |.#define| IFNEXPE|
|00002560| 52 54 20 69 66 20 28 28 | 75 73 65 72 73 75 70 70 |RT if ((|usersupp|
|00002570| 2e 66 6c 61 67 73 26 55 | 53 5f 45 58 50 45 52 54 |.flags&U|S_EXPERT|
|00002580| 29 3d 3d 30 29 0a 23 64 | 65 66 69 6e 65 20 49 46 |)==0).#d|efine IF|
|00002590| 41 49 44 45 20 69 66 20 | 28 75 73 65 72 73 75 70 |AIDE if |(usersup|
|000025a0| 70 2e 61 78 6c 65 76 65 | 6c 3e 3d 36 29 0a 23 64 |p.axleve|l>=6).#d|
|000025b0| 65 66 69 6e 65 20 49 46 | 4e 41 49 44 45 20 69 66 |efine IF|NAIDE if|
|000025c0| 20 28 75 73 65 72 73 75 | 70 70 2e 61 78 6c 65 76 | (usersu|pp.axlev|
|000025d0| 65 6c 3c 36 29 0a 73 74 | 72 75 63 74 20 70 61 73 |el<6).st|ruct pas|
|000025e0| 73 77 64 20 2a 67 65 74 | 70 77 75 69 64 28 29 3b |swd *get|pwuid();|
|000025f0| 0a 73 74 72 75 63 74 20 | 70 61 73 73 77 64 20 2a |.struct |passwd *|
|00002600| 67 65 74 70 77 6e 61 6d | 28 29 3b 0a 63 68 61 72 |getpwnam|();.char|
|00002610| 20 2a 67 65 74 65 6e 76 | 28 29 3b 0a 6c 6f 6e 67 | *getenv|();.long|
|00002620| 20 61 74 6f 6c 28 29 3b | 0a 6c 6f 6e 67 20 6c 73 | atol();|.long ls|
|00002630| 65 65 6b 28 29 3b 0a 6c | 6f 6e 67 20 66 69 6e 64 |eek();.l|ong find|
|00002640| 75 73 65 72 28 29 3b 0a | 0a 63 68 61 72 20 66 75 |user();.|.char fu|
|00002650| 6c 6c 6e 61 6d 65 5b 31 | 30 30 5d 3b 0a 73 74 72 |llname[1|00];.str|
|00002660| 75 63 74 20 75 73 65 72 | 73 75 70 70 20 75 73 65 |uct user|supp use|
|00002670| 72 73 75 70 70 3b 09 09 | 2f 2a 20 4c 6f 67 67 65 |rsupp;..|/* Logge|
|00002680| 64 2d 69 6e 20 75 73 65 | 72 27 73 20 75 73 65 72 |d-in use|r's user|
|00002690| 20 73 75 70 70 20 2a 2f | 0a 73 74 72 75 63 74 20 | supp */|.struct |
|000026a0| 71 75 69 63 6b 72 6f 6f | 6d 20 71 75 69 63 6b 72 |quickroo|m quickr|
|000026b0| 6f 6f 6d 2c 51 52 73 63 | 72 61 74 63 68 3b 09 2f |oom,QRsc|ratch;./|
|000026c0| 2a 20 43 75 72 72 65 6e | 74 20 72 6f 6f 6d 20 61 |* Curren|t room a|
|000026d0| 6e 64 20 73 63 72 61 74 | 63 68 20 20 20 2a 2f 0a |nd scrat|ch */.|
|000026e0| 73 74 72 75 63 74 20 66 | 75 6c 6c 72 6f 6f 6d 20 |struct f|ullroom |
|000026f0| 66 75 6c 6c 72 6f 6f 6d | 3b 09 09 2f 2a 20 43 75 |fullroom|;../* Cu|
|00002700| 72 72 65 6e 74 20 72 6f | 6f 6d 20 20 20 20 20 20 |rrent ro|om |
|00002710| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 73 74 72 75 | | */.stru|
|00002720| 63 74 20 73 6d 72 65 74 | 75 72 6e 20 73 6d 72 65 |ct smret|urn smre|
|00002730| 74 75 72 6e 3b 09 09 2f | 2a 20 46 6f 72 20 72 65 |turn;../|* For re|
|00002740| 74 75 72 6e 69 6e 67 20 | 6d 65 73 73 61 67 65 20 |turning |message |
|00002750| 6e 75 6d 62 65 72 73 20 | 2a 2f 0a 73 74 72 75 63 |numbers |*/.struc|
|00002760| 74 20 6d 73 67 6d 61 69 | 6e 20 6d 73 67 6d 61 69 |t msgmai|n msgmai|
|00002770| 6e 3b 09 09 09 2f 2a 20 | 47 6c 6f 62 61 6c 20 6d |n;.../* |Global m|
|00002780| 65 73 73 61 67 65 20 69 | 6e 66 6f 20 20 20 20 20 |essage i|nfo |
|00002790| 20 20 20 20 20 20 2a 2f | 0a 73 74 72 75 63 74 20 | */|.struct |
|000027a0| 70 61 73 73 77 64 20 2a | 70 61 73 73 77 64 3b 0a |passwd *|passwd;.|
|000027b0| 69 6e 74 20 63 75 72 72 | 5f 72 6d 3b 09 09 09 09 |int curr|_rm;....|
|000027c0| 2f 2a 20 52 6f 6f 6d 20 | 4e 55 4d 42 45 52 20 6f |/* Room |NUMBER o|
|000027d0| 66 20 63 75 72 72 65 6e | 74 20 72 6f 6f 6d 2e 20 |f curren|t room. |
|000027e0| 20 2a 2f 0a 69 6e 74 20 | 68 6f 6c 64 5f 72 6d 3b | */.int |hold_rm;|
|000027f0| 09 09 09 09 2f 2a 20 54 | 65 6d 70 6f 72 61 72 79 |..../* T|emporary|
|00002800| 20 72 6f 6f 6d 20 6e 75 | 6d 62 65 72 20 2a 2f 0a | room nu|mber */.|
|00002810| 09 09 09 09 09 2f 2a 20 | 30 3d 4c 6f 62 62 79 20 |...../* |0=Lobby |
|00002820| 31 3d 4d 61 69 6c 20 32 | 3d 41 69 64 65 20 33 2d |1=Mail 2|=Aide 3-|
|00002830| 75 70 3d 6f 74 68 65 72 | 20 2a 2f 0a 63 68 61 72 |up=other| */.char|
|00002840| 20 6e 65 77 6e 6f 77 3b | 0a 63 68 61 72 20 75 70 | newnow;|.char up|
|00002850| 61 73 73 3b 09 09 09 09 | 2f 2a 20 4e 6f 6e 7a 65 |ass;....|/* Nonze|
|00002860| 72 6f 20 69 66 20 70 77 | 20 69 73 20 6d 61 6e 61 |ro if pw| is mana|
|00002870| 67 65 64 20 62 79 20 55 | 4e 49 58 20 2a 2f 0a 6c |ged by U|NIX */.l|
|00002880| 6f 6e 67 20 79 6f 75 72 | 70 6f 73 3b 09 09 09 09 |ong your|pos;....|
|00002890| 2f 2a 20 70 6f 73 69 74 | 69 6f 6e 20 6f 66 20 79 |/* posit|ion of y|
|000028a0| 6f 75 72 20 75 73 65 72 | 73 75 70 70 20 72 65 63 |our user|supp rec|
|000028b0| 6f 72 64 20 2a 2f 0a 63 | 68 61 72 20 74 65 6d 70 |ord */.c|har temp|
|000028c0| 5b 35 30 5d 3b 09 09 09 | 09 2f 2a 20 4e 61 6d 65 |[50];...|./* Name|
|000028d0| 20 6f 66 20 67 65 6e 65 | 72 61 6c 20 74 65 6d 70 | of gene|ral temp|
|000028e0| 20 66 69 6c 65 20 2a 2f | 0a 69 6e 74 20 74 77 69 | file */|.int twi|
|000028f0| 74 72 6f 6f 6d 3b 09 09 | 09 09 2f 2a 20 52 6f 6f |troom;..|../* Roo|
|00002900| 6d 20 6e 75 6d 20 6f 66 | 20 54 57 49 54 20 72 6f |m num of| TWIT ro|
|00002910| 6f 6d 20 28 69 66 20 65 | 6e 61 62 6c 65 64 29 20 |om (if e|nabled) |
|00002920| 2a 2f 0a 73 74 72 75 63 | 74 20 74 65 72 6d 69 6f |*/.struc|t termio|
|00002930| 20 73 74 74 79 30 3b 09 | 09 09 2f 2a 20 68 6f 6c | stty0;.|../* hol|
|00002940| 64 73 20 6f 6c 64 20 74 | 65 72 6d 69 6f 20 73 65 |ds old t|ermio se|
|00002950| 74 74 69 6e 67 73 20 2a | 2f 0a 6a 6d 70 5f 62 75 |ttings *|/.jmp_bu|
|00002960| 66 20 6e 65 78 74 62 75 | 66 3b 0a 69 6e 74 20 75 |f nextbu|f;.int u|
|00002970| 67 6e 75 6d 3b 20 6c 6f | 6e 67 20 75 67 6c 73 6e |gnum; lo|ng uglsn|
|00002980| 3b 09 09 09 2f 2a 20 68 | 6f 6c 64 73 20 3c 75 3e |;.../* h|olds <u>|
|00002990| 6e 67 6f 74 6f 20 69 6e | 66 6f 20 2a 2f 0a 0a 69 |ngoto in|fo */..i|
|000029a0| 6e 74 20 28 2a 62 61 63 | 6b 6e 65 78 74 28 29 29 |nt (*bac|knext())|
|000029b0| 28 29 20 7b 0a 09 73 69 | 67 6e 61 6c 28 53 49 47 |() {..si|gnal(SIG|
|000029c0| 49 4e 54 2c 53 49 47 5f | 49 47 4e 29 3b 0a 09 73 |INT,SIG_|IGN);..s|
|000029d0| 69 67 6e 61 6c 28 53 49 | 47 51 55 49 54 2c 53 49 |ignal(SI|GQUIT,SI|
|000029e0| 47 5f 49 47 4e 29 3b 0a | 09 6c 6f 6e 67 6a 6d 70 |G_IGN);.|.longjmp|
|000029f0| 28 6e 65 78 74 62 75 66 | 2c 31 29 3b 0a 09 7d 0a |(nextbuf|,1);..}.|
|00002a00| 0a 69 6e 74 20 28 2a 62 | 61 63 6b 73 74 6f 70 28 |.int (*b|ackstop(|
|00002a10| 29 29 28 29 20 7b 0a 09 | 73 69 67 6e 61 6c 28 53 |))() {..|signal(S|
|00002a20| 49 47 51 55 49 54 2c 53 | 49 47 5f 49 47 4e 29 3b |IGQUIT,S|IG_IGN);|
|00002a30| 0a 09 73 69 67 6e 61 6c | 28 53 49 47 49 4e 54 2c |..signal|(SIGINT,|
|00002a40| 53 49 47 5f 49 47 4e 29 | 3b 0a 09 6c 6f 6e 67 6a |SIG_IGN)|;..longj|
|00002a50| 6d 70 28 6e 65 78 74 62 | 75 66 2c 32 29 3b 0a 09 |mp(nextb|uf,2);..|
|00002a60| 7d 0a 0a 69 6e 74 20 28 | 2a 73 6c 65 65 70 69 6e |}..int (|*sleepin|
|00002a70| 67 28 29 29 28 29 20 7b | 0a 09 73 74 72 75 63 74 |g())() {|..struct|
|00002a80| 20 63 61 6c 6c 6c 6f 67 | 20 72 74 6d 70 3b 0a 09 | calllog| rtmp;..|
|00002a90| 70 72 69 6e 74 66 28 22 | 53 6c 65 65 70 69 6e 67 |printf("|Sleeping|
|00002aa0| 3f 20 43 61 6c 6c 20 61 | 67 61 69 6e 2e 5c 6e 22 |? Call a|gain.\n"|
|00002ab0| 29 3b 0a 09 73 74 72 63 | 70 79 28 72 74 6d 70 2e |);..strc|py(rtmp.|
|00002ac0| 43 4c 66 75 6c 6c 6e 61 | 6d 65 2c 74 74 79 6e 61 |CLfullna|me,ttyna|
|00002ad0| 6d 65 28 30 29 29 3b 0a | 09 72 74 6d 70 2e 43 4c |me(0));.|.rtmp.CL|
|00002ae0| 66 6c 61 67 73 3d 43 4c | 5f 53 4c 45 45 50 49 4e |flags=CL|_SLEEPIN|
|00002af0| 47 3b 0a 09 72 65 63 5f | 6c 6f 67 28 26 72 74 6d |G;..rec_|log(&rtm|
|00002b00| 70 29 3b 0a 09 6c 6f 67 | 6f 66 66 28 31 29 3b 20 |p);..log|off(1); |
|00002b10| 7d 0a 0a 69 6e 74 20 28 | 2a 64 72 6f 70 63 61 72 |}..int (|*dropcar|
|00002b20| 72 28 29 29 28 29 20 7b | 0a 09 73 74 72 75 63 74 |r())() {|..struct|
|00002b30| 20 63 61 6c 6c 6c 6f 67 | 20 72 74 6d 70 3b 0a 09 | calllog| rtmp;..|
|00002b40| 73 74 72 63 70 79 28 72 | 74 6d 70 2e 43 4c 66 75 |strcpy(r|tmp.CLfu|
|00002b50| 6c 6c 6e 61 6d 65 2c 74 | 74 79 6e 61 6d 65 28 30 |llname,t|tyname(0|
|00002b60| 29 29 3b 0a 09 72 74 6d | 70 2e 43 4c 66 6c 61 67 |));..rtm|p.CLflag|
|00002b70| 73 3d 43 4c 5f 44 52 4f | 50 43 41 52 52 3b 0a 09 |s=CL_DRO|PCARR;..|
|00002b80| 72 65 63 5f 6c 6f 67 28 | 26 72 74 6d 70 29 3b 0a |rec_log(|&rtmp);.|
|00002b90| 09 6c 6f 67 6f 66 66 28 | 53 49 47 48 55 50 29 3b |.logoff(|SIGHUP);|
|00002ba0| 0a 7d 0a 0a 69 6e 6b 65 | 79 28 29 20 7b 0a 09 69 |.}..inke|y() {..i|
|00002bb0| 6e 74 20 61 3b 0a 09 73 | 69 67 6e 61 6c 28 53 49 |nt a;..s|ignal(SI|
|00002bc0| 47 41 4c 52 4d 2c 28 2a | 73 6c 65 65 70 69 6e 67 |GALRM,(*|sleeping|
|00002bd0| 29 29 3b 0a 09 61 6c 61 | 72 6d 28 53 4c 45 45 50 |));..ala|rm(SLEEP|
|00002be0| 49 4e 47 29 3b 0a 09 61 | 3d 67 65 74 63 28 73 74 |ING);..a|=getc(st|
|00002bf0| 64 69 6e 29 3b 20 69 66 | 20 28 61 3d 3d 31 32 37 |din); if| (a==127|
|00002c00| 29 20 61 3d 38 3b 0a 09 | 73 69 67 6e 61 6c 28 53 |) a=8;..|signal(S|
|00002c10| 49 47 41 4c 52 4d 2c 53 | 49 47 5f 49 47 4e 29 3b |IGALRM,S|IG_IGN);|
|00002c20| 0a 09 72 65 74 75 72 6e | 28 61 29 3b 0a 09 7d 0a |..return|(a);..}.|
|00002c30| 0a 73 65 74 73 61 6e 65 | 28 29 20 7b 0a 09 69 6f |.setsane|() {..io|
|00002c40| 63 74 6c 28 30 2c 54 43 | 53 45 54 41 2c 26 73 74 |ctl(0,TC|SETA,&st|
|00002c50| 74 79 30 29 3b 0a 09 7d | 0a 0a 63 68 61 72 20 2a |ty0);..}|..char *|
|00002c60| 6d 6f 6e 74 68 73 5b 31 | 32 5d 3d 7b 0a 09 22 4a |months[1|2]={.."J|
|00002c70| 61 6e 22 2c 22 46 65 62 | 22 2c 22 4d 61 72 22 2c |an","Feb|","Mar",|
|00002c80| 22 41 70 72 22 2c 22 4d | 61 79 22 2c 22 4a 75 6e |"Apr","M|ay","Jun|
|00002c90| 22 2c 0a 09 22 4a 75 6c | 22 2c 22 41 75 67 22 2c |",.."Jul|","Aug",|
|00002ca0| 22 53 65 70 22 2c 22 4f | 63 74 22 2c 22 4e 6f 76 |"Sep","O|ct","Nov|
|00002cb0| 22 2c 22 44 65 63 22 20 | 7d 3b 0a 0a 63 68 61 72 |","Dec" |};..char|
|00002cc0| 20 2a 61 78 64 65 66 73 | 5b 37 5d 3d 7b 0a 09 22 | *axdefs|[7]={.."|
|00002cd0| 4d 61 72 6b 65 64 20 66 | 6f 72 20 64 65 6c 65 74 |Marked f|or delet|
|00002ce0| 69 6f 6e 22 2c 0a 09 22 | 4e 65 77 20 55 73 65 72 |ion",.."|New User|
|00002cf0| 22 2c 0a 09 22 50 72 6f | 62 6c 65 6d 20 55 73 65 |",.."Pro|blem Use|
|00002d00| 72 22 2c 0a 09 22 4c 6f | 63 61 6c 20 55 73 65 72 |r",.."Lo|cal User|
|00002d10| 22 2c 0a 09 22 4e 65 74 | 77 6f 72 6b 20 55 73 65 |",.."Net|work Use|
|00002d20| 72 22 2c 0a 09 22 50 72 | 65 66 65 72 72 65 64 20 |r",.."Pr|eferred |
|00002d30| 55 73 65 72 22 2c 0a 09 | 22 41 69 64 65 22 0a 09 |User",..|"Aide"..|
|00002d40| 7d 3b 0a 0a 66 6f 72 6d | 6f 75 74 28 6e 61 6d 65 |};..form|out(name|
|00002d50| 29 20 2f 2a 20 64 69 73 | 70 6c 61 79 20 61 20 66 |) /* dis|play a f|
|00002d60| 69 6c 65 20 75 73 69 6e | 67 20 74 68 65 20 66 6f |ile usin|g the fo|
|00002d70| 72 6d 61 74 74 65 72 20 | 2a 2f 0a 63 68 61 72 20 |rmatter |*/.char |
|00002d80| 6e 61 6d 65 5b 5d 3b 20 | 7b 0a 63 68 61 72 20 61 |name[]; |{.char a|
|00002d90| 61 61 5b 31 30 30 5d 3b | 20 69 6e 74 20 61 3b 0a |aa[100];| int a;.|
|00002da0| 09 73 74 72 63 70 79 28 | 61 61 61 2c 6e 61 6d 65 |.strcpy(|aaa,name|
|00002db0| 29 3b 0a 09 66 6f 72 20 | 28 61 3d 30 3b 20 61 3c |);..for |(a=0; a<|
|00002dc0| 73 74 72 6c 65 6e 28 61 | 61 61 29 3b 20 2b 2b 61 |strlen(a|aa); ++a|
|00002dd0| 29 20 61 61 61 5b 61 5d | 3d 74 6f 6c 6f 77 65 72 |) aaa[a]|=tolower|
|00002de0| 28 61 61 61 5b 61 5d 29 | 3b 0a 09 69 66 20 28 73 |(aaa[a])|;..if (s|
|00002df0| 65 74 6a 6d 70 28 6e 65 | 78 74 62 75 66 29 21 3d |etjmp(ne|xtbuf)!=|
|00002e00| 30 29 20 7b 20 73 74 74 | 79 62 62 73 28 30 29 3b |0) { stt|ybbs(0);|
|00002e10| 20 72 65 74 75 72 6e 28 | 31 29 3b 20 7d 0a 09 73 | return(|1); }..s|
|00002e20| 69 67 6e 61 6c 28 53 49 | 47 49 4e 54 2c 28 2a 62 |ignal(SI|GINT,(*b|
|00002e30| 61 63 6b 6e 65 78 74 29 | 29 3b 0a 09 73 69 67 6e |acknext)|);..sign|
|00002e40| 61 6c 28 53 49 47 51 55 | 49 54 2c 28 2a 62 61 63 |al(SIGQU|IT,(*bac|
|00002e50| 6b 73 74 6f 70 29 29 3b | 0a 09 73 74 74 79 62 62 |kstop));|..sttybb|
|00002e60| 73 28 31 29 3b 0a 09 66 | 6d 6f 75 74 28 75 73 65 |s(1);..f|mout(use|
|00002e70| 72 73 75 70 70 2e 73 63 | 72 65 65 6e 77 69 64 74 |rsupp.sc|reenwidt|
|00002e80| 68 2c 61 61 61 29 3b 0a | 09 73 74 74 79 62 62 73 |h,aaa);.|.sttybbs|
|00002e90| 28 30 29 3b 0a 09 72 65 | 74 75 72 6e 28 30 29 3b |(0);..re|turn(0);|
|00002ea0| 0a 7d 0a 0a 75 73 65 72 | 6c 69 73 74 28 29 20 2f |.}..user|list() /|
|00002eb0| 2a 20 70 72 69 6e 74 73 | 20 74 68 65 20 75 73 65 |* prints| the use|
|00002ec0| 72 6c 69 73 74 20 2a 2f | 20 7b 0a 09 73 74 74 79 |rlist */| {..stty|
|00002ed0| 62 62 73 28 31 29 3b 0a | 09 73 79 73 74 65 6d 28 |bbs(1);.|.system(|
|00002ee0| 22 75 73 65 72 6c 69 73 | 74 22 29 3b 0a 09 73 74 |"userlis|t");..st|
|00002ef0| 74 79 62 62 73 28 30 29 | 3b 0a 09 7d 0a 0a 72 65 |tybbs(0)|;..}..re|
|00002f00| 61 64 6d 61 69 6c 28 29 | 0a 7b 0a 09 69 6e 74 20 |admail()|.{..int |
|00002f10| 61 3b 0a 09 72 65 61 64 | 79 65 72 73 65 6c 66 28 |a;..read|yerself(|
|00002f20| 29 3b 0a 09 66 6f 72 20 | 28 61 3d 30 3b 20 61 3c |);..for |(a=0; a<|
|00002f30| 4d 53 47 53 50 45 52 52 | 4d 3b 20 2b 2b 61 29 20 |MSGSPERR|M; ++a) |
|00002f40| 7b 0a 09 09 66 75 6c 6c | 72 6f 6f 6d 2e 46 52 6e |{...full|room.FRn|
|00002f50| 75 6d 5b 61 5d 3d 30 4c | 3b 0a 09 09 66 75 6c 6c |um[a]=0L|;...full|
|00002f60| 72 6f 6f 6d 2e 46 52 70 | 6f 73 5b 61 5d 3d 30 4c |room.FRp|os[a]=0L|
|00002f70| 3b 20 7d 0a 09 66 6f 72 | 20 28 61 3d 30 3b 20 61 |; }..for| (a=0; a|
|00002f80| 3c 4d 41 49 4c 53 4c 4f | 54 53 3b 20 2b 2b 61 29 |<MAILSLO|TS; ++a)|
|00002f90| 20 7b 0a 09 09 66 75 6c | 6c 72 6f 6f 6d 2e 46 52 | {...ful|lroom.FR|
|00002fa0| 6e 75 6d 5b 61 2b 28 4d | 53 47 53 50 45 52 52 4d |num[a+(M|SGSPERRM|
|00002fb0| 2d 4d 41 49 4c 53 4c 4f | 54 53 29 5d 3d 75 73 65 |-MAILSLO|TS)]=use|
|00002fc0| 72 73 75 70 70 2e 6d 61 | 69 6c 6e 75 6d 5b 61 5d |rsupp.ma|ilnum[a]|
|00002fd0| 3b 0a 09 09 66 75 6c 6c | 72 6f 6f 6d 2e 46 52 70 |;...full|room.FRp|
|00002fe0| 6f 73 5b 61 2b 28 4d 53 | 47 53 50 45 52 52 4d 2d |os[a+(MS|GSPERRM-|
|00002ff0| 4d 41 49 4c 53 4c 4f 54 | 53 29 5d 3d 75 73 65 72 |MAILSLOT|S)]=user|
|00003000| 73 75 70 70 2e 6d 61 69 | 6c 70 6f 73 5b 61 5d 3b |supp.mai|lpos[a];|
|00003010| 20 7d 0a 09 72 65 74 75 | 72 6e 28 30 29 3b 0a 09 | }..retu|rn(0);..|
|00003020| 7d 0a 0a 77 72 69 74 65 | 6d 61 69 6c 28 29 0a 7b |}..write|mail().{|
|00003030| 0a 09 69 6e 74 20 61 3b | 0a 09 72 65 61 64 79 65 |..int a;|..readye|
|00003040| 72 73 65 6c 66 28 29 3b | 0a 09 66 6f 72 20 28 61 |rself();|..for (a|
|00003050| 3d 30 3b 20 61 3c 4d 41 | 49 4c 53 4c 4f 54 53 3b |=0; a<MA|ILSLOTS;|
|00003060| 20 2b 2b 61 29 20 7b 0a | 09 09 75 73 65 72 73 75 | ++a) {.|..usersu|
|00003070| 70 70 2e 6d 61 69 6c 6e | 75 6d 5b 61 5d 3d 66 75 |pp.mailn|um[a]=fu|
|00003080| 6c 6c 72 6f 6f 6d 2e 46 | 52 6e 75 6d 5b 61 2b 28 |llroom.F|Rnum[a+(|
|00003090| 4d 53 47 53 50 45 52 52 | 4d 2d 4d 41 49 4c 53 4c |MSGSPERR|M-MAILSL|
|000030a0| 4f 54 53 29 5d 3b 0a 09 | 09 75 73 65 72 73 75 70 |OTS)];..|.usersup|
|000030b0| 70 2e 6d 61 69 6c 70 6f | 73 5b 61 5d 3d 66 75 6c |p.mailpo|s[a]=ful|
|000030c0| 6c 72 6f 6f 6d 2e 46 52 | 70 6f 73 5b 61 2b 28 4d |lroom.FR|pos[a+(M|
|000030d0| 53 47 53 50 45 52 52 4d | 2d 4d 41 49 4c 53 4c 4f |SGSPERRM|-MAILSLO|
|000030e0| 54 53 29 5d 3b 20 7d 0a | 09 77 72 69 74 65 79 65 |TS)]; }.|.writeye|
|000030f0| 72 73 65 6c 66 28 29 3b | 0a 09 72 65 74 75 72 6e |rself();|..return|
|00003100| 28 30 29 3b 0a 09 7d 0a | 0a 72 65 61 64 79 65 72 |(0);..}.|.readyer|
|00003110| 73 65 6c 66 28 29 0a 7b | 0a 09 69 6e 74 20 66 69 |self().{|..int fi|
|00003120| 6c 65 3b 0a 09 66 69 6c | 65 3d 65 6f 70 65 6e 28 |le;..fil|e=eopen(|
|00003130| 22 75 73 65 72 73 75 70 | 70 22 2c 4f 5f 52 44 4f |"usersup|p",O_RDO|
|00003140| 4e 4c 59 29 3b 0a 09 6c | 73 65 65 6b 28 66 69 6c |NLY);..l|seek(fil|
|00003150| 65 2c 79 6f 75 72 70 6f | 73 2c 30 29 3b 0a 09 64 |e,yourpo|s,0);..d|
|00003160| 6f 20 7b 0a 09 20 20 20 | 20 20 20 20 72 65 61 64 |o {.. | read|
|00003170| 28 66 69 6c 65 2c 26 75 | 73 65 72 73 75 70 70 2c |(file,&u|sersupp,|
|00003180| 73 69 7a 65 6f 66 28 73 | 74 72 75 63 74 20 75 73 |sizeof(s|truct us|
|00003190| 65 72 73 75 70 70 29 29 | 3b 0a 09 20 20 20 20 69 |ersupp))|;.. i|
|000031a0| 66 20 28 73 74 72 75 63 | 6d 70 28 66 75 6c 6c 6e |f (struc|mp(fulln|
|000031b0| 61 6d 65 2c 75 73 65 72 | 73 75 70 70 2e 66 75 6c |ame,user|supp.ful|
|000031c0| 6c 6e 61 6d 65 29 29 20 | 66 69 6e 64 75 73 65 72 |lname)) |finduser|
|000031d0| 28 66 69 6c 65 2c 66 75 | 6c 6c 6e 61 6d 65 29 3b |(file,fu|llname);|
|000031e0| 0a 09 09 7d 20 77 68 69 | 6c 65 28 73 74 72 75 63 |...} whi|le(struc|
|000031f0| 6d 70 28 66 75 6c 6c 6e | 61 6d 65 2c 75 73 65 72 |mp(fulln|ame,user|
|00003200| 73 75 70 70 2e 66 75 6c | 6c 6e 61 6d 65 29 29 3b |supp.ful|lname));|
|00003210| 0a 09 63 6c 6f 73 65 28 | 66 69 6c 65 29 3b 0a 09 |..close(|file);..|
|00003220| 72 65 74 75 72 6e 28 30 | 29 3b 0a 09 7d 0a 0a 77 |return(0|);..}..w|
|00003230| 72 69 74 65 79 65 72 73 | 65 6c 66 28 29 0a 7b 0a |riteyers|elf().{.|
|00003240| 09 69 6e 74 20 66 69 6c | 65 3b 0a 09 73 74 72 75 |.int fil|e;..stru|
|00003250| 63 74 20 75 73 65 72 73 | 75 70 70 20 6d 65 3b 0a |ct users|upp me;.|
|00003260| 09 66 69 6c 65 3d 65 6f | 70 65 6e 28 22 75 73 65 |.file=eo|pen("use|
|00003270| 72 73 75 70 70 22 2c 4f | 5f 52 44 57 52 29 3b 0a |rsupp",O|_RDWR);.|
|00003280| 09 6c 73 65 65 6b 28 66 | 69 6c 65 2c 79 6f 75 72 |.lseek(f|ile,your|
|00003290| 70 6f 73 2c 30 29 3b 0a | 09 72 65 61 64 28 66 69 |pos,0);.|.read(fi|
|000032a0| 6c 65 2c 26 6d 65 2c 73 | 69 7a 65 6f 66 28 73 74 |le,&me,s|izeof(st|
|000032b0| 72 75 63 74 20 75 73 65 | 72 73 75 70 70 29 29 3b |ruct use|rsupp));|
|000032c0| 0a 69 66 20 28 6d 65 2e | 65 74 65 72 6e 61 6c 21 |.if (me.|eternal!|
|000032d0| 3d 75 73 65 72 73 75 70 | 70 2e 65 74 65 72 6e 61 |=usersup|p.eterna|
|000032e0| 6c 29 20 79 6f 75 72 70 | 6f 73 3d 66 69 6e 64 75 |l) yourp|os=findu|
|000032f0| 73 65 72 28 66 69 6c 65 | 2c 75 73 65 72 73 75 70 |ser(file|,usersup|
|00003300| 70 2e 66 75 6c 6c 6e 61 | 6d 65 29 3b 0a 09 6c 73 |p.fullna|me);..ls|
|00003310| 65 65 6b 28 66 69 6c 65 | 2c 79 6f 75 72 70 6f 73 |eek(file|,yourpos|
|00003320| 2c 30 29 3b 0a 09 77 72 | 69 74 65 28 66 69 6c 65 |,0);..wr|ite(file|
|00003330| 2c 26 75 73 65 72 73 75 | 70 70 2c 73 69 7a 65 6f |,&usersu|pp,sizeo|
|00003340| 66 28 73 74 72 75 63 74 | 20 75 73 65 72 73 75 70 |f(struct| usersup|
|00003350| 70 29 29 3b 0a 09 63 6c | 6f 73 65 28 66 69 6c 65 |p));..cl|ose(file|
|00003360| 29 3b 0a 09 72 65 74 75 | 72 6e 28 30 29 3b 0a 09 |);..retu|rn(0);..|
|00003370| 7d 0a 0a 6d 61 69 6e 28 | 29 0a 7b 0a 69 6e 74 20 |}..main(|).{.int |
|00003380| 61 2c 62 2c 63 2c 64 2c | 65 2c 66 2c 66 69 6c 65 |a,b,c,d,|e,f,file|
|00003390| 2c 66 69 6c 65 32 3b 0a | 6c 6f 6e 67 20 61 61 2c |,file2;.|long aa,|
|000033a0| 63 63 3b 0a 63 68 61 72 | 20 62 75 66 5b 33 30 30 |cc;.char| buf[300|
|000033b0| 5d 3b 0a 63 68 61 72 20 | 61 61 61 5b 31 30 30 5d |];.char |aaa[100]|
|000033c0| 2c 62 62 62 5b 31 30 30 | 5d 2c 63 63 63 5b 31 30 |,bbb[100|],ccc[10|
|000033d0| 30 5d 2c 65 65 65 5b 31 | 30 30 5d 3b 09 2f 2a 20 |0],eee[1|00];./* |
|000033e0| 67 65 6e 65 72 61 6c 20 | 70 75 72 70 6f 73 65 20 |general |purpose |
|000033f0| 76 61 72 69 61 62 6c 65 | 73 20 2a 2f 0a 63 68 61 |variable|s */.cha|
|00003400| 72 20 73 6b 69 70 70 69 | 6e 67 5b 4d 41 58 52 4f |r skippi|ng[MAXRO|
|00003410| 4f 4d 53 5d 3b 0a 73 74 | 72 75 63 74 20 75 73 65 |OMS];.st|ruct use|
|00003420| 72 73 75 70 70 20 74 65 | 6d 70 55 53 3b 0a 73 74 |rsupp te|mpUS;.st|
|00003430| 72 75 63 74 20 63 61 6c | 6c 6c 6f 67 20 63 61 6c |ruct cal|llog cal|
|00003440| 6c 6c 6f 67 3b 0a 73 74 | 72 75 63 74 20 77 74 6d |llog;.st|ruct wtm|
|00003450| 70 73 75 70 70 20 77 74 | 6d 70 73 75 70 70 3b 0a |psupp wt|mpsupp;.|
|00003460| 63 68 61 72 20 6d 74 73 | 66 6c 61 67 2c 74 77 69 |char mts|flag,twi|
|00003470| 74 3b 0a 0a 63 68 64 69 | 72 28 42 42 53 44 49 52 |t;..chdi|r(BBSDIR|
|00003480| 29 3b 09 09 09 2f 2a 20 | 67 6f 20 74 6f 20 74 68 |);.../* |go to th|
|00003490| 65 20 72 69 67 68 74 20 | 64 69 72 65 63 74 6f 72 |e right |director|
|000034a0| 79 20 2a 2f 0a 69 6f 63 | 74 6c 28 30 2c 54 43 47 |y */.ioc|tl(0,TCG|
|000034b0| 45 54 41 2c 26 73 74 74 | 79 30 29 3b 09 09 2f 2a |ETA,&stt|y0);../*|
|000034c0| 20 53 74 6f 72 65 20 74 | 68 65 20 6f 6c 64 20 74 | Store t|he old t|
|000034d0| 65 72 6d 69 6e 61 6c 20 | 70 61 72 61 6d 65 74 65 |erminal |paramete|
|000034e0| 72 73 20 61 6e 64 20 2a | 2f 0a 73 74 74 79 62 62 |rs and *|/.sttybb|
|000034f0| 73 28 30 29 3b 09 09 09 | 2f 2a 20 69 6e 73 74 61 |s(0);...|/* insta|
|00003500| 6c 6c 20 74 68 65 20 6e | 65 77 20 6f 6e 65 73 20 |ll the n|ew ones |
|00003510| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003520| 20 2a 2f 0a 73 69 67 6e | 61 6c 28 53 49 47 49 4e | */.sign|al(SIGIN|
|00003530| 54 2c 53 49 47 5f 49 47 | 4e 29 3b 0a 73 69 67 6e |T,SIG_IG|N);.sign|
|00003540| 61 6c 28 53 49 47 51 55 | 49 54 2c 53 49 47 5f 49 |al(SIGQU|IT,SIG_I|
|00003550| 47 4e 29 3b 0a 73 69 67 | 6e 61 6c 28 53 49 47 48 |GN);.sig|nal(SIGH|
|00003560| 55 50 2c 28 2a 64 72 6f | 70 63 61 72 72 29 29 3b |UP,(*dro|pcarr));|
|00003570| 09 2f 2a 20 43 6c 65 61 | 6e 75 70 20 67 72 61 63 |./* Clea|nup grac|
|00003580| 65 66 75 6c 6c 79 20 69 | 66 20 63 61 72 72 69 65 |efully i|f carrie|
|00003590| 72 20 69 73 20 64 72 6f | 70 70 65 64 20 2a 2f 0a |r is dro|pped */.|
|000035a0| 70 72 69 6e 74 66 28 22 | 5c 6e 43 69 74 61 64 65 |printf("|\nCitade|
|000035b0| 6c 2f 55 58 20 72 65 6c | 65 61 73 65 20 33 2e 30 |l/UX rel|ease 3.0|
|000035c0| 31 2d 31 64 5c 6e 22 29 | 3b 0a 74 77 69 74 3d 30 |1-1d\n")|;.twit=0|
|000035d0| 3b 09 09 09 09 2f 2a 20 | 42 79 20 64 65 66 61 75 |;..../* |By defau|
|000035e0| 6c 74 2c 20 75 73 65 72 | 20 69 73 20 6e 6f 74 20 |lt, user| is not |
|000035f0| 61 20 70 72 6f 62 6c 65 | 6d 20 75 73 65 72 20 2a |a proble|m user *|
|00003600| 2f 0a 75 73 65 72 73 75 | 70 70 2e 73 63 72 65 65 |/.usersu|pp.scree|
|00003610| 6e 77 69 64 74 68 3d 38 | 30 3b 0a 66 6f 72 6d 6f |nwidth=8|0;.formo|
|00003620| 75 74 28 22 6d 65 73 73 | 61 67 65 73 2f 68 65 6c |ut("mess|ages/hel|
|00003630| 6c 6f 22 29 3b 09 2f 2a | 20 70 72 69 6e 74 20 74 |lo");./*| print t|
|00003640| 68 65 20 6f 70 65 6e 69 | 6e 67 20 67 72 65 65 74 |he openi|ng greet|
|00003650| 69 6e 67 20 2a 2f 0a 0a | 6c 6f 67 5f 63 61 72 72 |ing */..|log_carr|
|00003660| 28 29 3b 0a 61 3d 67 65 | 74 75 69 64 28 29 3b 0a |();.a=ge|tuid();.|
|00003670| 70 61 73 73 77 64 3d 28 | 73 74 72 75 63 74 20 70 |passwd=(|struct p|
|00003680| 61 73 73 77 64 20 2a 29 | 67 65 74 70 77 75 69 64 |asswd *)|getpwuid|
|00003690| 28 61 29 3b 0a 73 74 72 | 63 70 79 28 66 75 6c 6c |(a);.str|cpy(full|
|000036a0| 6e 61 6d 65 2c 70 61 73 | 73 77 64 2d 3e 70 77 5f |name,pas|swd->pw_|
|000036b0| 67 65 63 6f 73 29 3b 0a | 75 70 61 73 73 3d 31 3b |gecos);.|upass=1;|
|000036c0| 20 69 66 20 28 61 3d 3d | 42 42 53 55 49 44 29 20 | if (a==|BBSUID) |
|000036d0| 75 70 61 73 73 3d 30 3b | 0a 0a 74 77 69 74 72 6f |upass=0;|..twitro|
|000036e0| 6f 6d 3d 28 2d 31 29 3b | 0a 47 53 54 41 3a 09 6e |om=(-1);|.GSTA:.n|
|000036f0| 65 77 6e 6f 77 3d 30 3b | 20 69 66 20 28 75 70 61 |ewnow=0;| if (upa|
|00003700| 73 73 3d 3d 30 29 20 7b | 09 09 2f 2a 20 67 75 65 |ss==0) {|../* gue|
|00003710| 73 74 20 61 63 63 6f 75 | 6e 74 20 2d 20 66 69 6e |st accou|nt - fin|
|00003720| 64 20 6f 75 74 20 2a 2f | 0a 47 53 54 42 3a 09 09 |d out */|.GSTB:..|
|00003730| 70 72 69 6e 74 66 28 22 | 45 6e 74 65 72 20 79 6f |printf("|Enter yo|
|00003740| 75 72 20 6e 61 6d 65 3a | 20 22 29 3b 09 2f 2a 20 |ur name:| ");./* |
|00003750| 77 68 6f 20 74 68 65 20 | 75 73 65 72 20 69 73 20 |who the |user is |
|00003760| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 09 09 67 65 | | */...ge|
|00003770| 74 6c 69 6e 65 28 66 75 | 6c 6c 6e 61 6d 65 2c 32 |tline(fu|llname,2|
|00003780| 39 29 3b 0a 09 09 73 74 | 72 70 72 6f 63 28 66 75 |9);...st|rproc(fu|
|00003790| 6c 6c 6e 61 6d 65 29 3b | 0a 09 09 69 66 20 28 21 |llname);|...if (!|
|000037a0| 73 74 72 75 63 6d 70 28 | 66 75 6c 6c 6e 61 6d 65 |strucmp(|fullname|
|000037b0| 2c 22 62 62 73 22 29 29 | 20 67 6f 74 6f 20 47 53 |,"bbs"))| goto GS|
|000037c0| 54 42 3b 0a 09 09 69 66 | 20 28 21 73 74 72 75 63 |TB;...if| (!struc|
|000037d0| 6d 70 28 66 75 6c 6c 6e | 61 6d 65 2c 22 6e 65 77 |mp(fulln|ame,"new|
|000037e0| 22 29 29 20 67 6f 74 6f | 20 47 53 54 42 3b 0a 09 |")) goto| GSTB;..|
|000037f0| 09 69 66 20 28 21 73 74 | 72 75 63 6d 70 28 66 75 |.if (!st|rucmp(fu|
|00003800| 6c 6c 6e 61 6d 65 2c 22 | 6f 66 66 22 29 29 20 67 |llname,"|off")) g|
|00003810| 6f 74 6f 20 54 45 52 4d | 49 4e 41 54 45 3b 0a 09 |oto TERM|INATE;..|
|00003820| 09 69 66 20 28 73 74 72 | 6c 65 6e 28 66 75 6c 6c |.if (str|len(full|
|00003830| 6e 61 6d 65 29 3d 3d 30 | 29 20 67 6f 74 6f 20 47 |name)==0|) goto G|
|00003840| 53 54 42 3b 0a 09 09 7d | 0a 0a 09 09 09 2f 2a 20 |STB;...}|...../* |
|00003850| 67 65 74 20 74 68 65 20 | 75 73 65 72 73 75 70 70 |get the |usersupp|
|00003860| 20 64 61 74 61 20 66 6f | 72 20 67 75 65 73 74 20 | data fo|r guest |
|00003870| 61 63 63 6f 75 6e 74 20 | 2a 2f 0a 09 66 69 6c 65 |account |*/..file|
|00003880| 3d 65 6f 70 65 6e 28 22 | 75 73 65 72 73 75 70 70 |=eopen("|usersupp|
|00003890| 22 2c 4f 5f 52 44 4f 4e | 4c 59 29 3b 0a 09 79 6f |",O_RDON|LY);..yo|
|000038a0| 75 72 70 6f 73 3d 66 69 | 6e 64 75 73 65 72 28 66 |urpos=fi|nduser(f|
|000038b0| 69 6c 65 2c 66 75 6c 6c | 6e 61 6d 65 29 3b 0a 09 |ile,full|name);..|
|000038c0| 69 66 20 28 79 6f 75 72 | 70 6f 73 3d 3d 28 2d 31 |if (your|pos==(-1|
|000038d0| 4c 29 29 20 7b 20 63 6c | 6f 73 65 28 66 69 6c 65 |L)) { cl|ose(file|
|000038e0| 29 3b 20 67 6f 74 6f 20 | 4e 45 57 55 53 52 3b 20 |); goto |NEWUSR; |
|000038f0| 7d 0a 09 72 65 61 64 28 | 66 69 6c 65 2c 26 75 73 |}..read(|file,&us|
|00003900| 65 72 73 75 70 70 2c 73 | 69 7a 65 6f 66 28 73 74 |ersupp,s|izeof(st|
|00003910| 72 75 63 74 20 75 73 65 | 72 73 75 70 70 29 29 3b |ruct use|rsupp));|
|00003920| 0a 09 63 6c 6f 73 65 28 | 66 69 6c 65 29 3b 0a 09 |..close(|file);..|
|00003930| 67 6f 74 6f 20 55 53 4f | 4b 3b 0a 0a 4e 45 57 55 |goto USO|K;..NEWU|
|00003940| 53 52 3a 09 69 66 20 28 | 75 70 61 73 73 3d 3d 30 |SR:.if (|upass==0|
|00003950| 29 20 7b 0a 09 09 70 72 | 69 6e 74 66 28 22 4e 6f |) {...pr|intf("No|
|00003960| 20 72 65 63 6f 72 64 2e | 20 45 6e 74 65 72 20 61 | record.| Enter a|
|00003970| 73 20 6e 65 77 20 75 73 | 65 72 3f 20 22 29 3b 0a |s new us|er? ");.|
|00003980| 09 09 69 66 20 28 79 65 | 73 6e 6f 28 29 3d 3d 30 |..if (ye|sno()==0|
|00003990| 29 20 67 6f 74 6f 20 47 | 53 54 41 3b 0a 09 09 7d |) goto G|STA;...}|
|000039a0| 0a 0a 09 2f 2a 20 49 6e | 69 74 69 61 6c 69 7a 65 |.../* In|itialize|
|000039b0| 20 61 20 6e 65 77 20 61 | 63 63 6f 75 6e 74 20 2a | a new a|ccount *|
|000039c0| 2f 0a 09 75 73 65 72 73 | 75 70 70 2e 55 53 75 69 |/..users|upp.USui|
|000039d0| 64 3d 67 65 74 75 69 64 | 28 29 3b 0a 09 73 74 72 |d=getuid|();..str|
|000039e0| 63 70 79 28 75 73 65 72 | 73 75 70 70 2e 66 75 6c |cpy(user|supp.ful|
|000039f0| 6c 6e 61 6d 65 2c 66 75 | 6c 6c 6e 61 6d 65 29 3b |lname,fu|llname);|
|00003a00| 0a 09 66 6f 72 20 28 61 | 3d 30 3b 20 61 3c 4d 41 |..for (a|=0; a<MA|
|00003a10| 58 52 4f 4f 4d 53 3b 20 | 2b 2b 61 29 20 7b 09 75 |XROOMS; |++a) {.u|
|00003a20| 73 65 72 73 75 70 70 2e | 6c 61 73 74 73 65 65 6e |sersupp.|lastseen|
|00003a30| 5b 61 5d 3d 30 4c 3b 0a | 09 09 09 09 09 75 73 65 |[a]=0L;.|.....use|
|00003a40| 72 73 75 70 70 2e 67 65 | 6e 65 72 61 74 69 6f 6e |rsupp.ge|neration|
|00003a50| 5b 61 5d 3d 28 2d 31 29 | 3b 0a 09 09 09 09 09 75 |[a]=(-1)|;......u|
|00003a60| 73 65 72 73 75 70 70 2e | 66 6f 72 67 65 74 5b 61 |sersupp.|forget[a|
|00003a70| 5d 3d 28 2d 31 29 3b 20 | 7d 0a 09 66 6f 72 20 28 |]=(-1); |}..for (|
|00003a80| 61 3d 30 3b 20 61 3c 4d | 41 49 4c 53 4c 4f 54 53 |a=0; a<M|AILSLOTS|
|00003a90| 3b 20 2b 2b 61 29 20 7b | 09 75 73 65 72 73 75 70 |; ++a) {|.usersup|
|00003aa0| 70 2e 6d 61 69 6c 6e 75 | 6d 5b 61 5d 3d 30 4c 3b |p.mailnu|m[a]=0L;|
|00003ab0| 0a 09 09 09 09 09 75 73 | 65 72 73 75 70 70 2e 6d |......us|ersupp.m|
|00003ac0| 61 69 6c 70 6f 73 5b 61 | 5d 3d 30 4c 3b 20 7d 0a |ailpos[a|]=0L; }.|
|00003ad0| 09 75 73 65 72 73 75 70 | 70 2e 66 6c 61 67 73 3d |.usersup|p.flags=|
|00003ae0| 30 3b 0a 09 75 73 65 72 | 73 75 70 70 2e 74 69 6d |0;..user|supp.tim|
|00003af0| 65 73 63 61 6c 6c 65 64 | 3d 30 3b 0a 09 75 73 65 |escalled|=0;..use|
|00003b00| 72 73 75 70 70 2e 70 6f | 73 74 65 64 3d 30 3b 0a |rsupp.po|sted=0;.|
|00003b10| 09 75 73 65 72 73 75 70 | 70 2e 61 78 6c 65 76 65 |.usersup|p.axleve|
|00003b20| 6c 3d 49 4e 49 54 41 58 | 3b 0a 09 74 69 6d 65 28 |l=INITAX|;..time(|
|00003b30| 26 61 61 29 3b 0a 09 75 | 73 65 72 73 75 70 70 2e |&aa);..u|sersupp.|
|00003b40| 6c 61 73 74 63 61 6c 6c | 3d 61 61 3b 0a 09 67 65 |lastcall|=aa;..ge|
|00003b50| 74 75 73 69 6e 66 6f 28 | 26 75 73 65 72 73 75 70 |tusinfo(|&usersup|
|00003b60| 70 29 3b 0a 09 0a 09 69 | 66 20 28 75 70 61 73 73 |p);....i|f (upass|
|00003b70| 3d 3d 30 29 20 7b 0a 09 | 09 49 46 4e 45 58 50 45 |==0) {..|.IFNEXPE|
|00003b80| 52 54 20 66 6f 72 6d 6f | 75 74 28 22 6d 65 73 73 |RT formo|ut("mess|
|00003b90| 61 67 65 73 2f 63 68 61 | 6e 67 65 70 77 22 29 3b |ages/cha|ngepw");|
|00003ba0| 0a 09 09 70 72 69 6e 74 | 66 28 22 50 6c 65 61 73 |...print|f("Pleas|
|00003bb0| 65 20 65 6e 74 65 72 20 | 61 20 70 61 73 73 77 6f |e enter |a passwo|
|00003bc0| 72 64 3a 20 22 29 3b 0a | 09 09 67 65 74 6c 69 6e |rd: ");.|..getlin|
|00003bd0| 65 28 75 73 65 72 73 75 | 70 70 2e 70 61 73 73 77 |e(usersu|pp.passw|
|00003be0| 6f 72 64 2c 31 39 29 3b | 0a 09 09 73 74 72 70 72 |ord,19);|...strpr|
|00003bf0| 6f 63 28 75 73 65 72 73 | 75 70 70 2e 70 61 73 73 |oc(users|upp.pass|
|00003c00| 77 6f 72 64 29 3b 0a 09 | 09 70 77 63 72 79 70 74 |word);..|.pwcrypt|
|00003c10| 28 75 73 65 72 73 75 70 | 70 2e 70 61 73 73 77 6f |(usersup|p.passwo|
|00003c20| 72 64 2c 50 57 43 52 59 | 50 54 29 3b 0a 09 09 6e |rd,PWCRY|PT);...n|
|00003c30| 65 77 6e 6f 77 3d 31 3b | 0a 09 09 7d 0a 0a 09 66 |ewnow=1;|...}...f|
|00003c40| 69 6c 65 3d 65 6f 70 65 | 6e 28 22 65 74 65 72 6e |ile=eope|n("etern|
|00003c50| 61 6c 22 2c 4f 5f 52 44 | 57 52 29 3b 09 2f 2a 20 |al",O_RD|WR);./* |
|00003c60| 67 65 74 20 61 20 6e 65 | 77 20 75 73 65 72 20 6e |get a ne|w user n|
|00003c70| 75 6d 62 65 72 20 2a 2f | 0a 09 72 65 61 64 28 66 |umber */|..read(f|
|00003c80| 69 6c 65 2c 26 61 61 2c | 34 29 3b 0a 09 75 73 65 |ile,&aa,|4);..use|
|00003c90| 72 73 75 70 70 2e 65 74 | 65 72 6e 61 6c 3d 61 61 |rsupp.et|ernal=aa|
|00003ca0| 3b 0a 09 61 61 3d 61 61 | 2b 31 4c 3b 0a 09 6c 73 |;..aa=aa|+1L;..ls|
|00003cb0| 65 65 6b 28 66 69 6c 65 | 2c 30 4c 2c 30 29 3b 0a |eek(file|,0L,0);.|
|00003cc0| 09 77 72 69 74 65 28 66 | 69 6c 65 2c 26 61 61 2c |.write(f|ile,&aa,|
|00003cd0| 34 29 3b 0a 09 63 6c 6f | 73 65 28 66 69 6c 65 29 |4);..clo|se(file)|
|00003ce0| 3b 0a 0a 09 66 6f 72 6d | 6f 75 74 28 22 6d 65 73 |;...form|out("mes|
|00003cf0| 73 61 67 65 73 2f 6e 65 | 77 75 73 65 72 22 29 3b |sages/ne|wuser");|
|00003d00| 0a 09 70 72 69 6e 74 66 | 28 22 20 20 28 73 65 74 |..printf|(" (set|
|00003d10| 74 69 6e 67 20 75 70 20 | 61 6e 20 61 63 63 6f 75 |ting up |an accou|
|00003d20| 6e 74 2e 20 70 6c 65 61 | 73 65 20 77 61 69 74 29 |nt. plea|se wait)|
|00003d30| 5c 6e 22 29 3b 0a 09 09 | 09 09 09 09 2f 2a 20 41 |\n");...|..../* A|
|00003d40| 64 64 20 75 73 65 72 20 | 74 6f 20 74 68 65 20 20 |dd user |to the |
|00003d50| 20 20 20 20 20 20 2a 2f | 0a 09 66 69 6c 65 3d 65 | */|..file=e|
|00003d60| 6f 70 65 6e 28 22 75 73 | 65 72 73 75 70 70 22 2c |open("us|ersupp",|
|00003d70| 4f 5f 52 44 4f 4e 4c 59 | 29 3b 09 2f 2a 20 75 73 |O_RDONLY|);./* us|
|00003d80| 65 72 73 75 70 70 20 66 | 69 6c 65 2c 20 6b 65 65 |ersupp f|ile, kee|
|00003d90| 70 69 6e 67 20 2a 2f 0a | 09 66 69 6c 65 32 3d 63 |ping */.|.file2=c|
|00003da0| 72 65 61 74 28 22 2f 74 | 6d 70 2f 75 73 65 72 73 |reat("/t|mp/users|
|00003db0| 75 70 70 22 2c 30 36 36 | 36 29 3b 09 2f 2a 20 74 |upp",066|6);./* t|
|00003dc0| 68 65 20 66 69 6c 65 20 | 69 6e 20 20 20 20 20 20 |he file |in |
|00003dd0| 20 20 20 20 20 20 2a 2f | 0a 09 62 3d 30 3b 09 09 | */|..b=0;..|
|00003de0| 09 09 09 2f 2a 20 61 6c | 70 68 61 62 65 74 69 63 |.../* al|phabetic|
|00003df0| 61 6c 20 6f 72 64 65 72 | 20 20 20 20 20 2a 2f 0a |al order| */.|
|00003e00| 09 64 6f 20 7b 0a 09 09 | 61 3d 72 65 61 64 28 66 |.do {...|a=read(f|
|00003e10| 69 6c 65 2c 26 74 65 6d | 70 55 53 2c 73 69 7a 65 |ile,&tem|pUS,size|
|00003e20| 6f 66 28 73 74 72 75 63 | 74 20 75 73 65 72 73 75 |of(struc|t usersu|
|00003e30| 70 70 29 29 3b 0a 09 09 | 69 66 20 28 20 28 73 74 |pp));...|if ( (st|
|00003e40| 72 75 63 6d 70 28 75 73 | 65 72 73 75 70 70 2e 66 |rucmp(us|ersupp.f|
|00003e50| 75 6c 6c 6e 61 6d 65 2c | 74 65 6d 70 55 53 2e 66 |ullname,|tempUS.f|
|00003e60| 75 6c 6c 6e 61 6d 65 29 | 3c 30 29 20 7c 7c 28 61 |ullname)|<0) ||(a|
|00003e70| 3c 31 29 29 20 7b 0a 09 | 09 09 69 66 20 28 62 3d |<1)) {..|..if (b=|
|00003e80| 3d 30 29 77 72 69 74 65 | 28 66 69 6c 65 32 2c 26 |=0)write|(file2,&|
|00003e90| 75 73 65 72 73 75 70 70 | 2c 73 69 7a 65 6f 66 28 |usersupp|,sizeof(|
|00003ea0| 73 74 72 75 63 74 20 75 | 73 65 72 73 75 70 70 29 |struct u|sersupp)|
|00003eb0| 29 3b 0a 09 09 20 09 62 | 3d 31 3b 0a 09 09 09 7d |);... .b|=1;....}|
|00003ec0| 0a 09 09 69 66 20 28 61 | 3e 30 29 20 77 72 69 74 |...if (a|>0) writ|
|00003ed0| 65 28 66 69 6c 65 32 2c | 26 74 65 6d 70 55 53 2c |e(file2,|&tempUS,|
|00003ee0| 73 69 7a 65 6f 66 28 73 | 74 72 75 63 74 20 75 73 |sizeof(s|truct us|
|00003ef0| 65 72 73 75 70 70 29 29 | 3b 0a 09 09 7d 20 77 68 |ersupp))|;...} wh|
|00003f00| 69 6c 65 28 61 3e 30 29 | 3b 0a 09 79 6f 75 72 70 |ile(a>0)|;..yourp|
|00003f10| 6f 73 3d 66 69 6e 64 75 | 73 65 72 28 66 69 6c 65 |os=findu|ser(file|
|00003f20| 32 2c 75 73 65 72 73 75 | 70 70 2e 66 75 6c 6c 6e |2,usersu|pp.fulln|
|00003f30| 61 6d 65 29 3b 0a 09 63 | 6c 6f 73 65 28 66 69 6c |ame);..c|lose(fil|
|00003f40| 65 29 3b 20 63 6c 6f 73 | 65 28 66 69 6c 65 32 29 |e); clos|e(file2)|
|00003f50| 3b 0a 09 73 69 67 6e 61 | 6c 28 53 49 47 48 55 50 |;..signa|l(SIGHUP|
|00003f60| 2c 53 49 47 5f 49 47 4e | 29 3b 0a 09 75 6e 6c 69 |,SIG_IGN|);..unli|
|00003f70| 6e 6b 28 22 75 73 65 72 | 73 75 70 70 22 29 3b 0a |nk("user|supp");.|
|00003f80| 09 6c 69 6e 6b 28 22 2f | 74 6d 70 2f 75 73 65 72 |.link("/|tmp/user|
|00003f90| 73 75 70 70 22 2c 22 75 | 73 65 72 73 75 70 70 22 |supp","u|sersupp"|
|00003fa0| 29 3b 0a 09 75 6e 6c 69 | 6e 6b 28 22 2f 74 6d 70 |);..unli|nk("/tmp|
|00003fb0| 2f 75 73 65 72 73 75 70 | 70 22 29 3b 0a 09 63 68 |/usersup|p");..ch|
|00003fc0| 6d 6f 64 28 22 75 73 65 | 72 73 75 70 70 22 2c 30 |mod("use|rsupp",0|
|00003fd0| 36 30 30 29 3b 0a 09 73 | 69 67 6e 61 6c 28 53 49 |600);..s|ignal(SI|
|00003fe0| 47 48 55 50 2c 28 2a 64 | 72 6f 70 63 61 72 72 29 |GHUP,(*d|ropcarr)|
|00003ff0| 29 3b 0a 09 73 74 72 63 | 70 79 28 63 61 6c 6c 6c |);..strc|py(calll|
|00004000| 6f 67 2e 43 4c 66 75 6c | 6c 6e 61 6d 65 2c 75 73 |og.CLful|lname,us|
|00004010| 65 72 73 75 70 70 2e 66 | 75 6c 6c 6e 61 6d 65 29 |ersupp.f|ullname)|
|00004020| 3b 0a 09 63 61 6c 6c 6c | 6f 67 2e 43 4c 66 6c 61 |;..calll|og.CLfla|
|00004030| 67 73 3d 43 4c 5f 4e 45 | 57 55 53 45 52 3b 0a 09 |gs=CL_NE|WUSER;..|
|00004040| 72 65 63 5f 6c 6f 67 28 | 26 63 61 6c 6c 6c 6f 67 |rec_log(|&calllog|
|00004050| 29 3b 0a 09 64 6f 20 7b | 0a 09 09 66 69 6c 65 3d |);..do {|...file=|
|00004060| 65 6f 70 65 6e 28 22 4d | 4d 73 74 72 75 63 74 75 |eopen("M|Mstructu|
|00004070| 72 65 22 2c 4f 5f 52 44 | 57 52 29 3b 0a 09 09 72 |re",O_RD|WR);...r|
|00004080| 65 61 64 28 66 69 6c 65 | 2c 26 6d 73 67 6d 61 69 |ead(file|,&msgmai|
|00004090| 6e 2c 73 69 7a 65 6f 66 | 28 73 74 72 75 63 74 20 |n,sizeof|(struct |
|000040a0| 6d 73 67 6d 61 69 6e 29 | 29 3b 0a 09 09 63 6c 6f |msgmain)|);...clo|
|000040b0| 73 65 28 66 69 6c 65 29 | 3b 0a 09 09 7d 20 77 68 |se(file)|;...} wh|
|000040c0| 69 6c 65 20 28 6d 73 67 | 6d 61 69 6e 2e 4d 4d 66 |ile (msg|main.MMf|
|000040d0| 6c 61 67 73 26 4d 4d 5f | 42 55 53 59 29 3b 0a 09 |lags&MM_|BUSY);..|
|000040e0| 6d 73 67 6d 61 69 6e 2e | 4d 4d 66 6c 61 67 73 3d |msgmain.|MMflags=|
|000040f0| 28 6d 73 67 6d 61 69 6e | 2e 4d 4d 66 6c 61 67 73 |(msgmain|.MMflags|
|00004100| 7c 4d 4d 5f 56 41 4c 49 | 44 29 3b 0a 09 66 69 6c ||MM_VALI|D);..fil|
|00004110| 65 3d 65 6f 70 65 6e 28 | 22 4d 4d 73 74 72 75 63 |e=eopen(|"MMstruc|
|00004120| 74 75 72 65 22 2c 4f 5f | 57 52 4f 4e 4c 59 29 3b |ture",O_|WRONLY);|
|00004130| 0a 09 77 72 69 74 65 28 | 66 69 6c 65 2c 26 6d 73 |..write(|file,&ms|
|00004140| 67 6d 61 69 6e 2c 73 69 | 7a 65 6f 66 28 73 74 72 |gmain,si|zeof(str|
|00004150| 75 63 74 20 6d 73 67 6d | 61 69 6e 29 29 3b 0a 09 |uct msgm|ain));..|
|00004160| 63 6c 6f 73 65 28 66 69 | 6c 65 29 3b 0a 0a 55 53 |close(fi|le);..US|
|00004170| 4f 4b 3a 09 2f 2a 20 6d | 61 6b 65 20 73 75 72 65 |OK:./* m|ake sure|
|00004180| 20 74 68 61 74 20 69 66 | 20 69 74 27 73 20 61 20 | that if| it's a |
|00004190| 73 68 65 6c 6c 20 75 73 | 65 72 2c 20 74 68 65 79 |shell us|er, they|
|000041a0| 20 6c 6f 67 20 69 6e 20 | 66 72 6f 6d 20 74 68 65 | log in |from the|
|000041b0| 20 73 68 65 6c 6c 20 2a | 2f 0a 09 69 66 20 28 75 | shell *|/..if (u|
|000041c0| 70 61 73 73 3d 3d 30 29 | 20 69 66 20 28 75 73 65 |pass==0)| if (use|
|000041d0| 72 73 75 70 70 2e 55 53 | 75 69 64 21 3d 42 42 53 |rsupp.US|uid!=BBS|
|000041e0| 55 49 44 29 20 7b 0a 09 | 70 72 69 6e 74 66 28 22 |UID) {..|printf("|
|000041f0| 50 6c 65 61 73 65 20 6c | 6f 67 20 69 6e 20 62 79 |Please l|og in by|
|00004200| 20 72 75 6e 6e 69 6e 67 | 20 43 69 74 61 64 65 6c | running| Citadel|
|00004210| 20 66 72 6f 6d 20 74 68 | 65 20 73 68 65 6c 6c 2e | from th|e shell.|
|00004220| 5c 6e 22 29 3b 0a 09 70 | 72 69 6e 74 66 28 22 28 |\n");..p|rintf("(|
|00004230| 70 72 65 73 73 20 61 6e | 79 20 6b 65 79 20 74 6f |press an|y key to|
|00004240| 20 63 6f 6e 74 69 6e 75 | 65 29 5c 6e 22 29 3b 0a | continu|e)\n");.|
|00004250| 09 69 6e 6b 65 79 28 29 | 3b 0a 09 6c 6f 67 6f 66 |.inkey()|;..logof|
|00004260| 66 28 30 29 3b 0a 09 7d | 0a 0a 69 66 20 28 28 75 |f(0);..}|..if ((u|
|00004270| 70 61 73 73 3d 3d 30 29 | 26 26 28 6e 65 77 6e 6f |pass==0)|&&(newno|
|00004280| 77 3d 3d 30 29 29 20 7b | 0a 09 70 72 69 6e 74 66 |w==0)) {|..printf|
|00004290| 28 22 5c 72 50 6c 65 61 | 73 65 20 65 6e 74 65 72 |("\rPlea|se enter|
|000042a0| 20 79 6f 75 72 20 70 61 | 73 73 77 6f 72 64 3a 20 | your pa|ssword: |
|000042b0| 22 29 3b 0a 09 67 65 74 | 6c 69 6e 65 28 65 65 65 |");..get|line(eee|
|000042c0| 2c 2d 31 39 29 3b 20 73 | 74 72 70 72 6f 63 28 65 |,-19); s|trproc(e|
|000042d0| 65 65 29 3b 0a 09 70 77 | 63 72 79 70 74 28 75 73 |ee);..pw|crypt(us|
|000042e0| 65 72 73 75 70 70 2e 70 | 61 73 73 77 6f 72 64 2c |ersupp.p|assword,|
|000042f0| 50 57 43 52 59 50 54 29 | 3b 0a 09 69 66 20 28 21 |PWCRYPT)|;..if (!|
|00004300| 73 74 72 75 63 6d 70 28 | 65 65 65 2c 75 73 65 72 |strucmp(|eee,user|
|00004310| 73 75 70 70 2e 70 61 73 | 73 77 6f 72 64 29 29 20 |supp.pas|sword)) |
|00004320| 7b 0a 09 09 70 77 63 72 | 79 70 74 28 75 73 65 72 |{...pwcr|ypt(user|
|00004330| 73 75 70 70 2e 70 61 73 | 73 77 6f 72 64 2c 50 57 |supp.pas|sword,PW|
|00004340| 43 52 59 50 54 29 3b 0a | 09 09 67 6f 74 6f 20 50 |CRYPT);.|..goto P|
|00004350| 57 4f 4b 3b 0a 09 09 7d | 0a 09 70 72 69 6e 74 66 |WOK;...}|..printf|
|00004360| 28 22 57 72 6f 6e 67 20 | 70 61 73 73 77 6f 72 64 |("Wrong |password|
|00004370| 2e 2e 2e 5c 6e 22 29 3b | 0a 09 73 74 72 63 70 79 |...\n");|..strcpy|
|00004380| 28 63 61 6c 6c 6c 6f 67 | 2e 43 4c 66 75 6c 6c 6e |(calllog|.CLfulln|
|00004390| 61 6d 65 2c 75 73 65 72 | 73 75 70 70 2e 66 75 6c |ame,user|supp.ful|
|000043a0| 6c 6e 61 6d 65 29 3b 0a | 09 63 61 6c 6c 6c 6f 67 |lname);.|.calllog|
|000043b0| 2e 43 4c 66 6c 61 67 73 | 3d 43 4c 5f 42 41 44 50 |.CLflags|=CL_BADP|
|000043c0| 57 3b 0a 09 72 65 63 5f | 6c 6f 67 28 26 63 61 6c |W;..rec_|log(&cal|
|000043d0| 6c 6c 6f 67 29 3b 0a 09 | 67 6f 74 6f 20 47 53 54 |llog);..|goto GST|
|000043e0| 41 3b 0a 09 7d 0a 0a 2f | 2a 20 41 20 72 6f 6f 6d |A;..}../|* A room|
|000043f0| 27 73 20 67 65 6e 65 72 | 61 74 69 6f 6e 20 6e 75 |'s gener|ation nu|
|00004400| 6d 62 65 72 20 63 68 61 | 6e 67 65 73 20 65 61 63 |mber cha|nges eac|
|00004410| 68 20 74 69 6d 65 20 69 | 74 20 69 73 20 72 65 63 |h time i|t is rec|
|00004420| 79 63 6c 65 64 2e 20 55 | 73 65 72 73 20 61 72 65 |ycled. U|sers are|
|00004430| 20 6b 65 70 74 0a 20 2a | 20 6f 75 74 20 6f 66 20 | kept. *| out of |
|00004440| 70 72 69 76 61 74 65 20 | 72 6f 6f 6d 73 20 6f 72 |private |rooms or|
|00004450| 20 66 6f 72 67 65 74 20 | 72 6f 6f 6d 73 20 62 79 | forget |rooms by|
|00004460| 20 6d 61 74 63 68 69 6e | 67 20 74 68 65 20 67 65 | matchin|g the ge|
|00004470| 6e 65 72 61 74 69 6f 6e | 20 6e 75 6d 62 65 72 73 |neration| numbers|
|00004480| 2e 20 54 6f 0a 20 2a 20 | 61 76 6f 69 64 20 61 6e |. To. * |avoid an|
|00004490| 20 61 63 63 69 64 65 6e | 74 61 6c 20 6d 61 74 63 | acciden|tal matc|
|000044a0| 68 75 70 2c 20 75 6e 6d | 61 74 63 68 65 64 20 6e |hup, unm|atched n|
|000044b0| 75 6d 62 65 72 73 20 61 | 72 65 20 73 65 74 20 74 |umbers a|re set t|
|000044c0| 6f 20 2d 31 20 68 65 72 | 65 2e 0a 20 2a 2f 0a 50 |o -1 her|e.. */.P|
|000044d0| 57 4f 4b 3a 09 72 65 61 | 64 79 65 72 73 65 6c 66 |WOK:.rea|dyerself|
|000044e0| 28 29 3b 0a 09 73 74 72 | 63 70 79 28 66 75 6c 6c |();..str|cpy(full|
|000044f0| 6e 61 6d 65 2c 75 73 65 | 72 73 75 70 70 2e 66 75 |name,use|rsupp.fu|
|00004500| 6c 6c 6e 61 6d 65 29 3b | 0a 09 75 73 65 72 73 75 |llname);|..usersu|
|00004510| 70 70 2e 55 53 75 69 64 | 3d 67 65 74 75 69 64 28 |pp.USuid|=getuid(|
|00004520| 29 3b 0a 09 2b 2b 75 73 | 65 72 73 75 70 70 2e 74 |);..++us|ersupp.t|
|00004530| 69 6d 65 73 63 61 6c 6c | 65 64 3b 0a 09 74 69 6d |imescall|ed;..tim|
|00004540| 65 28 26 61 61 29 3b 0a | 09 75 73 65 72 73 75 70 |e(&aa);.|.usersup|
|00004550| 70 2e 6c 61 73 74 63 61 | 6c 6c 3d 61 61 3b 0a 09 |p.lastca|ll=aa;..|
|00004560| 66 69 6c 65 3d 65 6f 70 | 65 6e 28 22 71 75 69 63 |file=eop|en("quic|
|00004570| 6b 72 6f 6f 6d 22 2c 4f | 5f 52 44 4f 4e 4c 59 29 |kroom",O|_RDONLY)|
|00004580| 3b 0a 09 66 6f 72 20 28 | 61 3d 30 3b 20 61 3c 4d |;..for (|a=0; a<M|
|00004590| 41 58 52 4f 4f 4d 53 3b | 20 2b 2b 61 29 20 7b 0a |AXROOMS;| ++a) {.|
|000045a0| 09 09 62 3d 72 65 61 64 | 28 66 69 6c 65 2c 26 71 |..b=read|(file,&q|
|000045b0| 75 69 63 6b 72 6f 6f 6d | 2c 73 69 7a 65 6f 66 28 |uickroom|,sizeof(|
|000045c0| 73 74 72 75 63 74 20 71 | 75 69 63 6b 72 6f 6f 6d |struct q|uickroom|
|000045d0| 29 29 3b 0a 69 66 20 28 | 75 73 65 72 73 75 70 70 |));.if (|usersupp|
|000045e0| 2e 67 65 6e 65 72 61 74 | 69 6f 6e 5b 61 5d 20 21 |.generat|ion[a] !|
|000045f0| 3d 20 71 75 69 63 6b 72 | 6f 6f 6d 2e 51 52 67 65 |= quickr|oom.QRge|
|00004600| 6e 29 20 75 73 65 72 73 | 75 70 70 2e 67 65 6e 65 |n) users|upp.gene|
|00004610| 72 61 74 69 6f 6e 5b 61 | 5d 3d 28 2d 31 29 3b 0a |ration[a|]=(-1);.|
|00004620| 69 66 20 28 75 73 65 72 | 73 75 70 70 2e 66 6f 72 |if (user|supp.for|
|00004630| 67 65 74 5b 61 5d 20 21 | 3d 20 71 75 69 63 6b 72 |get[a] !|= quickr|
|00004640| 6f 6f 6d 2e 51 52 67 65 | 6e 29 20 75 73 65 72 73 |oom.QRge|n) users|
|00004650| 75 70 70 2e 66 6f 72 67 | 65 74 5b 61 5d 3d 28 2d |upp.forg|et[a]=(-|
|00004660| 31 29 3b 0a 09 09 7d 0a | 09 63 6c 6f 73 65 28 66 |1);...}.|.close(f|
|00004670| 69 6c 65 29 3b 0a 09 69 | 66 20 28 75 73 65 72 73 |ile);..i|f (users|
|00004680| 75 70 70 2e 61 78 6c 65 | 76 65 6c 3d 3d 32 29 20 |upp.axle|vel==2) |
|00004690| 74 77 69 74 3d 31 3b 0a | 09 69 66 20 28 74 77 69 |twit=1;.|.if (twi|
|000046a0| 74 3d 3d 31 29 20 75 73 | 65 72 73 75 70 70 2e 61 |t==1) us|ersupp.a|
|000046b0| 78 6c 65 76 65 6c 3d 32 | 3b 0a 09 77 72 69 74 65 |xlevel=2|;..write|
|000046c0| 79 65 72 73 65 6c 66 28 | 29 3b 0a 09 75 67 6e 75 |yerself(|);..ugnu|
|000046d0| 6d 3d 28 2d 31 29 3b 0a | 0a 09 73 74 72 63 70 79 |m=(-1);.|..strcpy|
|000046e0| 28 63 61 6c 6c 6c 6f 67 | 2e 43 4c 66 75 6c 6c 6e |(calllog|.CLfulln|
|000046f0| 61 6d 65 2c 75 73 65 72 | 73 75 70 70 2e 66 75 6c |ame,user|supp.ful|
|00004700| 6c 6e 61 6d 65 29 3b 0a | 09 74 69 6d 65 28 26 63 |lname);.|.time(&c|
|00004710| 61 6c 6c 6c 6f 67 2e 43 | 4c 74 69 6d 65 29 3b 0a |alllog.C|Ltime);.|
|00004720| 09 63 61 6c 6c 6c 6f 67 | 2e 43 4c 66 6c 61 67 73 |.calllog|.CLflags|
|00004730| 3d 43 4c 5f 4c 4f 47 49 | 4e 3b 0a 09 72 65 63 5f |=CL_LOGI|N;..rec_|
|00004740| 6c 6f 67 28 26 63 61 6c | 6c 6c 6f 67 29 3b 0a 0a |log(&cal|llog);..|
|00004750| 09 70 72 69 6e 74 66 28 | 22 25 73 5c 6e 41 63 63 |.printf(|"%s\nAcc|
|00004760| 65 73 73 20 6c 65 76 65 | 6c 3a 20 25 73 5c 6e 55 |ess leve|l: %s\nU|
|00004770| 73 65 72 20 23 25 6c 64 | 20 2f 20 43 61 6c 6c 20 |ser #%ld| / Call |
|00004780| 23 25 64 5c 6e 22 2c 0a | 09 09 75 73 65 72 73 75 |#%d\n",.|..usersu|
|00004790| 70 70 2e 66 75 6c 6c 6e | 61 6d 65 2c 61 78 64 65 |pp.fulln|ame,axde|
|000047a0| 66 73 5b 75 73 65 72 73 | 75 70 70 2e 61 78 6c 65 |fs[users|upp.axle|
|000047b0| 76 65 6c 5d 2c 0a 09 09 | 75 73 65 72 73 75 70 70 |vel],...|usersupp|
|000047c0| 2e 65 74 65 72 6e 61 6c | 2c 75 73 65 72 73 75 70 |.eternal|,usersup|
|000047d0| 70 2e 74 69 6d 65 73 63 | 61 6c 6c 65 64 29 3b 0a |p.timesc|alled);.|
|000047e0| 69 66 20 28 28 52 45 47 | 49 53 43 41 4c 4c 21 3d |if ((REG|ISCALL!=|
|000047f0| 30 29 26 26 28 28 75 73 | 65 72 73 75 70 70 2e 66 |0)&&((us|ersupp.f|
|00004800| 6c 61 67 73 26 55 53 5f | 52 45 47 49 53 29 3d 3d |lags&US_|REGIS)==|
|00004810| 30 29 0a 09 09 26 26 28 | 75 73 65 72 73 75 70 70 |0)...&&(|usersupp|
|00004820| 2e 74 69 6d 65 73 63 61 | 6c 6c 65 64 3e 3d 52 45 |.timesca|lled>=RE|
|00004830| 47 49 53 43 41 4c 4c 29 | 29 20 7b 0a 09 70 72 69 |GISCALL)|) {..pri|
|00004840| 6e 74 66 28 22 2a 2a 2a | 20 52 65 67 69 73 74 72 |ntf("***| Registr|
|00004850| 61 74 69 6f 6e 20 69 73 | 20 72 65 71 75 65 73 74 |ation is| request|
|00004860| 65 64 2e 5c 6e 22 29 3b | 0a 09 66 6f 72 6d 6f 75 |ed.\n");|..formou|
|00004870| 74 28 22 6d 65 73 73 61 | 67 65 73 2f 72 65 67 69 |t("messa|ges/regi|
|00004880| 73 74 65 72 22 29 3b 0a | 09 61 3d 65 6e 74 72 65 |ster");.|.a=entre|
|00004890| 67 69 73 28 75 73 65 72 | 73 75 70 70 2e 65 74 65 |gis(user|supp.ete|
|000048a0| 72 6e 61 6c 29 3b 0a 09 | 69 66 20 28 61 3d 3d 30 |rnal);..|if (a==0|
|000048b0| 29 20 7b 0a 09 09 72 65 | 61 64 79 65 72 73 65 6c |) {...re|adyersel|
|000048c0| 66 28 29 3b 0a 09 09 75 | 73 65 72 73 75 70 70 2e |f();...u|sersupp.|
|000048d0| 66 6c 61 67 73 3d 28 75 | 73 65 72 73 75 70 70 2e |flags=(u|sersupp.|
|000048e0| 66 6c 61 67 73 7c 55 53 | 5f 52 45 47 49 53 29 3b |flags|US|_REGIS);|
|000048f0| 0a 09 09 77 72 69 74 65 | 79 65 72 73 65 6c 66 28 |...write|yerself(|
|00004900| 29 3b 0a 09 09 7d 0a 09 | 7d 0a 0a 09 49 46 41 49 |);...}..|}...IFAI|
|00004910| 44 45 20 7b 0a 09 09 66 | 69 6c 65 3d 6f 70 65 6e |DE {...f|ile=open|
|00004920| 28 22 4d 4d 73 74 72 75 | 63 74 75 72 65 22 2c 4f |("MMstru|cture",O|
|00004930| 5f 52 44 4f 4e 4c 59 29 | 3b 0a 09 09 72 65 61 64 |_RDONLY)|;...read|
|00004940| 28 66 69 6c 65 2c 26 6d | 73 67 6d 61 69 6e 2c 73 |(file,&m|sgmain,s|
|00004950| 69 7a 65 6f 66 28 73 74 | 72 75 63 74 20 6d 73 67 |izeof(st|ruct msg|
|00004960| 6d 61 69 6e 29 29 3b 0a | 09 09 63 6c 6f 73 65 28 |main));.|..close(|
|00004970| 66 69 6c 65 29 3b 0a 09 | 09 69 66 20 28 6d 73 67 |file);..|.if (msg|
|00004980| 6d 61 69 6e 2e 4d 4d 66 | 6c 61 67 73 26 4d 4d 5f |main.MMf|lags&MM_|
|00004990| 56 41 4c 49 44 29 0a 09 | 09 09 70 72 69 6e 74 66 |VALID)..|..printf|
|000049a0| 28 22 2a 2a 2a 20 4e 65 | 77 20 75 73 65 72 73 20 |("*** Ne|w users |
|000049b0| 6e 65 65 64 20 74 6f 20 | 62 65 20 76 61 6c 69 64 |need to |be valid|
|000049c0| 61 74 65 64 5c 6e 22 29 | 3b 0a 09 09 7d 0a 0a 09 |ated\n")|;...}...|
|000049d0| 62 3d 30 3b 09 09 09 09 | 2f 2a 20 63 68 65 63 6b |b=0;....|/* check|
|000049e0| 20 66 6f 72 20 6d 61 69 | 6c 20 2a 2f 0a 09 66 6f | for mai|l */..fo|
|000049f0| 72 20 28 61 3d 30 3b 20 | 61 3c 4d 41 49 4c 53 4c |r (a=0; |a<MAILSL|
|00004a00| 4f 54 53 3b 20 2b 2b 61 | 29 0a 09 09 69 66 20 28 |OTS; ++a|)...if (|
|00004a10| 75 73 65 72 73 75 70 70 | 2e 6d 61 69 6c 6e 75 6d |usersupp|.mailnum|
|00004a20| 5b 61 5d 3e 75 73 65 72 | 73 75 70 70 2e 6c 61 73 |[a]>user|supp.las|
|00004a30| 74 73 65 65 6e 5b 31 5d | 29 20 2b 2b 62 3b 0a 09 |tseen[1]|) ++b;..|
|00004a40| 69 66 20 28 62 3d 3d 31 | 29 20 70 72 69 6e 74 66 |if (b==1|) printf|
|00004a50| 28 22 2a 2a 2a 20 59 6f | 75 20 68 61 76 65 20 61 |("*** Yo|u have a|
|00004a60| 20 6e 65 77 20 70 72 69 | 76 61 74 65 20 6d 65 73 | new pri|vate mes|
|00004a70| 73 61 67 65 20 69 6e 20 | 4d 61 69 6c 3e 5c 6e 22 |sage in |Mail>\n"|
|00004a80| 29 3b 0a 09 69 66 20 28 | 62 3e 31 29 20 20 70 72 |);..if (|b>1) pr|
|00004a90| 69 6e 74 66 28 22 2a 2a | 2a 20 59 6f 75 20 68 61 |intf("**|* You ha|
|00004aa0| 76 65 20 25 64 20 6e 65 | 77 20 70 72 69 76 61 74 |ve %d ne|w privat|
|00004ab0| 65 20 6d 65 73 73 61 67 | 65 73 20 69 6e 20 4d 61 |e messag|es in Ma|
|00004ac0| 69 6c 3e 5c 6e 22 2c 62 | 29 3b 0a 0a 09 73 70 72 |il>\n",b|);...spr|
|00004ad0| 69 6e 74 66 28 74 65 6d | 70 2c 22 2f 74 6d 70 2f |intf(tem|p,"/tmp/|
|00004ae0| 63 69 74 25 64 22 2c 67 | 65 74 70 69 64 28 29 29 |cit%d",g|etpid())|
|00004af0| 3b 20 2f 2a 20 6d 61 6b | 65 20 75 70 20 61 20 74 |; /* mak|e up a t|
|00004b00| 65 6d 70 20 66 69 6c 65 | 20 6e 61 6d 65 20 2a 2f |emp file| name */|
|00004b10| 0a 0a 09 66 69 6c 65 3d | 6f 70 65 6e 28 22 77 74 |...file=|open("wt|
|00004b20| 6d 70 73 75 70 70 22 2c | 4f 5f 52 44 57 52 29 3b |mpsupp",|O_RDWR);|
|00004b30| 20 69 66 20 28 66 69 6c | 65 3c 30 29 20 66 69 6c | if (fil|e<0) fil|
|00004b40| 65 3d 63 72 65 61 74 28 | 22 77 74 6d 70 73 75 70 |e=creat(|"wtmpsup|
|00004b50| 70 22 2c 30 36 36 36 29 | 3b 0a 09 64 6f 20 7b 0a |p",0666)|;..do {.|
|00004b60| 09 09 61 61 3d 6c 73 65 | 65 6b 28 66 69 6c 65 2c |..aa=lse|ek(file,|
|00004b70| 30 4c 2c 31 29 3b 0a 09 | 09 61 3d 72 65 61 64 28 |0L,1);..|.a=read(|
|00004b80| 66 69 6c 65 2c 26 77 74 | 6d 70 73 75 70 70 2c 73 |file,&wt|mpsupp,s|
|00004b90| 69 7a 65 6f 66 28 73 74 | 72 75 63 74 20 77 74 6d |izeof(st|ruct wtm|
|00004ba0| 70 73 75 70 70 29 29 3b | 0a 09 09 7d 20 77 68 69 |psupp));|...} whi|
|00004bb0| 6c 65 28 28 61 3e 30 29 | 26 26 28 73 74 72 75 63 |le((a>0)|&&(struc|
|00004bc0| 6d 70 28 77 74 6d 70 73 | 75 70 70 2e 57 53 74 74 |mp(wtmps|upp.WStt|
|00004bd0| 79 2c 74 74 79 6e 61 6d | 65 28 30 29 29 29 29 3b |y,ttynam|e(0))));|
|00004be0| 0a 09 69 66 20 28 21 73 | 74 72 63 6d 70 28 77 74 |..if (!s|trcmp(wt|
|00004bf0| 6d 70 73 75 70 70 2e 57 | 53 74 74 79 2c 74 74 79 |mpsupp.W|Stty,tty|
|00004c00| 6e 61 6d 65 28 30 29 29 | 29 20 6c 73 65 65 6b 28 |name(0))|) lseek(|
|00004c10| 66 69 6c 65 2c 61 61 2c | 30 29 3b 0a 09 73 74 72 |file,aa,|0);..str|
|00004c20| 63 70 79 28 77 74 6d 70 | 73 75 70 70 2e 57 53 74 |cpy(wtmp|supp.WSt|
|00004c30| 74 79 2c 74 74 79 6e 61 | 6d 65 28 30 29 29 3b 0a |ty,ttyna|me(0));.|
|00004c40| 09 73 74 72 63 70 79 28 | 77 74 6d 70 73 75 70 70 |.strcpy(|wtmpsupp|
|00004c50| 2e 57 53 6e 61 6d 65 2c | 75 73 65 72 73 75 70 70 |.WSname,|usersupp|
|00004c60| 2e 66 75 6c 6c 6e 61 6d | 65 29 3b 0a 09 77 72 69 |.fullnam|e);..wri|
|00004c70| 74 65 28 66 69 6c 65 2c | 26 77 74 6d 70 73 75 70 |te(file,|&wtmpsup|
|00004c80| 70 2c 73 69 7a 65 6f 66 | 28 73 74 72 75 63 74 20 |p,sizeof|(struct |
|00004c90| 77 74 6d 70 73 75 70 70 | 29 29 3b 0a 09 63 6c 6f |wtmpsupp|));..clo|
|00004ca0| 73 65 28 66 69 6c 65 29 | 3b 0a 0a 09 2f 2a 20 45 |se(file)|;.../* E|
|00004cb0| 6e 74 65 72 20 74 68 65 | 20 6c 6f 62 62 79 20 2a |nter the| lobby *|
|00004cc0| 2f 0a 09 66 69 6c 65 3d | 65 6f 70 65 6e 28 22 71 |/..file=|eopen("q|
|00004cd0| 75 69 63 6b 72 6f 6f 6d | 22 2c 4f 5f 52 44 4f 4e |uickroom|",O_RDON|
|00004ce0| 4c 59 29 3b 0a 09 61 3d | 72 65 61 64 28 66 69 6c |LY);..a=|read(fil|
|00004cf0| 65 2c 26 71 75 69 63 6b | 72 6f 6f 6d 2c 73 69 7a |e,&quick|room,siz|
|00004d00| 65 6f 66 28 73 74 72 75 | 63 74 20 71 75 69 63 6b |eof(stru|ct quick|
|00004d10| 72 6f 6f 6d 29 29 3b 0a | 09 63 6c 6f 73 65 28 66 |room));.|.close(f|
|00004d20| 69 6c 65 29 3b 0a 09 66 | 69 6c 65 3d 65 6f 70 65 |ile);..f|ile=eope|
|00004d30| 6e 28 22 2e 2f 72 6f 6f | 6d 73 2f 66 75 6c 6c 72 |n("./roo|ms/fullr|
|00004d40| 6d 30 22 2c 4f 5f 52 44 | 4f 4e 4c 59 29 3b 0a 09 |m0",O_RD|ONLY);..|
|00004d50| 61 3d 72 65 61 64 28 66 | 69 6c 65 2c 26 66 75 6c |a=read(f|ile,&ful|
|00004d60| 6c 72 6f 6f 6d 2c 73 69 | 7a 65 6f 66 28 73 74 72 |lroom,si|zeof(str|
|00004d70| 75 63 74 20 66 75 6c 6c | 72 6f 6f 6d 29 29 3b 0a |uct full|room));.|
|00004d80| 09 63 6c 6f 73 65 28 66 | 69 6c 65 29 3b 0a 0a 2f |.close(f|ile);../|
|00004d90| 2a 20 4d 61 69 6e 20 70 | 61 72 74 20 6f 66 20 74 |* Main p|art of t|
|00004da0| 68 65 20 73 79 73 74 65 | 6d 2e 2e 2e 20 75 73 65 |he syste|m... use|
|00004db0| 72 20 69 73 20 6c 6f 67 | 67 65 64 20 69 6e 2e 20 |r is log|ged in. |
|00004dc0| 2a 2f 0a 09 66 6f 72 20 | 28 61 3d 30 3b 20 61 3c |*/..for |(a=0; a<|
|00004dd0| 4d 41 58 52 4f 4f 4d 53 | 3b 20 2b 2b 61 29 20 73 |MAXROOMS|; ++a) s|
|00004de0| 6b 69 70 70 69 6e 67 5b | 61 5d 3d 30 3b 0a 09 73 |kipping[|a]=0;..s|
|00004df0| 74 72 63 70 79 28 61 61 | 61 2c 22 6e 22 29 3b 20 |trcpy(aa|a,"n"); |
|00004e00| 69 66 20 28 6e 65 77 6e | 6f 77 3d 3d 31 29 20 73 |if (newn|ow==1) s|
|00004e10| 74 72 63 70 79 28 61 61 | 61 2c 22 6c 22 29 3b 0a |trcpy(aa|a,"l");.|
|00004e20| 09 67 6f 74 6f 20 4d 41 | 49 4e 46 41 4b 45 3b 0a |.goto MA|INFAKE;.|
|00004e30| 4d 41 49 4e 3a 09 73 69 | 67 6e 61 6c 28 53 49 47 |MAIN:.si|gnal(SIG|
|00004e40| 49 4e 54 2c 53 49 47 5f | 49 47 4e 29 3b 0a 09 73 |INT,SIG_|IGN);..s|
|00004e50| 69 67 6e 61 6c 28 53 49 | 47 51 55 49 54 2c 53 49 |ignal(SI|GQUIT,SI|
|00004e60| 47 5f 49 47 4e 29 3b 0a | 09 61 3d 72 6f 6f 6d 5f |G_IGN);.|.a=room_|
|00004e70| 70 72 6f 6d 70 74 28 26 | 71 75 69 63 6b 72 6f 6f |prompt(&|quickroo|
|00004e80| 6d 29 3b 0a 09 70 72 69 | 6e 74 66 28 22 5c 6e 25 |m);..pri|ntf("\n%|
|00004e90| 73 25 63 20 22 2c 71 75 | 69 63 6b 72 6f 6f 6d 2e |s%c ",qu|ickroom.|
|00004ea0| 51 52 6e 61 6d 65 2c 61 | 29 3b 20 2f 2a 20 72 6f |QRname,a|); /* ro|
|00004eb0| 6f 6d 20 70 72 6f 6d 70 | 74 20 2a 2f 0a 09 67 65 |om promp|t */..ge|
|00004ec0| 74 63 6d 64 28 61 61 61 | 29 3b 0a 4d 41 49 4e 46 |tcmd(aaa|);.MAINF|
|00004ed0| 41 4b 45 3a 0a 69 66 20 | 28 21 73 74 72 63 6d 70 |AKE:.if |(!strcmp|
|00004ee0| 28 61 61 61 2c 22 68 22 | 29 29 09 09 09 09 67 6f |(aaa,"h"|))....go|
|00004ef0| 74 6f 20 48 45 4c 50 3b | 0a 69 66 20 28 21 73 74 |to HELP;|.if (!st|
|00004f00| 72 63 6d 70 28 61 61 61 | 2c 22 2e 65 70 22 29 29 |rcmp(aaa|,".ep"))|
|00004f10| 09 09 09 09 67 6f 74 6f | 20 50 41 53 53 57 44 3b |....goto| PASSWD;|
|00004f20| 0a 69 66 20 28 21 73 74 | 72 6e 63 6d 70 28 61 61 |.if (!st|rncmp(aa|
|00004f30| 61 2c 22 2e 68 22 2c 32 | 29 29 09 09 09 67 6f 74 |a,".h",2|))...got|
|00004f40| 6f 20 48 45 4c 50 46 49 | 4c 45 3b 0a 69 66 20 28 |o HELPFI|LE;.if (|
|00004f50| 21 73 74 72 6e 63 6d 70 | 28 61 61 61 2c 22 2e 67 |!strncmp|(aaa,".g|
|00004f60| 22 2c 32 29 29 20 7b 20 | 75 70 64 61 74 65 6c 73 |",2)) { |updatels|
|00004f70| 28 29 3b 09 09 67 6f 74 | 6f 20 44 4f 54 47 4f 54 |();..got|o DOTGOT|
|00004f80| 4f 3b 20 7d 0a 69 66 20 | 28 21 73 74 72 63 6d 70 |O; }.if |(!strcmp|
|00004f90| 28 61 61 61 2c 22 67 22 | 29 29 20 7b 20 75 70 64 |(aaa,"g"|)) { upd|
|00004fa0| 61 74 65 6c 73 28 29 3b | 09 09 67 6f 74 6f 20 54 |atels();|..goto T|
|00004fb0| 48 45 47 4f 54 4f 3b 20 | 7d 0a 69 66 20 28 21 73 |HEGOTO; |}.if (!s|
|00004fc0| 74 72 63 6d 70 28 61 61 | 61 2c 22 6b 22 29 29 09 |trcmp(aa|a,"k")).|
|00004fd0| 09 09 09 67 6f 74 6f 20 | 4b 4e 52 4f 4f 4d 53 3b |...goto |KNROOMS;|
|00004fe0| 0a 69 66 20 28 21 73 74 | 72 63 6d 70 28 61 61 61 |.if (!st|rcmp(aaa|
|00004ff0| 2c 22 2e 7a 22 29 29 09 | 09 09 09 67 6f 74 6f 20 |,".z")).|...goto |
|00005000| 5a 4c 49 53 54 3b 0a 69 | 66 20 28 21 73 74 72 63 |ZLIST;.i|f (!strc|
|00005010| 6d 70 28 61 61 61 2c 22 | 65 22 29 29 20 7b 09 09 |mp(aaa,"|e")) {..|
|00005020| 65 3d 30 3b 09 63 3d 30 | 3b 09 67 6f 74 6f 20 45 |e=0;.c=0|;.goto E|
|00005030| 4e 54 4d 53 47 3b 20 7d | 0a 69 66 20 28 21 73 74 |NTMSG; }|.if (!st|
|00005040| 72 63 6d 70 28 61 61 61 | 2c 22 2e 65 61 22 29 29 |rcmp(aaa|,".ea"))|
|00005050| 20 7b 09 65 3d 30 3b 09 | 63 3d 31 3b 09 67 6f 74 | {.e=0;.|c=1;.got|
|00005060| 6f 20 45 4e 54 4d 53 47 | 3b 20 7d 0a 69 66 20 28 |o ENTMSG|; }.if (|
|00005070| 21 73 74 72 63 6d 70 28 | 61 61 61 2c 22 7a 22 29 |!strcmp(|aaa,"z")|
|00005080| 29 09 09 09 09 66 6f 72 | 67 65 74 28 29 3b 0a 69 |)....for|get();.i|
|00005090| 66 20 28 21 73 74 72 63 | 6d 70 28 61 61 61 2c 22 |f (!strc|mp(aaa,"|
|000050a0| 66 22 29 29 20 7b 20 62 | 3d 30 3b 09 09 63 3d 30 |f")) { b|=0;..c=0|
|000050b0| 3b 09 67 6f 74 6f 20 52 | 46 57 44 3b 20 7d 0a 69 |;.goto R|FWD; }.i|
|000050c0| 66 20 28 21 73 74 72 63 | 6d 70 28 61 61 61 2c 22 |f (!strc|mp(aaa,"|
|000050d0| 6c 22 29 29 20 7b 20 62 | 3d 4d 53 47 53 50 45 52 |l")) { b|=MSGSPER|
|000050e0| 52 4d 2d 35 3b 09 63 3d | 30 3b 09 67 6f 74 6f 20 |RM-5;.c=|0;.goto |
|000050f0| 52 46 57 44 3b 20 7d 0a | 69 66 20 28 21 73 74 72 |RFWD; }.|if (!str|
|00005100| 63 6d 70 28 61 61 61 2c | 22 6e 22 29 29 20 7b 20 |cmp(aaa,|"n")) { |
|00005110| 62 3d 30 3b 09 09 63 3d | 31 3b 09 67 6f 74 6f 20 |b=0;..c=|1;.goto |
|00005120| 52 46 57 44 3b 20 7d 0a | 69 66 20 28 21 73 74 72 |RFWD; }.|if (!str|
|00005130| 63 6d 70 28 61 61 61 2c | 22 72 22 29 29 20 7b 20 |cmp(aaa,|"r")) { |
|00005140| 09 09 63 3d 30 3b 09 67 | 6f 74 6f 20 56 46 57 44 |..c=0;.g|oto VFWD|
|00005150| 3b 20 7d 0a 69 66 20 28 | 21 73 74 72 63 6d 70 28 |; }.if (|!strcmp(|
|00005160| 61 61 61 2c 22 6f 22 29 | 29 20 7b 09 09 09 63 3d |aaa,"o")|) {...c=|
|00005170| 31 3b 09 67 6f 74 6f 20 | 56 46 57 44 3b 20 7d 0a |1;.goto |VFWD; }.|
|00005180| 69 66 20 28 21 73 74 72 | 63 6d 70 28 61 61 61 2c |if (!str|cmp(aaa,|
|00005190| 22 2e 65 72 22 29 29 20 | 7b 20 75 70 64 61 74 65 |".er")) |{ update|
|000051a0| 6c 73 28 29 3b 09 09 65 | 6e 74 72 6f 6f 6d 28 29 |ls();..e|ntroom()|
|000051b0| 3b 20 7d 0a 69 66 20 28 | 21 73 74 72 63 6d 70 28 |; }.if (|!strcmp(|
|000051c0| 61 61 61 2c 22 2e 61 6b | 22 29 29 09 09 09 09 6b |aaa,".ak|"))....k|
|000051d0| 69 6c 6c 72 6f 6f 6d 28 | 29 3b 0a 69 66 20 28 21 |illroom(|);.if (!|
|000051e0| 73 74 72 63 6d 70 28 61 | 61 61 2c 22 2e 72 75 22 |strcmp(a|aa,".ru"|
|000051f0| 29 29 09 09 09 09 75 73 | 65 72 6c 69 73 74 28 29 |))....us|erlist()|
|00005200| 3b 0a 69 66 20 28 21 73 | 74 72 63 6d 70 28 61 61 |;.if (!s|trcmp(aa|
|00005210| 61 2c 22 2e 61 72 69 22 | 29 29 09 09 09 69 6e 76 |a,".ari"|))...inv|
|00005220| 69 74 65 28 29 3b 0a 69 | 66 20 28 21 73 74 72 63 |ite();.i|f (!strc|
|00005230| 6d 70 28 61 61 61 2c 22 | 2e 61 72 6b 22 29 29 09 |mp(aaa,"|.ark")).|
|00005240| 09 09 6b 69 63 6b 6f 75 | 74 28 29 3b 0a 69 66 20 |..kickou|t();.if |
|00005250| 28 21 73 74 72 63 6d 70 | 28 61 61 61 2c 22 2e 61 |(!strcmp|(aaa,".a|
|00005260| 65 22 29 29 09 09 09 09 | 65 64 69 74 72 6f 6f 6d |e"))....|editroom|
|00005270| 28 29 3b 0a 69 66 20 28 | 21 73 74 72 63 6d 70 28 |();.if (|!strcmp(|
|00005280| 61 61 61 2c 22 64 22 29 | 29 09 09 09 09 72 6f 6f |aaa,"d")|)....roo|
|00005290| 6d 64 69 72 28 29 3b 0a | 69 66 20 28 21 73 74 72 |mdir();.|if (!str|
|000052a0| 63 6d 70 28 61 61 61 2c | 22 2e 72 74 22 29 29 09 |cmp(aaa,|".rt")).|
|000052b0| 09 09 09 64 6f 77 6e 6c | 6f 61 64 28 30 29 3b 0a |...downl|oad(0);.|
|000052c0| 69 66 20 28 21 73 74 72 | 63 6d 70 28 61 61 61 2c |if (!str|cmp(aaa,|
|000052d0| 22 2e 72 78 22 29 29 09 | 09 09 09 64 6f 77 6e 6c |".rx")).|...downl|
|000052e0| 6f 61 64 28 31 29 3b 0a | 69 66 20 28 21 73 74 72 |oad(1);.|if (!str|
|000052f0| 63 6d 70 28 61 61 61 2c | 22 2e 72 66 22 29 29 09 |cmp(aaa,|".rf")).|
|00005300| 09 09 09 64 6f 77 6e 6c | 6f 61 64 28 32 29 3b 0a |...downl|oad(2);.|
|00005310| 69 66 20 28 21 73 74 72 | 63 6d 70 28 61 61 61 2c |if (!str|cmp(aaa,|
|00005320| 22 2e 65 74 22 29 29 09 | 09 09 09 75 70 6c 6f 61 |".et")).|...uploa|
|00005330| 64 28 30 29 3b 0a 69 66 | 20 28 21 73 74 72 63 6d |d(0);.if| (!strcm|
|00005340| 70 28 61 61 61 2c 22 2e | 65 78 22 29 29 09 09 09 |p(aaa,".|ex"))...|
|00005350| 09 75 70 6c 6f 61 64 28 | 31 29 3b 0a 69 66 20 28 |.upload(|1);.if (|
|00005360| 21 73 74 72 63 6d 70 28 | 61 61 61 2c 22 75 22 29 |!strcmp(|aaa,"u")|
|00005370| 29 09 09 09 09 75 6e 67 | 6f 74 6f 28 29 3b 0a 69 |)....ung|oto();.i|
|00005380| 66 20 28 21 73 74 72 63 | 6d 70 28 61 61 61 2c 22 |f (!strc|mp(aaa,"|
|00005390| 2e 61 77 22 29 29 09 09 | 09 09 77 68 6f 6b 6e 6f |.aw"))..|..whokno|
|000053a0| 77 73 28 29 3b 0a 69 66 | 20 28 21 73 74 72 63 6d |ws();.if| (!strcm|
|000053b0| 70 28 61 61 61 2c 22 2e | 61 76 22 29 29 09 09 09 |p(aaa,".|av"))...|
|000053c0| 09 76 61 6c 69 64 61 74 | 65 28 29 3b 0a 0a 69 66 |.validat|e();..if|
|000053d0| 20 28 21 73 74 72 63 6d | 70 28 61 61 61 2c 22 2e | (!strcm|p(aaa,".|
|000053e0| 65 67 22 29 29 20 7b 0a | 09 66 6f 72 6d 6f 75 74 |eg")) {.|.formout|
|000053f0| 28 22 6d 65 73 73 61 67 | 65 73 2f 72 65 67 69 73 |("messag|es/regis|
|00005400| 74 65 72 22 29 3b 0a 09 | 61 3d 65 6e 74 72 65 67 |ter");..|a=entreg|
|00005410| 69 73 28 75 73 65 72 73 | 75 70 70 2e 65 74 65 72 |is(users|upp.eter|
|00005420| 6e 61 6c 29 3b 0a 09 69 | 66 20 28 61 3d 3d 30 29 |nal);..i|f (a==0)|
|00005430| 20 7b 0a 09 09 72 65 61 | 64 79 65 72 73 65 6c 66 | {...rea|dyerself|
|00005440| 28 29 3b 0a 09 09 75 73 | 65 72 73 75 70 70 2e 66 |();...us|ersupp.f|
|00005450| 6c 61 67 73 3d 28 75 73 | 65 72 73 75 70 70 2e 66 |lags=(us|ersupp.f|
|00005460| 6c 61 67 73 7c 55 53 5f | 52 45 47 49 53 29 3b 0a |lags|US_|REGIS);.|
|00005470| 09 09 77 72 69 74 65 79 | 65 72 73 65 6c 66 28 29 |..writey|erself()|
|00005480| 3b 0a 09 09 7d 0a 09 7d | 0a 0a 69 66 20 28 21 73 |;...}..}|..if (!s|
|00005490| 74 72 63 6d 70 28 61 61 | 61 2c 22 2e 74 71 22 29 |trcmp(aa|a,".tq")|
|000054a0| 29 20 7b 09 75 70 64 61 | 74 65 6c 73 28 29 3b 09 |) {.upda|tels();.|
|000054b0| 61 3d 30 3b 09 67 6f 74 | 6f 20 54 45 52 4d 49 4e |a=0;.got|o TERMIN|
|000054c0| 41 54 45 3b 20 7d 0a 69 | 66 20 28 21 73 74 72 63 |ATE; }.i|f (!strc|
|000054d0| 6d 70 28 61 61 61 2c 22 | 2e 74 73 22 29 29 20 7b |mp(aaa,"|.ts")) {|
|000054e0| 09 75 70 64 61 74 65 6c | 73 28 29 3b 09 61 3d 31 |.updatel|s();.a=1|
|000054f0| 3b 09 67 6f 74 6f 20 54 | 45 52 4d 49 4e 41 54 45 |;.goto T|ERMINATE|
|00005500| 3b 20 7d 0a 69 66 20 28 | 21 73 74 72 63 6d 70 28 |; }.if (|!strcmp(|
|00005510| 61 61 61 2c 22 74 22 29 | 29 20 7b 0a 09 70 72 69 |aaa,"t")|) {..pri|
|00005520| 6e 74 66 28 22 41 72 65 | 20 79 6f 75 20 73 75 72 |ntf("Are| you sur|
|00005530| 65 20 28 79 2f 6e 29 3f | 20 22 29 3b 0a 09 69 66 |e (y/n)?| ");..if|
|00005540| 20 28 79 65 73 6e 6f 28 | 29 3d 3d 31 29 20 7b 0a | (yesno(|)==1) {.|
|00005550| 09 09 75 70 64 61 74 65 | 6c 73 28 29 3b 0a 09 09 |..update|ls();...|
|00005560| 61 3d 30 3b 0a 09 09 67 | 6f 74 6f 20 54 45 52 4d |a=0;...g|oto TERM|
|00005570| 49 4e 41 54 45 3b 0a 09 | 09 7d 0a 09 7d 0a 0a 69 |INATE;..|.}..}..i|
|00005580| 66 20 28 21 73 74 72 63 | 6d 70 28 61 61 61 2c 22 |f (!strc|mp(aaa,"|
|00005590| 73 22 29 29 20 7b 0a 09 | 73 74 6f 72 65 75 67 28 |s")) {..|storeug(|
|000055a0| 29 3b 0a 09 73 6b 69 70 | 70 69 6e 67 5b 63 75 72 |);..skip|ping[cur|
|000055b0| 72 5f 72 6d 5d 3d 31 3b | 0a 09 67 6f 74 6f 20 54 |r_rm]=1;|..goto T|
|000055c0| 48 45 47 4f 54 4f 3b 0a | 09 7d 0a 0a 69 66 20 28 |HEGOTO;.|.}..if (|
|000055d0| 21 73 74 72 63 6d 70 28 | 61 61 61 2c 22 63 22 29 |!strcmp(|aaa,"c")|
|000055e0| 29 20 7b 0a 09 61 3d 66 | 6f 72 6b 28 29 3b 0a 09 |) {..a=f|ork();..|
|000055f0| 69 66 20 28 61 3d 3d 30 | 29 20 7b 0a 09 09 65 78 |if (a==0|) {...ex|
|00005600| 65 63 6c 70 28 22 63 68 | 61 74 22 2c 22 63 68 61 |eclp("ch|at","cha|
|00005610| 74 22 2c 75 73 65 72 73 | 75 70 70 2e 66 75 6c 6c |t",users|upp.full|
|00005620| 6e 61 6d 65 2c 4e 55 4c | 4c 29 3b 0a 09 09 70 72 |name,NUL|L);...pr|
|00005630| 69 6e 74 66 28 22 43 68 | 61 74 20 70 72 6f 67 72 |intf("Ch|at progr|
|00005640| 61 6d 20 6e 6f 74 20 61 | 76 61 69 6c 61 62 6c 65 |am not a|vailable|
|00005650| 2e 5c 6e 22 29 3b 0a 09 | 09 65 78 69 74 28 30 29 |.\n");..|.exit(0)|
|00005660| 3b 0a 09 09 7d 0a 09 7d | 0a 09 64 6f 20 7b 0a 09 |;...}..}|..do {..|
|00005670| 09 62 3d 77 61 69 74 28 | 29 3b 0a 09 09 7d 20 77 |.b=wait(|);...} w|
|00005680| 68 69 6c 65 28 28 62 21 | 3d 61 29 26 26 28 62 21 |hile((b!|=a)&&(b!|
|00005690| 3d 28 2d 31 29 29 29 3b | 0a 0a 69 66 20 28 21 73 |=(-1)));|..if (!s|
|000056a0| 74 72 63 6d 70 28 61 61 | 61 2c 22 2a 22 29 29 20 |trcmp(aa|a,"*")) |
|000056b0| 7b 0a 09 73 65 74 73 61 | 6e 65 28 29 3b 0a 09 73 |{..setsa|ne();..s|
|000056c0| 70 72 69 6e 74 66 28 62 | 75 66 2c 22 73 75 62 73 |printf(b|uf,"subs|
|000056d0| 79 73 74 65 6d 20 25 6c | 64 20 25 64 20 25 64 22 |ystem %l|d %d %d"|
|000056e0| 2c 0a 09 09 75 73 65 72 | 73 75 70 70 2e 65 74 65 |,...user|supp.ete|
|000056f0| 72 6e 61 6c 2c 75 73 65 | 72 73 75 70 70 2e 73 63 |rnal,use|rsupp.sc|
|00005700| 72 65 65 6e 77 69 64 74 | 68 2c 75 73 65 72 73 75 |reenwidt|h,usersu|
|00005710| 70 70 2e 61 78 6c 65 76 | 65 6c 29 3b 0a 09 73 79 |pp.axlev|el);..sy|
|00005720| 73 74 65 6d 28 62 75 66 | 29 3b 0a 09 73 74 74 79 |stem(buf|);..stty|
|00005730| 62 62 73 28 30 29 3b 0a | 09 7d 0a 0a 69 66 20 28 |bbs(0);.|.}..if (|
|00005740| 21 73 74 72 63 6d 70 28 | 61 61 61 2c 22 77 22 29 |!strcmp(|aaa,"w")|
|00005750| 29 20 7b 0a 09 73 74 74 | 79 62 62 73 28 31 29 3b |) {..stt|ybbs(1);|
|00005760| 0a 09 73 79 73 74 65 6d | 28 22 77 68 6f 62 62 73 |..system|("whobbs|
|00005770| 22 29 3b 0a 09 73 74 74 | 79 62 62 73 28 30 29 3b |");..stt|ybbs(0);|
|00005780| 0a 09 7d 0a 0a 69 66 20 | 28 21 73 74 72 63 6d 70 |..}..if |(!strcmp|
|00005790| 28 61 61 61 2c 22 2e 61 | 73 22 29 29 20 7b 0a 09 |(aaa,".a|s")) {..|
|000057a0| 70 72 69 6e 74 66 28 22 | 5c 72 20 20 20 20 20 20 |printf("|\r |
|000057b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000057c0| 20 5c 72 21 20 22 29 3b | 0a 09 67 65 74 6c 69 6e | \r! ");|..getlin|
|000057d0| 65 28 61 61 61 2c 39 39 | 29 3b 0a 09 73 65 74 73 |e(aaa,99|);..sets|
|000057e0| 61 6e 65 28 29 3b 0a 09 | 73 79 73 74 65 6d 28 61 |ane();..|system(a|
|000057f0| 61 61 29 3b 0a 09 73 74 | 74 79 62 62 73 28 30 29 |aa);..st|tybbs(0)|
|00005800| 3b 0a 09 7d 0a 0a 69 66 | 20 28 21 73 74 72 63 6d |;..}..if| (!strcm|
|00005810| 70 28 61 61 61 2c 22 2e | 65 63 22 29 29 20 7b 0a |p(aaa,".|ec")) {.|
|00005820| 09 72 65 61 64 79 65 72 | 73 65 6c 66 28 29 3b 0a |.readyer|self();.|
|00005830| 09 67 65 74 75 73 69 6e | 66 6f 28 26 75 73 65 72 |.getusin|fo(&user|
|00005840| 73 75 70 70 29 3b 0a 09 | 77 72 69 74 65 79 65 72 |supp);..|writeyer|
|00005850| 73 65 6c 66 28 29 3b 0a | 09 7d 0a 0a 69 66 20 28 |self();.|.}..if (|
|00005860| 21 73 74 72 63 6d 70 28 | 61 61 61 2c 22 2e 61 75 |!strcmp(|aaa,".au|
|00005870| 22 29 29 20 7b 0a 09 66 | 69 6c 65 3d 65 6f 70 65 |")) {..f|ile=eope|
|00005880| 6e 28 22 75 73 65 72 73 | 75 70 70 22 2c 4f 5f 52 |n("users|upp",O_R|
|00005890| 44 57 52 29 3b 0a 09 70 | 72 69 6e 74 66 28 22 55 |DWR);..p|rintf("U|
|000058a0| 73 65 72 20 6e 61 6d 65 | 3a 20 22 29 3b 0a 09 67 |ser name|: ");..g|
|000058b0| 65 74 6c 69 6e 65 28 61 | 61 61 2c 32 39 29 3b 0a |etline(a|aa,29);.|
|000058c0| 09 61 61 3d 66 69 6e 64 | 75 73 65 72 28 66 69 6c |.aa=find|user(fil|
|000058d0| 65 2c 61 61 61 29 3b 0a | 09 69 66 20 28 61 61 21 |e,aaa);.|.if (aa!|
|000058e0| 3d 28 2d 31 29 29 20 7b | 0a 09 09 72 65 61 64 28 |=(-1)) {|...read(|
|000058f0| 66 69 6c 65 2c 26 74 65 | 6d 70 55 53 2c 73 69 7a |file,&te|mpUS,siz|
|00005900| 65 6f 66 28 73 74 72 75 | 63 74 20 75 73 65 72 73 |eof(stru|ct users|
|00005910| 75 70 70 29 29 3b 0a 09 | 09 65 64 69 74 75 73 65 |upp));..|.edituse|
|00005920| 72 28 26 74 65 6d 70 55 | 53 29 3b 0a 09 09 6c 73 |r(&tempU|S);...ls|
|00005930| 65 65 6b 28 66 69 6c 65 | 2c 61 61 2c 30 29 3b 0a |eek(file|,aa,0);.|
|00005940| 09 09 77 72 69 74 65 28 | 66 69 6c 65 2c 26 74 65 |..write(|file,&te|
|00005950| 6d 70 55 53 2c 73 69 7a | 65 6f 66 28 73 74 72 75 |mpUS,siz|eof(stru|
|00005960| 63 74 20 75 73 65 72 73 | 75 70 70 29 29 3b 0a 09 |ct users|upp));..|
|00005970| 09 7d 0a 09 65 6c 73 65 | 20 70 72 69 6e 74 66 28 |.}..else| printf(|
|00005980| 22 4e 6f 20 73 75 63 68 | 20 75 73 65 72 2e 5c 6e |"No such| user.\n|
|00005990| 22 29 3b 0a 09 63 6c 6f | 73 65 28 66 69 6c 65 29 |");..clo|se(file)|
|000059a0| 3b 0a 09 7d 0a 0a 67 6f | 74 6f 20 4d 41 49 4e 3b |;..}..go|to MAIN;|
|000059b0| 0a 0a 0a 52 46 57 44 3a | 09 2f 2a 20 72 6f 75 74 |...RFWD:|./* rout|
|000059c0| 69 6e 65 20 66 6f 72 20 | 72 65 61 64 20 66 6f 72 |ine for |read for|
|000059d0| 77 61 72 64 2c 20 72 65 | 61 64 20 6e 65 77 2c 20 |ward, re|ad new, |
|000059e0| 72 65 61 64 20 6c 61 73 | 74 20 66 69 76 65 20 6d |read las|t five m|
|000059f0| 65 73 73 61 67 65 73 20 | 2a 2f 0a 09 73 69 67 6e |essages |*/..sign|
|00005a00| 61 6c 28 53 49 47 49 4e | 54 2c 53 49 47 5f 49 47 |al(SIGIN|T,SIG_IG|
|00005a10| 4e 29 3b 0a 09 73 69 67 | 6e 61 6c 28 53 49 47 51 |N);..sig|nal(SIGQ|
|00005a20| 55 49 54 2c 53 49 47 5f | 49 47 4e 29 3b 0a 09 63 |UIT,SIG_|IGN);..c|
|00005a30| 63 3d 75 73 65 72 73 75 | 70 70 2e 6c 61 73 74 73 |c=usersu|pp.lasts|
|00005a40| 65 65 6e 5b 63 75 72 72 | 5f 72 6d 5d 2b 31 4c 3b |een[curr|_rm]+1L;|
|00005a50| 0a 09 69 66 20 28 75 73 | 65 72 73 75 70 70 2e 66 |..if (us|ersupp.f|
|00005a60| 6c 61 67 73 20 26 20 55 | 53 5f 4c 41 53 54 4f 4c |lags & U|S_LASTOL|
|00005a70| 44 29 20 2d 2d 63 63 3b | 0a 09 66 69 6c 65 3d 65 |D) --cc;|..file=e|
|00005a80| 6f 70 65 6e 28 22 2e 2f | 4d 4d 73 74 72 75 63 74 |open("./|MMstruct|
|00005a90| 75 72 65 22 2c 4f 5f 52 | 44 4f 4e 4c 59 29 3b 0a |ure",O_R|DONLY);.|
|00005aa0| 09 61 3d 72 65 61 64 28 | 66 69 6c 65 2c 26 6d 73 |.a=read(|file,&ms|
|00005ab0| 67 6d 61 69 6e 2c 73 69 | 7a 65 6f 66 28 73 74 72 |gmain,si|zeof(str|
|00005ac0| 75 63 74 20 6d 73 67 6d | 61 69 6e 29 29 3b 20 69 |uct msgm|ain)); i|
|00005ad0| 66 20 28 61 3c 31 29 20 | 69 6e 74 65 72 72 28 34 |f (a<1) |interr(4|
|00005ae0| 35 29 3b 0a 09 63 6c 6f | 73 65 28 66 69 6c 65 29 |5);..clo|se(file)|
|00005af0| 3b 0a 09 66 6f 72 20 28 | 61 3d 62 3b 20 61 3c 4d |;..for (|a=b; a<M|
|00005b00| 53 47 53 50 45 52 52 4d | 3b 20 2b 2b 61 29 20 7b |SGSPERRM|; ++a) {|
|00005b10| 0a 09 09 69 66 20 28 66 | 75 6c 6c 72 6f 6f 6d 2e |...if (f|ullroom.|
|00005b20| 46 52 6e 75 6d 5b 61 5d | 3d 3d 30 4c 29 20 67 6f |FRnum[a]|==0L) go|
|00005b30| 74 6f 20 52 4e 45 58 54 | 3b 0a 09 09 69 66 20 28 |to RNEXT|;...if (|
|00005b40| 66 75 6c 6c 72 6f 6f 6d | 2e 46 52 6e 75 6d 5b 61 |fullroom|.FRnum[a|
|00005b50| 5d 3c 6d 73 67 6d 61 69 | 6e 2e 4d 4d 6c 6f 77 65 |]<msgmai|n.MMlowe|
|00005b60| 73 74 29 20 67 6f 74 6f | 20 52 4e 45 58 54 3b 0a |st) goto| RNEXT;.|
|00005b70| 09 09 69 66 20 28 20 28 | 63 3d 3d 31 29 20 26 26 |..if ( (|c==1) &&|
|00005b80| 20 28 66 75 6c 6c 72 6f | 6f 6d 2e 46 52 6e 75 6d | (fullro|om.FRnum|
|00005b90| 5b 61 5d 3c 63 63 29 20 | 29 20 67 6f 74 6f 20 52 |[a]<cc) |) goto R|
|00005ba0| 4e 45 58 54 3b 0a 52 41 | 47 41 49 4e 3a 09 09 65 |NEXT;.RA|GAIN:..e|
|00005bb0| 3d 72 65 61 64 5f 6d 65 | 73 73 61 67 65 28 66 75 |=read_me|ssage(fu|
|00005bc0| 6c 6c 72 6f 6f 6d 2e 46 | 52 70 6f 73 5b 61 5d 29 |llroom.F|Rpos[a])|
|00005bd0| 3b 0a 09 09 69 66 20 28 | 65 3d 3d 31 29 20 67 6f |;...if (|e==1) go|
|00005be0| 74 6f 20 52 4e 45 58 54 | 3b 0a 09 09 69 66 20 28 |to RNEXT|;...if (|
|00005bf0| 65 3d 3d 32 29 20 67 6f | 74 6f 20 52 53 54 4f 50 |e==2) go|to RSTOP|
|00005c00| 3b 0a 09 09 69 66 20 28 | 75 73 65 72 73 75 70 70 |;...if (|usersupp|
|00005c10| 2e 66 6c 61 67 73 26 55 | 53 5f 4e 4f 50 52 4f 4d |.flags&U|S_NOPROM|
|00005c20| 50 54 29 20 67 6f 74 6f | 20 52 4e 45 58 54 3b 0a |PT) goto| RNEXT;.|
|00005c30| 09 09 70 72 69 6e 74 66 | 28 22 3c 41 3e 67 61 69 |..printf|("<A>gai|
|00005c40| 6e 2c 20 3c 4e 3e 65 78 | 74 2c 20 3c 53 3e 74 6f |n, <N>ex|t, <S>to|
|00005c50| 70 20 2d 3e 20 22 29 3b | 0a 52 50 52 4f 4d 50 54 |p -> ");|.RPROMPT|
|00005c60| 32 3a 09 62 3d 69 6e 6b | 65 79 28 29 3b 20 62 3d |2:.b=ink|ey(); b=|
|00005c70| 28 62 26 31 32 37 29 3b | 20 62 3d 74 6f 6c 6f 77 |(b&127);| b=tolow|
|00005c80| 65 72 28 62 29 3b 0a 09 | 09 69 66 20 28 62 3d 3d |er(b);..|.if (b==|
|00005c90| 27 61 27 29 20 7b 20 70 | 72 69 6e 74 66 28 22 41 |'a') { p|rintf("A|
|00005ca0| 67 61 69 6e 5c 6e 22 29 | 3b 09 67 6f 74 6f 20 52 |gain\n")|;.goto R|
|00005cb0| 41 47 41 49 4e 3b 20 7d | 0a 09 09 69 66 20 28 62 |AGAIN; }|...if (b|
|00005cc0| 3d 3d 27 6e 27 29 20 7b | 20 70 72 69 6e 74 66 28 |=='n') {| printf(|
|00005cd0| 22 4e 65 78 74 5c 6e 22 | 29 3b 09 09 67 6f 74 6f |"Next\n"|);..goto|
|00005ce0| 20 52 4e 45 58 54 3b 20 | 7d 0a 09 09 69 66 20 28 | RNEXT; |}...if (|
|00005cf0| 62 3d 3d 27 73 27 29 20 | 7b 20 70 72 69 6e 74 66 |b=='s') |{ printf|
|00005d00| 28 22 53 74 6f 70 5c 6e | 22 29 3b 09 09 67 6f 74 |("Stop\n|");..got|
|00005d10| 6f 20 52 53 54 4f 50 3b | 20 7d 0a 09 69 66 28 28 |o RSTOP;| }..if((|
|00005d20| 75 73 65 72 73 75 70 70 | 2e 61 78 6c 65 76 65 6c |usersupp|.axlevel|
|00005d30| 3e 3d 36 29 7c 7c 28 75 | 73 65 72 73 75 70 70 2e |>=6)||(u|sersupp.|
|00005d40| 65 74 65 72 6e 61 6c 3d | 3d 71 75 69 63 6b 72 6f |eternal=|=quickro|
|00005d50| 6f 6d 2e 51 52 72 6f 6f | 6d 61 69 64 65 29 29 0a |om.QRroo|maide)).|
|00005d60| 09 09 69 66 20 28 28 62 | 3d 3d 27 64 27 29 26 26 |..if ((b|=='d')&&|
|00005d70| 28 63 75 72 72 5f 72 6d | 21 3d 31 29 29 20 7b 0a |(curr_rm|!=1)) {.|
|00005d80| 09 09 09 70 72 69 6e 74 | 66 28 22 44 65 6c 65 74 |...print|f("Delet|
|00005d90| 65 5c 6e 22 29 3b 0a 09 | 09 09 67 6f 74 6f 20 52 |e\n");..|..goto R|
|00005da0| 44 45 4c 45 54 45 3b 0a | 09 09 09 7d 0a 09 69 66 |DELETE;.|...}..if|
|00005db0| 28 28 75 73 65 72 73 75 | 70 70 2e 61 78 6c 65 76 |((usersu|pp.axlev|
|00005dc0| 65 6c 3e 3d 36 29 7c 7c | 28 75 73 65 72 73 75 70 |el>=6)|||(usersup|
|00005dd0| 70 2e 65 74 65 72 6e 61 | 6c 3d 3d 71 75 69 63 6b |p.eterna|l==quick|
|00005de0| 72 6f 6f 6d 2e 51 52 72 | 6f 6f 6d 61 69 64 65 29 |room.QRr|oomaide)|
|00005df0| 29 0a 09 09 69 66 20 28 | 28 62 3d 3d 27 6d 27 29 |)...if (|(b=='m')|
|00005e00| 26 26 28 63 75 72 72 5f | 72 6d 21 3d 31 29 29 20 |&&(curr_|rm!=1)) |
|00005e10| 7b 0a 09 09 09 70 72 69 | 6e 74 66 28 22 4d 6f 76 |{....pri|ntf("Mov|
|00005e20| 65 5c 6e 22 29 3b 0a 09 | 09 09 6d 6f 76 65 5f 6d |e\n");..|..move_m|
|00005e30| 65 73 73 61 67 65 28 66 | 75 6c 6c 72 6f 6f 6d 2e |essage(f|ullroom.|
|00005e40| 46 52 70 6f 73 5b 61 5d | 29 3b 0a 09 09 09 64 65 |FRpos[a]|);....de|
|00005e50| 6c 65 74 65 5f 6d 65 73 | 73 61 67 65 28 66 75 6c |lete_mes|sage(ful|
|00005e60| 6c 72 6f 6f 6d 2e 46 52 | 6e 75 6d 5b 61 5d 29 3b |lroom.FR|num[a]);|
|00005e70| 0a 09 09 09 67 6f 74 6f | 20 52 4e 45 58 54 3b 0a |....goto| RNEXT;.|
|00005e80| 09 09 09 7d 0a 09 09 67 | 6f 74 6f 20 52 50 52 4f |...}...g|oto RPRO|
|00005e90| 4d 50 54 32 3b 0a 52 4e | 45 58 54 3a 09 09 62 3d |MPT2;.RN|EXT:..b=|
|00005ea0| 62 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |b; | }|
|00005eb0| 0a 52 53 54 4f 50 3a 09 | 09 67 6f 74 6f 20 4d 41 |.RSTOP:.|.goto MA|
|00005ec0| 49 4e 3b 0a 52 44 45 4c | 45 54 45 3a 09 70 72 69 |IN;.RDEL|ETE:.pri|
|00005ed0| 6e 74 66 28 22 2d 2d 2d | 3e 20 44 65 6c 65 74 65 |ntf("---|> Delete|
|00005ee0| 20 74 68 69 73 20 6d 65 | 73 73 61 67 65 3f 20 22 | this me|ssage? "|
|00005ef0| 29 3b 0a 09 09 69 66 20 | 28 79 65 73 6e 6f 28 29 |);...if |(yesno()|
|00005f00| 3d 3d 31 29 20 64 65 6c | 65 74 65 5f 6d 65 73 73 |==1) del|ete_mess|
|00005f10| 61 67 65 28 66 75 6c 6c | 72 6f 6f 6d 2e 46 52 6e |age(full|room.FRn|
|00005f20| 75 6d 5b 61 5d 29 3b 0a | 09 09 67 6f 74 6f 20 52 |um[a]);.|..goto R|
|00005f30| 4e 45 58 54 3b 0a 0a 56 | 44 45 4c 45 54 45 3a 09 |NEXT;..V|DELETE:.|
|00005f40| 70 72 69 6e 74 66 28 22 | 2d 2d 2d 3e 20 44 65 6c |printf("|---> Del|
|00005f50| 65 74 65 20 74 68 69 73 | 20 6d 65 73 73 61 67 65 |ete this| message|
|00005f60| 3f 20 22 29 3b 0a 09 09 | 69 66 20 28 79 65 73 6e |? ");...|if (yesn|
|00005f70| 6f 28 29 3d 3d 31 29 20 | 64 65 6c 65 74 65 5f 6d |o()==1) |delete_m|
|00005f80| 65 73 73 61 67 65 28 66 | 75 6c 6c 72 6f 6f 6d 2e |essage(f|ullroom.|
|00005f90| 46 52 6e 75 6d 5b 61 5d | 29 3b 0a 09 09 67 6f 74 |FRnum[a]|);...got|
|00005fa0| 6f 20 56 4e 45 58 54 3b | 0a 0a 56 46 57 44 3a 09 |o VNEXT;|..VFWD:.|
|00005fb0| 09 2f 2a 20 72 6f 75 74 | 69 6e 65 20 66 6f 72 20 |./* rout|ine for |
|00005fc0| 72 65 61 64 20 72 65 76 | 65 72 73 65 20 2a 2f 0a |read rev|erse */.|
|00005fd0| 09 09 73 69 67 6e 61 6c | 28 53 49 47 49 4e 54 2c |..signal|(SIGINT,|
|00005fe0| 53 49 47 5f 49 47 4e 29 | 3b 0a 09 09 73 69 67 6e |SIG_IGN)|;...sign|
|00005ff0| 61 6c 28 53 49 47 51 55 | 49 54 2c 53 49 47 5f 49 |al(SIGQU|IT,SIG_I|
|00006000| 47 4e 29 3b 0a 09 09 63 | 63 3d 75 73 65 72 73 75 |GN);...c|c=usersu|
|00006010| 70 70 2e 6c 61 73 74 73 | 65 65 6e 5b 63 75 72 72 |pp.lasts|een[curr|
|00006020| 5f 72 6d 5d 2b 31 4c 3b | 0a 09 09 66 69 6c 65 3d |_rm]+1L;|...file=|
|00006030| 65 6f 70 65 6e 28 22 2e | 2f 4d 4d 73 74 72 75 63 |eopen(".|/MMstruc|
|00006040| 74 75 72 65 22 2c 4f 5f | 52 44 4f 4e 4c 59 29 3b |ture",O_|RDONLY);|
|00006050| 0a 09 61 3d 72 65 61 64 | 28 66 69 6c 65 2c 26 6d |..a=read|(file,&m|
|00006060| 73 67 6d 61 69 6e 2c 73 | 69 7a 65 6f 66 28 73 74 |sgmain,s|izeof(st|
|00006070| 72 75 63 74 20 6d 73 67 | 6d 61 69 6e 29 29 3b 20 |ruct msg|main)); |
|00006080| 69 66 20 28 61 3c 31 29 | 20 69 6e 74 65 72 72 28 |if (a<1)| interr(|
|00006090| 34 37 29 3b 0a 09 09 63 | 6c 6f 73 65 28 66 69 6c |47);...c|lose(fil|
|000060a0| 65 29 3b 0a 09 09 66 6f | 72 20 28 61 3d 28 4d 53 |e);...fo|r (a=(MS|
|000060b0| 47 53 50 45 52 52 4d 2d | 31 29 3b 20 61 3e 3d 30 |GSPERRM-|1); a>=0|
|000060c0| 3b 20 2d 2d 61 29 20 7b | 0a 09 09 69 66 20 28 20 |; --a) {|...if ( |
|000060d0| 28 63 3d 3d 31 29 20 26 | 26 20 28 66 75 6c 6c 72 |(c==1) &|& (fullr|
|000060e0| 6f 6f 6d 2e 46 52 6e 75 | 6d 5b 61 5d 3e 63 63 29 |oom.FRnu|m[a]>cc)|
|000060f0| 20 29 20 67 6f 74 6f 20 | 56 4e 45 58 54 3b 0a 09 | ) goto |VNEXT;..|
|00006100| 09 69 66 20 28 66 75 6c | 6c 72 6f 6f 6d 2e 46 52 |.if (ful|lroom.FR|
|00006110| 6e 75 6d 5b 61 5d 3c 6d | 73 67 6d 61 69 6e 2e 4d |num[a]<m|sgmain.M|
|00006120| 4d 6c 6f 77 65 73 74 29 | 20 67 6f 74 6f 20 56 4e |Mlowest)| goto VN|
|00006130| 45 58 54 3b 0a 09 09 69 | 66 20 28 66 75 6c 6c 72 |EXT;...i|f (fullr|
|00006140| 6f 6f 6d 2e 46 52 6e 75 | 6d 5b 61 5d 3d 3d 30 4c |oom.FRnu|m[a]==0L|
|00006150| 29 20 67 6f 74 6f 20 56 | 4e 45 58 54 3b 0a 56 41 |) goto V|NEXT;.VA|
|00006160| 47 41 49 4e 3a 09 09 65 | 3d 72 65 61 64 5f 6d 65 |GAIN:..e|=read_me|
|00006170| 73 73 61 67 65 28 66 75 | 6c 6c 72 6f 6f 6d 2e 46 |ssage(fu|llroom.F|
|00006180| 52 70 6f 73 5b 61 5d 29 | 3b 0a 09 09 69 66 20 28 |Rpos[a])|;...if (|
|00006190| 65 3d 3d 31 29 20 67 6f | 74 6f 20 56 4e 45 58 54 |e==1) go|to VNEXT|
|000061a0| 3b 0a 09 09 69 66 20 28 | 65 3d 3d 32 29 20 67 6f |;...if (|e==2) go|
|000061b0| 74 6f 20 56 53 54 4f 50 | 3b 0a 09 09 69 66 20 28 |to VSTOP|;...if (|
|000061c0| 75 73 65 72 73 75 70 70 | 2e 66 6c 61 67 73 20 26 |usersupp|.flags &|
|000061d0| 20 55 53 5f 4e 4f 50 52 | 4f 4d 50 54 29 20 67 6f | US_NOPR|OMPT) go|
|000061e0| 74 6f 20 56 4e 45 58 54 | 3b 0a 09 09 70 72 69 6e |to VNEXT|;...prin|
|000061f0| 74 66 28 22 3c 41 3e 67 | 61 69 6e 2c 20 3c 4e 3e |tf("<A>g|ain, <N>|
|00006200| 65 78 74 2c 20 3c 53 3e | 74 6f 70 20 2d 3e 20 22 |ext, <S>|top -> "|
|00006210| 29 3b 0a 56 50 52 4f 4d | 50 54 32 3a 09 62 3d 69 |);.VPROM|PT2:.b=i|
|00006220| 6e 6b 65 79 28 29 3b 20 | 62 3d 28 62 26 31 32 37 |nkey(); |b=(b&127|
|00006230| 29 3b 20 62 3d 74 6f 6c | 6f 77 65 72 28 62 29 3b |); b=tol|ower(b);|
|00006240| 0a 09 09 69 66 20 28 62 | 3d 3d 27 61 27 29 20 7b |...if (b|=='a') {|
|00006250| 20 70 72 69 6e 74 66 28 | 22 41 67 61 69 6e 5c 6e | printf(|"Again\n|
|00006260| 22 29 3b 09 67 6f 74 6f | 20 56 41 47 41 49 4e 3b |");.goto| VAGAIN;|
|00006270| 20 7d 0a 09 09 69 66 20 | 28 62 3d 3d 27 6e 27 29 | }...if |(b=='n')|
|00006280| 20 7b 20 70 72 69 6e 74 | 66 28 22 4e 65 78 74 5c | { print|f("Next\|
|00006290| 6e 22 29 3b 09 09 67 6f | 74 6f 20 56 4e 45 58 54 |n");..go|to VNEXT|
|000062a0| 3b 20 7d 0a 09 09 69 66 | 20 28 62 3d 3d 27 73 27 |; }...if| (b=='s'|
|000062b0| 29 20 7b 20 70 72 69 6e | 74 66 28 22 53 74 6f 70 |) { prin|tf("Stop|
|000062c0| 5c 6e 22 29 3b 09 09 67 | 6f 74 6f 20 56 53 54 4f |\n");..g|oto VSTO|
|000062d0| 50 3b 20 7d 0a 09 69 66 | 28 28 75 73 65 72 73 75 |P; }..if|((usersu|
|000062e0| 70 70 2e 61 78 6c 65 76 | 65 6c 3e 3d 36 29 7c 7c |pp.axlev|el>=6)|||
|000062f0| 28 75 73 65 72 73 75 70 | 70 2e 65 74 65 72 6e 61 |(usersup|p.eterna|
|00006300| 6c 3d 3d 71 75 69 63 6b | 72 6f 6f 6d 2e 51 52 72 |l==quick|room.QRr|
|00006310| 6f 6f 6d 61 69 64 65 29 | 29 0a 09 09 69 66 20 28 |oomaide)|)...if (|
|00006320| 28 62 3d 3d 27 64 27 29 | 26 26 28 63 75 72 72 5f |(b=='d')|&&(curr_|
|00006330| 72 6d 21 3d 31 29 29 0a | 09 09 09 7b 20 70 72 69 |rm!=1)).|...{ pri|
|00006340| 6e 74 66 28 22 44 65 6c | 65 74 65 5c 6e 22 29 3b |ntf("Del|ete\n");|
|00006350| 20 67 6f 74 6f 20 56 44 | 45 4c 45 54 45 3b 20 7d | goto VD|ELETE; }|
|00006360| 0a 09 69 66 28 28 75 73 | 65 72 73 75 70 70 2e 61 |..if((us|ersupp.a|
|00006370| 78 6c 65 76 65 6c 3e 3d | 36 29 7c 7c 28 75 73 65 |xlevel>=|6)||(use|
|00006380| 72 73 75 70 70 2e 65 74 | 65 72 6e 61 6c 3d 3d 71 |rsupp.et|ernal==q|
|00006390| 75 69 63 6b 72 6f 6f 6d | 2e 51 52 72 6f 6f 6d 61 |uickroom|.QRrooma|
|000063a0| 69 64 65 29 29 0a 09 09 | 69 66 20 28 28 62 3d 3d |ide))...|if ((b==|
|000063b0| 27 6d 27 29 26 26 28 63 | 75 72 72 5f 72 6d 21 3d |'m')&&(c|urr_rm!=|
|000063c0| 31 29 29 20 7b 0a 09 09 | 09 70 72 69 6e 74 66 28 |1)) {...|.printf(|
|000063d0| 22 4d 6f 76 65 5c 6e 22 | 29 3b 0a 09 09 09 6d 6f |"Move\n"|);....mo|
|000063e0| 76 65 5f 6d 65 73 73 61 | 67 65 28 66 75 6c 6c 72 |ve_messa|ge(fullr|
|000063f0| 6f 6f 6d 2e 46 52 70 6f | 73 5b 61 5d 29 3b 0a 09 |oom.FRpo|s[a]);..|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.