home *** CD-ROM | disk | FTP | other *** search
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: 3292
Confidence | Program | Detection | Match Type | Support
|
---|
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
| makefile script, 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 6e 69 | 63 6b 65 6c 40 6b 6f 6b |From: ni|ckel@kok|
|00000010| 6f 73 2e 63 73 2e 74 75 | 2d 62 65 72 6c 69 6e 2e |os.cs.tu|-berlin.|
|00000020| 64 65 20 28 4a 75 65 72 | 67 65 6e 20 4e 69 63 6b |de (Juer|gen Nick|
|00000030| 65 6c 73 65 6e 29 0a 4e | 65 77 73 67 72 6f 75 70 |elsen).N|ewsgroup|
|00000040| 73 3a 20 61 6c 74 2e 73 | 6f 75 72 63 65 73 0a 53 |s: alt.s|ources.S|
|00000050| 75 62 6a 65 63 74 3a 20 | 6c 6f 63 6b 74 74 79 20 |ubject: |locktty |
|00000060| 31 2e 31 20 2d 2d 20 6c | 6f 63 6b 20 74 65 72 6d |1.1 -- l|ock term|
|00000070| 69 6e 61 6c 20 28 31 20 | 6f 66 20 31 29 0a 4d 65 |inal (1 |of 1).Me|
|00000080| 73 73 61 67 65 2d 49 44 | 3a 20 3c 4e 49 43 4b 45 |ssage-ID|: <NICKE|
|00000090| 4c 2e 39 31 4d 61 79 36 | 31 34 33 32 35 36 40 6b |L.91May6|143256@k|
|000000a0| 6f 6b 6f 73 2e 63 73 2e | 74 75 2d 62 65 72 6c 69 |okos.cs.|tu-berli|
|000000b0| 6e 2e 64 65 3e 0a 44 61 | 74 65 3a 20 36 20 4d 61 |n.de>.Da|te: 6 Ma|
|000000c0| 79 20 39 31 20 31 32 3a | 33 32 3a 35 36 20 47 4d |y 91 12:|32:56 GM|
|000000d0| 54 0a 0a 46 72 6f 6d 20 | 52 45 41 44 4d 45 3a 0a |T..From |README:.|
|000000e0| 0a 6c 6f 63 6b 74 74 79 | 20 31 2e 31 0a 0a 41 20 |.locktty| 1.1..A |
|000000f0| 6c 6f 6e 67 20 74 69 6d | 65 20 49 20 77 61 73 20 |long tim|e I was |
|00000100| 6c 6f 6f 6b 69 6e 67 20 | 66 6f 72 20 61 20 75 74 |looking |for a ut|
|00000110| 69 6c 69 74 79 20 74 6f | 20 6c 6f 63 6b 20 74 68 |ility to| lock th|
|00000120| 65 20 73 63 72 65 65 6e | 20 6f 66 20 61 6e 20 41 |e screen| of an A|
|00000130| 53 43 49 49 0a 74 65 72 | 6d 69 6e 61 6c 2c 20 73 |SCII.ter|minal, s|
|00000140| 6f 6d 65 74 68 69 6e 67 | 20 6c 69 6b 65 20 6c 6f |omething| like lo|
|00000150| 63 6b 73 63 72 65 65 6e | 20 6f 72 20 78 6c 6f 63 |ckscreen| or xloc|
|00000160| 6b 20 6f 6e 20 53 75 6e | 76 69 65 77 20 72 65 73 |k on Sun|view res|
|00000170| 70 2e 20 58 20 57 69 6e | 64 6f 77 73 2c 0a 62 75 |p. X Win|dows,.bu|
|00000180| 74 20 64 69 64 6e 27 74 | 20 66 69 6e 64 20 61 6e |t didn't| find an|
|00000190| 79 74 68 69 6e 67 2e 0a | 0a 4f 4b 2c 20 68 65 72 |ything..|.OK, her|
|000001a0| 65 20 69 73 20 22 6c 6f | 63 6b 74 74 79 22 2e 20 |e is "lo|cktty". |
|000001b0| 54 6f 20 6b 65 65 70 20 | 69 74 20 70 6f 72 74 61 |To keep |it porta|
|000001c0| 62 6c 65 20 65 76 65 6e | 20 66 6f 72 20 73 79 73 |ble even| for sys|
|000001d0| 74 65 6d 73 20 77 69 74 | 68 20 61 0a 73 68 61 64 |tems wit|h a.shad|
|000001e0| 6f 77 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |ow passw|ord file|
|000001f0| 2c 20 49 20 6b 65 65 70 | 20 74 68 65 20 63 72 79 |, I keep| the cry|
|00000200| 70 74 65 64 20 70 61 73 | 73 77 6f 72 64 20 69 6e |pted pas|sword in|
|00000210| 20 61 20 66 69 6c 65 20 | 69 6e 20 74 68 65 0a 75 | a file |in the.u|
|00000220| 73 65 72 27 73 20 68 6f | 6d 65 20 64 69 72 65 63 |ser's ho|me direc|
|00000230| 74 6f 72 79 2e 20 49 66 | 20 74 68 65 20 66 69 6c |tory. If| the fil|
|00000240| 65 20 64 6f 65 73 20 6e | 6f 74 20 65 78 69 73 74 |e does n|ot exist|
|00000250| 2c 20 74 68 65 20 75 73 | 65 72 20 69 73 0a 70 72 |, the us|er is.pr|
|00000260| 6f 6d 70 74 65 64 20 66 | 6f 72 20 61 20 70 61 73 |ompted f|or a pas|
|00000270| 73 77 6f 72 64 2e 0a 0a | 54 68 65 20 70 61 73 73 |sword...|The pass|
|00000280| 77 6f 72 64 20 66 69 6c | 65 20 63 61 6e 20 62 65 |word fil|e can be|
|00000290| 20 63 68 61 6e 67 65 64 | 20 62 79 20 75 73 69 6e | changed| by usin|
|000002a0| 67 20 74 68 65 20 2d 70 | 20 6f 70 74 69 6f 6e 2e |g the -p| option.|
|000002b0| 0a 0a 43 68 61 6e 67 65 | 73 20 74 6f 20 31 2e 30 |..Change|s to 1.0|
|000002c0| 3a 0a 20 20 2d 20 63 72 | 79 70 74 28 29 20 61 6e |:. - cr|ypt() an|
|000002d0| 64 20 67 65 74 65 6e 76 | 28 29 20 70 72 65 64 65 |d getenv|() prede|
|000002e0| 63 6c 61 72 65 64 20 28 | 66 6f 72 20 41 4e 53 49 |clared (|for ANSI|
|000002f0| 20 63 6f 6d 70 69 6c 65 | 72 73 29 0a 20 20 2d 20 | compile|rs). - |
|00000300| 65 72 72 6e 6f 20 64 65 | 63 6c 61 72 65 64 20 28 |errno de|clared (|
|00000310| 69 73 6e 27 74 20 64 65 | 63 6c 61 72 65 64 20 69 |isn't de|clared i|
|00000320| 6e 20 65 76 65 72 79 20 | 65 72 72 6e 6f 2e 68 29 |n every |errno.h)|
|00000330| 0a 20 20 2d 20 69 6e 73 | 65 72 74 65 64 20 66 66 |. - ins|erted ff|
|00000340| 6c 75 73 68 28 29 20 61 | 66 74 65 72 20 65 76 65 |lush() a|fter eve|
|00000350| 72 79 20 28 66 29 70 75 | 74 73 28 29 0a 20 20 2d |ry (f)pu|ts(). -|
|00000360| 20 75 6e 6c 6f 63 6b 20 | 70 72 6f 6d 70 74 20 69 | unlock |prompt i|
|00000370| 73 20 72 65 61 6c 6c 79 | 20 65 72 61 73 65 64 20 |s really| erased |
|00000380| 6e 6f 77 0a 20 20 2d 20 | 74 68 65 20 6e 75 6d 62 |now. - |the numb|
|00000390| 65 72 20 6f 66 20 66 61 | 69 6c 65 64 20 75 6e 6c |er of fa|iled unl|
|000003a0| 6f 63 6b 20 61 74 74 65 | 6d 70 74 73 20 69 73 20 |ock atte|mpts is |
|000003b0| 64 69 73 70 6c 61 79 65 | 64 20 61 66 74 65 72 20 |displaye|d after |
|000003c0| 75 6e 6c 6f 63 6b 0a 20 | 20 2d 20 75 73 65 72 6e |unlock. | - usern|
|000003d0| 61 6d 65 20 61 6e 64 20 | 68 6f 73 74 6e 61 6d 65 |ame and |hostname|
|000003e0| 20 61 72 65 20 64 69 73 | 70 6c 61 79 65 64 20 69 | are dis|played i|
|000003f0| 6e 20 74 68 65 20 75 6e | 6c 6f 63 6b 20 70 72 6f |n the un|lock pro|
|00000400| 6d 70 74 0a 0a 54 68 65 | 73 65 20 63 68 61 6e 67 |mpt..The|se chang|
|00000410| 65 73 20 77 65 72 65 20 | 69 6e 73 70 69 72 65 64 |es were |inspired|
|00000420| 20 6f 72 20 73 75 67 67 | 65 73 74 65 64 20 62 79 | or sugg|ested by|
|00000430| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 70 | the fol|lowing p|
|00000440| 65 6f 70 6c 65 3a 0a 44 | 61 76 69 64 20 41 2e 20 |eople:.D|avid A. |
|00000450| 42 65 72 73 6f 6e 2c 20 | 54 69 6d 20 44 61 77 73 |Berson, |Tim Daws|
|00000460| 6f 6e 2c 20 47 72 65 67 | 20 4d 69 6c 6c 65 72 2c |on, Greg| Miller,|
|00000470| 20 43 68 72 69 73 20 50 | 68 69 6c 6c 69 70 73 2c | Chris P|hillips,|
|00000480| 20 52 61 6e 64 79 20 48 | 61 6c 6c 2e 0a 0a 54 68 | Randy H|all...Th|
|00000490| 65 20 70 72 6f 67 72 61 | 6d 20 69 73 20 77 69 74 |e progra|m is wit|
|000004a0| 68 6f 75 74 20 61 6e 79 | 20 63 68 61 6e 67 65 73 |hout any| changes|
|000004b0| 20 73 75 63 63 65 73 73 | 66 75 6c 6c 79 20 74 65 | success|fully te|
|000004c0| 73 74 65 64 20 6f 6e 0a | 20 20 2d 20 53 75 6e 4f |sted on.| - SunO|
|000004d0| 53 20 34 2e 31 20 6f 6e | 20 73 75 6e 33 2c 20 73 |S 4.1 on| sun3, s|
|000004e0| 75 6e 34 2c 20 77 69 74 | 68 20 63 63 2c 20 67 63 |un4, wit|h cc, gc|
|000004f0| 63 2c 20 62 75 74 20 6f | 6e 20 61 20 73 75 6e 33 |c, but o|n a sun3|
|00000500| 20 77 69 74 68 20 63 63 | 20 61 6e 64 20 2d 4f 20 | with cc| and -O |
|00000510| 69 74 0a 20 20 20 20 74 | 68 72 6f 77 73 20 63 6f |it. t|hrows co|
|00000520| 72 65 20 73 6f 6d 65 74 | 69 6d 65 73 2c 0a 20 20 |re somet|imes,. |
|00000530| 2d 20 49 6e 74 65 72 61 | 63 74 69 76 65 20 69 78 |- Intera|ctive ix|
|00000540| 2f 33 38 36 20 32 2e 30 | 2e 32 2c 20 0a 20 20 2d |/386 2.0|.2, . -|
|00000550| 20 55 6c 74 72 69 78 20 | 57 6f 72 6b 73 79 73 74 | Ultrix |Worksyst|
|00000560| 65 6d 20 56 32 2e 31 20 | 28 52 65 76 2e 20 31 34 |em V2.1 |(Rev. 14|
|00000570| 29 2c 20 0a 20 20 2d 20 | 48 50 2d 55 58 20 37 2e |), . - |HP-UX 7.|
|00000580| 30 30 2c 0a 20 20 2d 20 | 49 52 49 58 20 53 79 73 |00,. - |IRIX Sys|
|00000590| 74 65 6d 20 56 20 52 65 | 6c 65 61 73 65 20 33 2e |tem V Re|lease 3.|
|000005a0| 32 2e 31 2c 0a 20 20 2d | 20 4e 69 78 64 6f 72 66 |2.1,. -| Nixdorf|
|000005b0| 20 54 4f 53 20 34 2e 30 | 2e 31 32 2c 0a 20 20 2d | TOS 4.0|.12,. -|
|000005c0| 20 49 42 4d 20 41 49 58 | 20 31 2e 32 20 28 50 53 | IBM AIX| 1.2 (PS|
|000005d0| 2f 32 29 2c 0a 20 20 2d | 20 43 6f 6e 76 65 78 4f |/2),. -| ConvexO|
|000005e0| 53 20 52 65 6c 65 61 73 | 65 20 56 39 2e 30 2e 0a |S Releas|e V9.0..|
|000005f0| 0a 54 6f 20 63 6f 6d 70 | 69 6c 65 20 69 74 20 75 |.To comp|ile it u|
|00000600| 6e 64 65 72 20 49 6e 74 | 65 72 61 63 74 69 76 65 |nder Int|eractive|
|00000610| 20 55 4e 49 58 2c 20 74 | 79 70 65 20 22 6d 61 6b | UNIX, t|ype "mak|
|00000620| 65 20 69 73 63 22 2c 20 | 6f 74 68 65 72 77 69 73 |e isc", |otherwis|
|00000630| 65 20 6a 75 73 74 0a 74 | 79 70 65 20 22 6d 61 6b |e just.t|ype "mak|
|00000640| 65 22 20 74 6f 20 62 75 | 69 6c 64 20 6c 6f 63 6b |e" to bu|ild lock|
|00000650| 74 74 79 2e 0a 0a 50 6c | 65 61 73 65 20 73 65 6e |tty...Pl|ease sen|
|00000660| 64 20 63 6f 72 72 65 63 | 74 69 6f 6e 73 2c 20 69 |d correc|tions, i|
|00000670| 6d 70 72 6f 76 65 6d 65 | 6e 74 73 2c 20 61 6e 64 |mproveme|nts, and|
|00000680| 20 66 6c 61 6d 65 73 20 | 74 6f 0a 0a 09 6e 69 63 | flames |to...nic|
|00000690| 6b 65 6c 40 63 73 2e 74 | 75 2d 62 65 72 6c 69 6e |kel@cs.t|u-berlin|
|000006a0| 2e 64 65 20 28 4a 75 65 | 72 67 65 6e 20 4e 69 63 |.de (Jue|rgen Nic|
|000006b0| 6b 65 6c 73 65 6e 29 0a | 0a 0a 23 21 2f 62 69 6e |kelsen).|..#!/bin|
|000006c0| 2f 73 68 0a 23 20 54 68 | 69 73 20 69 73 20 61 20 |/sh.# Th|is is a |
|000006d0| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 20 28 70 |shell ar|chive (p|
|000006e0| 72 6f 64 75 63 65 64 20 | 62 79 20 73 68 61 72 20 |roduced |by shar |
|000006f0| 33 2e 34 39 29 0a 23 20 | 54 6f 20 65 78 74 72 61 |3.49).# |To extra|
|00000700| 63 74 20 74 68 65 20 66 | 69 6c 65 73 20 66 72 6f |ct the f|iles fro|
|00000710| 6d 20 74 68 69 73 20 61 | 72 63 68 69 76 65 2c 20 |m this a|rchive, |
|00000720| 73 61 76 65 20 69 74 20 | 74 6f 20 61 20 66 69 6c |save it |to a fil|
|00000730| 65 2c 20 72 65 6d 6f 76 | 65 0a 23 20 65 76 65 72 |e, remov|e.# ever|
|00000740| 79 74 68 69 6e 67 20 61 | 62 6f 76 65 20 74 68 65 |ything a|bove the|
|00000750| 20 22 21 2f 62 69 6e 2f | 73 68 22 20 6c 69 6e 65 | "!/bin/|sh" line|
|00000760| 20 61 62 6f 76 65 2c 20 | 61 6e 64 20 74 79 70 65 | above, |and type|
|00000770| 20 22 73 68 20 66 69 6c | 65 5f 6e 61 6d 65 22 2e | "sh fil|e_name".|
|00000780| 0a 23 0a 23 20 6d 61 64 | 65 20 30 35 2f 30 36 2f |.#.# mad|e 05/06/|
|00000790| 31 39 39 31 20 31 32 3a | 32 33 20 55 54 43 20 62 |1991 12:|23 UTC b|
|000007a0| 79 20 61 30 35 32 38 40 | 67 72 61 79 33 0a 23 20 |y a0528@|gray3.# |
|000007b0| 53 6f 75 72 63 65 20 64 | 69 72 65 63 74 6f 72 79 |Source d|irectory|
|000007c0| 20 2f 75 73 72 2f 61 30 | 35 32 38 2f 73 72 63 2f | /usr/a0|528/src/|
|000007d0| 6c 6f 63 6b 74 74 79 0a | 23 0a 23 20 65 78 69 73 |locktty.|#.# exis|
|000007e0| 74 69 6e 67 20 66 69 6c | 65 73 20 77 69 6c 6c 20 |ting fil|es will |
|000007f0| 4e 4f 54 20 62 65 20 6f | 76 65 72 77 72 69 74 74 |NOT be o|verwritt|
|00000800| 65 6e 20 75 6e 6c 65 73 | 73 20 2d 63 20 69 73 20 |en unles|s -c is |
|00000810| 73 70 65 63 69 66 69 65 | 64 0a 23 0a 23 20 54 68 |specifie|d.#.# Th|
|00000820| 69 73 20 73 68 61 72 20 | 63 6f 6e 74 61 69 6e 73 |is shar |contains|
|00000830| 3a 0a 23 20 6c 65 6e 67 | 74 68 20 20 6d 6f 64 65 |:.# leng|th mode|
|00000840| 20 20 20 20 20 20 20 6e | 61 6d 65 0a 23 20 2d 2d | n|ame.# --|
|00000850| 2d 2d 2d 2d 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |---- ---|------- |
|00000860| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0a 23 20 20 20 20 |--------|--.# |
|00000890| 32 34 33 20 2d 72 77 2d | 72 2d 2d 72 2d 2d 20 4d |243 -rw-|r--r-- M|
|000008a0| 61 6b 65 66 69 6c 65 0a | 23 20 20 20 31 34 39 35 |akefile.|# 1495|
|000008b0| 20 2d 72 77 2d 72 2d 2d | 72 2d 2d 20 52 45 41 44 | -rw-r--|r-- READ|
|000008c0| 4d 45 0a 23 20 20 20 31 | 34 33 39 20 2d 72 77 2d |ME.# 1|439 -rw-|
|000008d0| 72 2d 2d 72 2d 2d 20 6c | 6f 63 6b 74 74 79 2e 31 |r--r-- l|ocktty.1|
|000008e0| 0a 23 20 20 20 37 30 31 | 34 20 2d 72 77 2d 72 2d |.# 701|4 -rw-r-|
|000008f0| 2d 72 2d 2d 20 6c 6f 63 | 6b 74 74 79 2e 63 0a 23 |-r-- loc|ktty.c.#|
|00000900| 0a 23 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.# =====|========|
|00000910| 20 4d 61 6b 65 66 69 6c | 65 20 3d 3d 3d 3d 3d 3d | Makefil|e ======|
|00000920| 3d 3d 3d 3d 3d 3d 3d 3d | 0a 69 66 20 74 65 73 74 |========|.if test|
|00000930| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 20 2d | -f 'Mak|efile' -|
|00000940| 61 20 58 22 24 31 22 20 | 21 3d 20 58 22 2d 63 22 |a X"$1" |!= X"-c"|
|00000950| 3b 20 74 68 65 6e 0a 09 | 65 63 68 6f 20 27 78 20 |; then..|echo 'x |
|00000960| 2d 20 73 6b 69 70 70 69 | 6e 67 20 4d 61 6b 65 66 |- skippi|ng Makef|
|00000970| 69 6c 65 20 28 46 69 6c | 65 20 61 6c 72 65 61 64 |ile (Fil|e alread|
|00000980| 79 20 65 78 69 73 74 73 | 29 27 0a 65 6c 73 65 0a |y exists|)'.else.|
|00000990| 65 63 68 6f 20 27 78 20 | 2d 20 65 78 74 72 61 63 |echo 'x |- extrac|
|000009a0| 74 69 6e 67 20 4d 61 6b | 65 66 69 6c 65 20 28 54 |ting Mak|efile (T|
|000009b0| 65 78 74 29 27 0a 73 65 | 64 20 27 73 2f 5e 58 2f |ext)'.se|d 's/^X/|
|000009c0| 2f 27 20 3c 3c 20 27 53 | 48 41 52 5f 45 4f 46 27 |/' << 'S|HAR_EOF'|
|000009d0| 20 3e 20 27 4d 61 6b 65 | 66 69 6c 65 27 20 26 26 | > 'Make|file' &&|
|000009e0| 0a 43 43 20 3d 20 63 63 | 0a 4c 49 42 53 20 3d 20 |.CC = cc|.LIBS = |
|000009f0| 2d 6c 63 75 72 73 65 73 | 20 2d 6c 74 65 72 6d 63 |-lcurses| -ltermc|
|00000a00| 61 70 0a 53 48 45 4c 4c | 20 3d 20 2f 62 69 6e 2f |ap.SHELL| = /bin/|
|00000a10| 73 68 0a 43 46 4c 41 47 | 53 20 3d 20 2d 4f 0a 53 |sh.CFLAG|S = -O.S|
|00000a20| 4f 55 52 43 45 20 3d 20 | 6c 6f 63 6b 74 74 79 2e |OURCE = |locktty.|
|00000a30| 63 0a 54 41 52 47 45 54 | 20 3d 20 6c 6f 63 6b 74 |c.TARGET| = lockt|
|00000a40| 74 79 0a 58 0a 24 28 54 | 41 52 47 45 54 29 20 3a |ty.X.$(T|ARGET) :|
|00000a50| 20 24 28 53 4f 55 52 43 | 45 29 0a 58 09 24 28 43 | $(SOURC|E).X.$(C|
|00000a60| 43 29 20 24 28 43 46 4c | 41 47 53 29 20 2d 6f 20 |C) $(CFL|AGS) -o |
|00000a70| 24 28 54 41 52 47 45 54 | 29 20 24 28 53 4f 55 52 |$(TARGET|) $(SOUR|
|00000a80| 43 45 29 20 24 28 4c 49 | 42 53 29 0a 58 0a 69 73 |CE) $(LI|BS).X.is|
|00000a90| 63 20 3a 0a 58 09 6d 61 | 6b 65 20 4c 49 42 53 3d |c :.X.ma|ke LIBS=|
|00000aa0| 22 24 28 4c 49 42 53 29 | 20 2d 6c 69 6e 65 74 22 |"$(LIBS)| -linet"|
|00000ab0| 0a 58 0a 63 6c 65 61 6e | 20 3a 20 0a 58 09 72 6d |.X.clean| : .X.rm|
|00000ac0| 20 2d 66 20 2a 2e 6f 20 | 63 6f 72 65 20 2a 7e 20 | -f *.o |core *~ |
|00000ad0| 24 28 54 41 52 47 45 54 | 29 0a 53 48 41 52 5f 45 |$(TARGET|).SHAR_E|
|00000ae0| 4f 46 0a 63 68 6d 6f 64 | 20 30 36 34 34 20 4d 61 |OF.chmod| 0644 Ma|
|00000af0| 6b 65 66 69 6c 65 20 7c | 7c 0a 65 63 68 6f 20 27 |kefile |||.echo '|
|00000b00| 72 65 73 74 6f 72 65 20 | 6f 66 20 4d 61 6b 65 66 |restore |of Makef|
|00000b10| 69 6c 65 20 66 61 69 6c | 65 64 27 0a 57 63 5f 63 |ile fail|ed'.Wc_c|
|00000b20| 3d 22 60 77 63 20 2d 63 | 20 3c 20 27 4d 61 6b 65 |="`wc -c| < 'Make|
|00000b30| 66 69 6c 65 27 60 22 0a | 74 65 73 74 20 32 34 33 |file'`".|test 243|
|00000b40| 20 2d 65 71 20 22 24 57 | 63 5f 63 22 20 7c 7c 0a | -eq "$W|c_c" ||.|
|00000b50| 09 65 63 68 6f 20 27 4d | 61 6b 65 66 69 6c 65 3a |.echo 'M|akefile:|
|00000b60| 20 6f 72 69 67 69 6e 61 | 6c 20 73 69 7a 65 20 32 | origina|l size 2|
|00000b70| 34 33 2c 20 63 75 72 72 | 65 6e 74 20 73 69 7a 65 |43, curr|ent size|
|00000b80| 27 20 22 24 57 63 5f 63 | 22 0a 66 69 0a 23 20 3d |' "$Wc_c|".fi.# =|
|00000b90| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 20 52 45 41 |========|==== REA|
|00000ba0| 44 4d 45 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |DME ====|========|
|00000bb0| 3d 3d 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 52 |==.if te|st -f 'R|
|00000bc0| 45 41 44 4d 45 27 20 2d | 61 20 58 22 24 31 22 20 |EADME' -|a X"$1" |
|00000bd0| 21 3d 20 58 22 2d 63 22 | 3b 20 74 68 65 6e 0a 09 |!= X"-c"|; then..|
|00000be0| 65 63 68 6f 20 27 78 20 | 2d 20 73 6b 69 70 70 69 |echo 'x |- skippi|
|00000bf0| 6e 67 20 52 45 41 44 4d | 45 20 28 46 69 6c 65 20 |ng READM|E (File |
|00000c00| 61 6c 72 65 61 64 79 20 | 65 78 69 73 74 73 29 27 |already |exists)'|
|00000c10| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 27 78 20 2d 20 |.else.ec|ho 'x - |
|00000c20| 65 78 74 72 61 63 74 69 | 6e 67 20 52 45 41 44 4d |extracti|ng READM|
|00000c30| 45 20 28 54 65 78 74 29 | 27 0a 73 65 64 20 27 73 |E (Text)|'.sed 's|
|00000c40| 2f 5e 58 2f 2f 27 20 3c | 3c 20 27 53 48 41 52 5f |/^X//' <|< 'SHAR_|
|00000c50| 45 4f 46 27 20 3e 20 27 | 52 45 41 44 4d 45 27 20 |EOF' > '|README' |
|00000c60| 26 26 0a 6c 6f 63 6b 74 | 74 79 20 31 2e 31 0a 58 |&&.lockt|ty 1.1.X|
|00000c70| 0a 41 20 6c 6f 6e 67 20 | 74 69 6d 65 20 49 20 77 |.A long |time I w|
|00000c80| 61 73 20 6c 6f 6f 6b 69 | 6e 67 20 66 6f 72 20 61 |as looki|ng for a|
|00000c90| 20 75 74 69 6c 69 74 79 | 20 74 6f 20 6c 6f 63 6b | utility| to lock|
|00000ca0| 20 74 68 65 20 73 63 72 | 65 65 6e 20 6f 66 20 61 | the scr|een of a|
|00000cb0| 6e 20 41 53 43 49 49 0a | 74 65 72 6d 69 6e 61 6c |n ASCII.|terminal|
|00000cc0| 2c 20 73 6f 6d 65 74 68 | 69 6e 67 20 6c 69 6b 65 |, someth|ing like|
|00000cd0| 20 6c 6f 63 6b 73 63 72 | 65 65 6e 20 6f 72 20 78 | lockscr|een or x|
|00000ce0| 6c 6f 63 6b 20 6f 6e 20 | 53 75 6e 76 69 65 77 20 |lock on |Sunview |
|00000cf0| 72 65 73 70 2e 20 58 20 | 57 69 6e 64 6f 77 73 2c |resp. X |Windows,|
|00000d00| 0a 62 75 74 20 64 69 64 | 6e 27 74 20 66 69 6e 64 |.but did|n't find|
|00000d10| 20 61 6e 79 74 68 69 6e | 67 2e 0a 58 0a 4f 4b 2c | anythin|g..X.OK,|
|00000d20| 20 68 65 72 65 20 69 73 | 20 22 6c 6f 63 6b 74 74 | here is| "locktt|
|00000d30| 79 22 2e 20 54 6f 20 6b | 65 65 70 20 69 74 20 70 |y". To k|eep it p|
|00000d40| 6f 72 74 61 62 6c 65 20 | 65 76 65 6e 20 66 6f 72 |ortable |even for|
|00000d50| 20 73 79 73 74 65 6d 73 | 20 77 69 74 68 20 61 0a | systems| with a.|
|00000d60| 73 68 61 64 6f 77 20 70 | 61 73 73 77 6f 72 64 20 |shadow p|assword |
|00000d70| 66 69 6c 65 2c 20 49 20 | 6b 65 65 70 20 74 68 65 |file, I |keep the|
|00000d80| 20 63 72 79 70 74 65 64 | 20 70 61 73 73 77 6f 72 | crypted| passwor|
|00000d90| 64 20 69 6e 20 61 20 66 | 69 6c 65 20 69 6e 20 74 |d in a f|ile in t|
|00000da0| 68 65 0a 75 73 65 72 27 | 73 20 68 6f 6d 65 20 64 |he.user'|s home d|
|00000db0| 69 72 65 63 74 6f 72 79 | 2e 20 49 66 20 74 68 65 |irectory|. If the|
|00000dc0| 20 66 69 6c 65 20 64 6f | 65 73 20 6e 6f 74 20 65 | file do|es not e|
|00000dd0| 78 69 73 74 2c 20 74 68 | 65 20 75 73 65 72 20 69 |xist, th|e user i|
|00000de0| 73 0a 70 72 6f 6d 70 74 | 65 64 20 66 6f 72 20 61 |s.prompt|ed for a|
|00000df0| 20 70 61 73 73 77 6f 72 | 64 2e 0a 58 0a 54 68 65 | passwor|d..X.The|
|00000e00| 20 70 61 73 73 77 6f 72 | 64 20 66 69 6c 65 20 63 | passwor|d file c|
|00000e10| 61 6e 20 62 65 20 63 68 | 61 6e 67 65 64 20 62 79 |an be ch|anged by|
|00000e20| 20 75 73 69 6e 67 20 74 | 68 65 20 2d 70 20 6f 70 | using t|he -p op|
|00000e30| 74 69 6f 6e 2e 0a 58 0a | 43 68 61 6e 67 65 73 20 |tion..X.|Changes |
|00000e40| 74 6f 20 31 2e 30 3a 0a | 58 20 20 2d 20 63 72 79 |to 1.0:.|X - cry|
|00000e50| 70 74 28 29 20 61 6e 64 | 20 67 65 74 65 6e 76 28 |pt() and| getenv(|
|00000e60| 29 20 70 72 65 64 65 63 | 6c 61 72 65 64 20 28 66 |) predec|lared (f|
|00000e70| 6f 72 20 41 4e 53 49 20 | 63 6f 6d 70 69 6c 65 72 |or ANSI |compiler|
|00000e80| 73 29 0a 58 20 20 2d 20 | 65 72 72 6e 6f 20 64 65 |s).X - |errno de|
|00000e90| 63 6c 61 72 65 64 20 28 | 69 73 6e 27 74 20 64 65 |clared (|isn't de|
|00000ea0| 63 6c 61 72 65 64 20 69 | 6e 20 65 76 65 72 79 20 |clared i|n every |
|00000eb0| 65 72 72 6e 6f 2e 68 29 | 0a 58 20 20 2d 20 69 6e |errno.h)|.X - in|
|00000ec0| 73 65 72 74 65 64 20 66 | 66 6c 75 73 68 28 29 20 |serted f|flush() |
|00000ed0| 61 66 74 65 72 20 65 76 | 65 72 79 20 28 66 29 70 |after ev|ery (f)p|
|00000ee0| 75 74 73 28 29 0a 58 20 | 20 2d 20 75 6e 6c 6f 63 |uts().X | - unloc|
|00000ef0| 6b 20 70 72 6f 6d 70 74 | 20 69 73 20 72 65 61 6c |k prompt| is real|
|00000f00| 6c 79 20 65 72 61 73 65 | 64 20 6e 6f 77 0a 58 20 |ly erase|d now.X |
|00000f10| 20 2d 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 | - the n|umber of|
|00000f20| 20 66 61 69 6c 65 64 20 | 75 6e 6c 6f 63 6b 20 61 | failed |unlock a|
|00000f30| 74 74 65 6d 70 74 73 20 | 69 73 20 64 69 73 70 6c |ttempts |is displ|
|00000f40| 61 79 65 64 20 61 66 74 | 65 72 20 75 6e 6c 6f 63 |ayed aft|er unloc|
|00000f50| 6b 0a 58 20 20 2d 20 75 | 73 65 72 6e 61 6d 65 20 |k.X - u|sername |
|00000f60| 61 6e 64 20 68 6f 73 74 | 6e 61 6d 65 20 61 72 65 |and host|name are|
|00000f70| 20 64 69 73 70 6c 61 79 | 65 64 20 69 6e 20 74 68 | display|ed in th|
|00000f80| 65 20 75 6e 6c 6f 63 6b | 20 70 72 6f 6d 70 74 0a |e unlock| prompt.|
|00000f90| 58 0a 54 68 65 73 65 20 | 63 68 61 6e 67 65 73 20 |X.These |changes |
|00000fa0| 77 65 72 65 20 69 6e 73 | 70 69 72 65 64 20 6f 72 |were ins|pired or|
|00000fb0| 20 73 75 67 67 65 73 74 | 65 64 20 62 79 20 74 68 | suggest|ed by th|
|00000fc0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 70 65 6f 70 |e follow|ing peop|
|00000fd0| 6c 65 3a 0a 44 61 76 69 | 64 20 41 2e 20 42 65 72 |le:.Davi|d A. Ber|
|00000fe0| 73 6f 6e 2c 20 54 69 6d | 20 44 61 77 73 6f 6e 2c |son, Tim| Dawson,|
|00000ff0| 20 47 72 65 67 20 4d 69 | 6c 6c 65 72 2c 20 43 68 | Greg Mi|ller, Ch|
|00001000| 72 69 73 20 50 68 69 6c | 6c 69 70 73 2c 20 52 61 |ris Phil|lips, Ra|
|00001010| 6e 64 79 20 48 61 6c 6c | 2e 0a 58 0a 54 68 65 20 |ndy Hall|..X.The |
|00001020| 70 72 6f 67 72 61 6d 20 | 69 73 20 77 69 74 68 6f |program |is witho|
|00001030| 75 74 20 61 6e 79 20 63 | 68 61 6e 67 65 73 20 73 |ut any c|hanges s|
|00001040| 75 63 63 65 73 73 66 75 | 6c 6c 79 20 74 65 73 74 |uccessfu|lly test|
|00001050| 65 64 20 6f 6e 0a 58 20 | 20 2d 20 53 75 6e 4f 53 |ed on.X | - SunOS|
|00001060| 20 34 2e 31 20 6f 6e 20 | 73 75 6e 33 2c 20 73 75 | 4.1 on |sun3, su|
|00001070| 6e 34 2c 20 77 69 74 68 | 20 63 63 2c 20 67 63 63 |n4, with| cc, gcc|
|00001080| 2c 20 62 75 74 20 6f 6e | 20 61 20 73 75 6e 33 20 |, but on| a sun3 |
|00001090| 77 69 74 68 20 63 63 20 | 61 6e 64 20 2d 4f 20 69 |with cc |and -O i|
|000010a0| 74 0a 58 20 20 20 20 74 | 68 72 6f 77 73 20 63 6f |t.X t|hrows co|
|000010b0| 72 65 20 73 6f 6d 65 74 | 69 6d 65 73 2c 0a 58 20 |re somet|imes,.X |
|000010c0| 20 2d 20 49 6e 74 65 72 | 61 63 74 69 76 65 20 69 | - Inter|active i|
|000010d0| 78 2f 33 38 36 20 32 2e | 30 2e 32 2c 20 0a 58 20 |x/386 2.|0.2, .X |
|000010e0| 20 2d 20 55 6c 74 72 69 | 78 20 57 6f 72 6b 73 79 | - Ultri|x Worksy|
|000010f0| 73 74 65 6d 20 56 32 2e | 31 20 28 52 65 76 2e 20 |stem V2.|1 (Rev. |
|00001100| 31 34 29 2c 20 0a 58 20 | 20 2d 20 48 50 2d 55 58 |14), .X | - HP-UX|
|00001110| 20 37 2e 30 30 2c 0a 58 | 20 20 2d 20 49 52 49 58 | 7.00,.X| - IRIX|
|00001120| 20 53 79 73 74 65 6d 20 | 56 20 52 65 6c 65 61 73 | System |V Releas|
|00001130| 65 20 33 2e 32 2e 31 2c | 0a 58 20 20 2d 20 4e 69 |e 3.2.1,|.X - Ni|
|00001140| 78 64 6f 72 66 20 54 4f | 53 20 34 2e 30 2e 31 32 |xdorf TO|S 4.0.12|
|00001150| 2c 0a 58 20 20 2d 20 49 | 42 4d 20 41 49 58 20 31 |,.X - I|BM AIX 1|
|00001160| 2e 32 20 28 50 53 2f 32 | 29 2c 0a 58 20 20 2d 20 |.2 (PS/2|),.X - |
|00001170| 43 6f 6e 76 65 78 4f 53 | 20 52 65 6c 65 61 73 65 |ConvexOS| Release|
|00001180| 20 56 39 2e 30 2e 0a 58 | 0a 54 6f 20 63 6f 6d 70 | V9.0..X|.To comp|
|00001190| 69 6c 65 20 69 74 20 75 | 6e 64 65 72 20 49 6e 74 |ile it u|nder Int|
|000011a0| 65 72 61 63 74 69 76 65 | 20 55 4e 49 58 2c 20 74 |eractive| UNIX, t|
|000011b0| 79 70 65 20 22 6d 61 6b | 65 20 69 73 63 22 2c 20 |ype "mak|e isc", |
|000011c0| 6f 74 68 65 72 77 69 73 | 65 20 6a 75 73 74 0a 74 |otherwis|e just.t|
|000011d0| 79 70 65 20 22 6d 61 6b | 65 22 20 74 6f 20 62 75 |ype "mak|e" to bu|
|000011e0| 69 6c 64 20 6c 6f 63 6b | 74 74 79 2e 0a 58 0a 50 |ild lock|tty..X.P|
|000011f0| 6c 65 61 73 65 20 73 65 | 6e 64 20 63 6f 72 72 65 |lease se|nd corre|
|00001200| 63 74 69 6f 6e 73 2c 20 | 69 6d 70 72 6f 76 65 6d |ctions, |improvem|
|00001210| 65 6e 74 73 2c 20 61 6e | 64 20 66 6c 61 6d 65 73 |ents, an|d flames|
|00001220| 20 74 6f 0a 58 0a 58 09 | 6e 69 63 6b 65 6c 40 63 | to.X.X.|nickel@c|
|00001230| 73 2e 74 75 2d 62 65 72 | 6c 69 6e 2e 64 65 20 28 |s.tu-ber|lin.de (|
|00001240| 4a 75 65 72 67 65 6e 20 | 4e 69 63 6b 65 6c 73 65 |Juergen |Nickelse|
|00001250| 6e 29 0a 53 48 41 52 5f | 45 4f 46 0a 63 68 6d 6f |n).SHAR_|EOF.chmo|
|00001260| 64 20 30 36 34 34 20 52 | 45 41 44 4d 45 20 7c 7c |d 0644 R|EADME |||
|00001270| 0a 65 63 68 6f 20 27 72 | 65 73 74 6f 72 65 20 6f |.echo 'r|estore o|
|00001280| 66 20 52 45 41 44 4d 45 | 20 66 61 69 6c 65 64 27 |f README| failed'|
|00001290| 0a 57 63 5f 63 3d 22 60 | 77 63 20 2d 63 20 3c 20 |.Wc_c="`|wc -c < |
|000012a0| 27 52 45 41 44 4d 45 27 | 60 22 0a 74 65 73 74 20 |'README'|`".test |
|000012b0| 31 34 39 35 20 2d 65 71 | 20 22 24 57 63 5f 63 22 |1495 -eq| "$Wc_c"|
|000012c0| 20 7c 7c 0a 09 65 63 68 | 6f 20 27 52 45 41 44 4d | ||..ech|o 'READM|
|000012d0| 45 3a 20 6f 72 69 67 69 | 6e 61 6c 20 73 69 7a 65 |E: origi|nal size|
|000012e0| 20 31 34 39 35 2c 20 63 | 75 72 72 65 6e 74 20 73 | 1495, c|urrent s|
|000012f0| 69 7a 65 27 20 22 24 57 | 63 5f 63 22 0a 66 69 0a |ize' "$W|c_c".fi.|
|00001300| 23 20 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 20 |# ======|======= |
|00001310| 6c 6f 63 6b 74 74 79 2e | 31 20 3d 3d 3d 3d 3d 3d |locktty.|1 ======|
|00001320| 3d 3d 3d 3d 3d 3d 3d 3d | 0a 69 66 20 74 65 73 74 |========|.if test|
|00001330| 20 2d 66 20 27 6c 6f 63 | 6b 74 74 79 2e 31 27 20 | -f 'loc|ktty.1' |
|00001340| 2d 61 20 58 22 24 31 22 | 20 21 3d 20 58 22 2d 63 |-a X"$1"| != X"-c|
|00001350| 22 3b 20 74 68 65 6e 0a | 09 65 63 68 6f 20 27 78 |"; then.|.echo 'x|
|00001360| 20 2d 20 73 6b 69 70 70 | 69 6e 67 20 6c 6f 63 6b | - skipp|ing lock|
|00001370| 74 74 79 2e 31 20 28 46 | 69 6c 65 20 61 6c 72 65 |tty.1 (F|ile alre|
|00001380| 61 64 79 20 65 78 69 73 | 74 73 29 27 0a 65 6c 73 |ady exis|ts)'.els|
|00001390| 65 0a 65 63 68 6f 20 27 | 78 20 2d 20 65 78 74 72 |e.echo '|x - extr|
|000013a0| 61 63 74 69 6e 67 20 6c | 6f 63 6b 74 74 79 2e 31 |acting l|ocktty.1|
|000013b0| 20 28 54 65 78 74 29 27 | 0a 73 65 64 20 27 73 2f | (Text)'|.sed 's/|
|000013c0| 5e 58 2f 2f 27 20 3c 3c | 20 27 53 48 41 52 5f 45 |^X//' <<| 'SHAR_E|
|000013d0| 4f 46 27 20 3e 20 27 6c | 6f 63 6b 74 74 79 2e 31 |OF' > 'l|ocktty.1|
|000013e0| 27 20 26 26 0a 2e 54 48 | 20 4c 4f 43 4b 54 54 59 |' &&..TH| LOCKTTY|
|000013f0| 20 31 4c 20 22 4c 4f 43 | 4b 54 54 59 20 31 2e 31 | 1L "LOC|KTTY 1.1|
|00001400| 22 20 22 22 0a 2e 53 48 | 20 4e 41 4d 45 0a 6c 6f |" ""..SH| NAME.lo|
|00001410| 63 6b 74 74 79 20 2d 20 | 6c 6f 63 6b 20 74 65 72 |cktty - |lock ter|
|00001420| 6d 69 6e 61 6c 0a 2e 53 | 48 20 53 59 4e 4f 50 53 |minal..S|H SYNOPS|
|00001430| 49 53 0a 2e 42 20 6c 6f | 63 6b 74 74 79 0a 5b 0a |IS..B lo|cktty.[.|
|00001440| 2e 42 20 2d 70 0a 5d 0a | 2e 50 50 0a 2e 53 48 20 |.B -p.].|.PP..SH |
|00001450| 44 45 53 43 52 49 50 54 | 49 4f 4e 0a 2e 49 20 4c |DESCRIPT|ION..I L|
|00001460| 6f 63 6b 74 74 79 5c 5e | 0a 70 75 74 73 20 74 68 |ocktty\^|.puts th|
|00001470| 65 20 74 65 72 6d 69 6e | 61 6c 20 69 6e 74 6f 20 |e termin|al into |
|00001480| 72 61 77 20 6d 6f 64 65 | 2c 20 63 6c 65 61 72 73 |raw mode|, clears|
|00001490| 20 74 68 65 20 73 63 72 | 65 65 6e 2c 20 61 6e 64 | the scr|een, and|
|000014a0| 0a 70 72 6f 6d 70 74 73 | 20 74 68 65 20 75 73 65 |.prompts| the use|
|000014b0| 72 20 66 6f 72 20 61 20 | 70 61 73 73 77 6f 72 64 |r for a |password|
|000014c0| 2e 20 45 6e 74 65 72 65 | 64 20 70 61 73 73 77 6f |. Entere|d passwo|
|000014d0| 72 64 73 20 61 72 65 20 | 63 72 79 70 74 65 64 20 |rds are |crypted |
|000014e0| 61 6e 64 0a 63 68 65 63 | 6b 65 64 20 61 67 61 69 |and.chec|ked agai|
|000014f0| 6e 73 74 20 61 20 63 72 | 79 70 74 65 64 20 70 61 |nst a cr|ypted pa|
|00001500| 73 73 77 6f 72 64 20 69 | 6e 20 61 20 66 69 6c 65 |ssword i|n a file|
|00001510| 20 69 6e 20 74 68 65 20 | 75 73 65 72 73 27 20 68 | in the |users' h|
|00001520| 6f 6d 65 0a 64 69 72 65 | 63 74 6f 72 79 20 28 7e |ome.dire|ctory (~|
|00001530| 2f 2e 6c 6f 63 6b 70 61 | 73 73 77 64 29 2e 20 49 |/.lockpa|sswd). I|
|00001540| 66 20 74 68 65 20 63 6f | 72 72 65 63 74 20 70 61 |f the co|rrect pa|
|00001550| 73 73 77 6f 72 64 20 69 | 73 20 67 69 76 65 6e 2c |ssword i|s given,|
|00001560| 20 74 68 65 0a 74 65 72 | 6d 69 6e 61 6c 20 69 73 | the.ter|minal is|
|00001570| 20 73 65 74 20 69 6e 74 | 6f 20 6e 6f 72 6d 61 6c | set int|o normal|
|00001580| 20 73 74 61 74 65 20 61 | 67 61 69 6e 2e 20 49 66 | state a|gain. If|
|00001590| 20 6e 6f 74 2c 20 61 20 | 6d 65 73 73 61 67 65 20 | not, a |message |
|000015a0| 69 73 20 67 69 76 65 6e | 2c 0a 61 6e 64 20 61 66 |is given|,.and af|
|000015b0| 74 65 72 20 73 6f 6d 65 | 20 74 69 6d 65 20 61 20 |ter some| time a |
|000015c0| 6e 65 77 20 70 61 73 73 | 77 6f 72 64 20 69 73 20 |new pass|word is |
|000015d0| 72 65 61 64 2e 0a 2e 50 | 50 0a 49 66 20 74 68 65 |read...P|P.If the|
|000015e0| 20 66 69 6c 65 20 7e 2f | 2e 6c 6f 63 6b 70 61 73 | file ~/|.lockpas|
|000015f0| 73 77 64 20 64 6f 65 73 | 20 6e 6f 74 20 65 78 69 |swd does| not exi|
|00001600| 73 74 2c 20 74 68 65 20 | 75 73 65 72 20 69 73 20 |st, the |user is |
|00001610| 70 72 6f 6d 70 74 65 64 | 20 66 6f 72 0a 61 20 70 |prompted| for.a p|
|00001620| 61 73 73 77 6f 72 64 20 | 74 77 69 63 65 20 62 65 |assword |twice be|
|00001630| 66 6f 72 65 20 74 68 65 | 20 73 63 72 65 65 6e 20 |fore the| screen |
|00001640| 69 73 20 6c 6f 63 6b 65 | 64 2e 20 54 68 69 73 20 |is locke|d. This |
|00001650| 70 61 73 73 77 6f 72 64 | 20 69 73 0a 63 72 79 70 |password| is.cryp|
|00001660| 74 65 64 20 61 6e 64 20 | 73 74 6f 72 65 64 20 69 |ted and |stored i|
|00001670| 6e 20 7e 2f 2e 6c 6f 63 | 6b 70 61 73 73 77 64 2e |n ~/.loc|kpasswd.|
|00001680| 0a 2e 50 50 0a 54 68 65 | 20 65 6e 63 72 79 70 74 |..PP.The| encrypt|
|00001690| 65 64 20 70 61 73 73 77 | 6f 72 64 20 69 6e 20 7e |ed passw|ord in ~|
|000016a0| 2f 2e 6c 6f 63 6b 70 61 | 73 73 77 64 20 63 61 6e |/.lockpa|sswd can|
|000016b0| 20 62 65 20 63 68 61 6e | 67 65 64 20 62 79 20 69 | be chan|ged by i|
|000016c0| 6e 76 6f 6b 69 6e 67 0a | 2e 49 20 6c 6f 63 6b 74 |nvoking.|.I lockt|
|000016d0| 74 79 20 0a 77 69 74 68 | 20 74 68 65 20 0a 2e 42 |ty .with| the ..B|
|000016e0| 20 2d 70 20 0a 6f 70 74 | 69 6f 6e 2e 0a 2e 53 48 | -p .opt|ion...SH|
|000016f0| 20 4f 50 54 49 4f 4e 53 | 0a 2e 54 50 0a 2e 42 20 | OPTIONS|..TP..B |
|00001700| 2d 70 0a 61 73 6b 20 66 | 6f 72 20 6e 65 77 20 70 |-p.ask f|or new p|
|00001710| 61 73 73 77 6f 72 64 20 | 69 6e 20 7e 2f 2e 6c 6f |assword |in ~/.lo|
|00001720| 63 6b 70 61 73 73 77 64 | 0a 2e 53 48 20 44 49 41 |ckpasswd|..SH DIA|
|00001730| 47 4e 4f 53 54 49 43 53 | 0a 2e 54 50 0a 7e 2f 2e |GNOSTICS|..TP.~/.|
|00001740| 6c 6f 63 6b 70 61 73 73 | 77 64 20 69 6e 20 77 72 |lockpass|wd in wr|
|00001750| 6f 6e 67 20 66 6f 72 6d | 61 74 0a 7e 2f 2e 6c 6f |ong form|at.~/.lo|
|00001760| 63 6b 70 61 73 73 77 64 | 20 64 6f 65 73 20 6e 6f |ckpasswd| does no|
|00001770| 74 20 61 70 70 65 61 72 | 20 74 6f 20 62 65 20 61 |t appear| to be a|
|00001780| 20 76 61 6c 69 64 20 70 | 61 73 73 77 6f 72 64 20 | valid p|assword |
|00001790| 63 72 79 70 74 2e 0a 2e | 53 48 20 46 49 4c 45 53 |crypt...|SH FILES|
|000017a0| 0a 24 48 4f 4d 45 2f 2e | 6c 6f 63 6b 70 61 73 73 |.$HOME/.|lockpass|
|000017b0| 77 64 20 20 20 20 20 20 | 20 20 20 20 20 20 20 65 |wd | e|
|000017c0| 6e 63 72 79 70 74 65 64 | 20 70 61 73 73 77 6f 72 |ncrypted| passwor|
|000017d0| 64 0a 2e 53 48 20 42 55 | 47 53 0a 49 20 68 61 76 |d..SH BU|GS.I hav|
|000017e0| 65 6e 27 74 20 66 6f 75 | 6e 64 20 61 20 70 6f 72 |en't fou|nd a por|
|000017f0| 74 61 62 6c 65 20 77 61 | 79 20 74 6f 20 66 6c 75 |table wa|y to flu|
|00001800| 73 68 20 69 6e 70 75 74 | 20 62 65 66 6f 72 65 20 |sh input| before |
|00001810| 72 65 61 64 69 6e 67 20 | 61 20 6e 65 77 0a 70 61 |reading |a new.pa|
|00001820| 73 73 77 6f 72 64 2e 0a | 2e 62 72 0a 54 68 65 20 |ssword..|.br.The |
|00001830| 65 78 65 63 75 74 61 62 | 6c 65 20 69 73 20 68 75 |executab|le is hu|
|00001840| 67 65 20 63 6f 6d 70 61 | 72 65 64 20 74 6f 20 74 |ge compa|red to t|
|00001850| 68 65 20 73 6f 75 72 63 | 65 2e 0a 2e 62 72 0a 2e |he sourc|e...br..|
|00001860| 49 20 4c 6f 63 6b 74 74 | 79 0a 70 72 65 74 65 6e |I Locktt|y.preten|
|00001870| 64 73 20 74 6f 20 63 68 | 65 63 6b 20 74 68 65 20 |ds to ch|eck the |
|00001880| 76 61 6c 69 64 69 74 79 | 20 6f 66 20 7e 2f 2e 6c |validity| of ~/.l|
|00001890| 6f 63 6b 70 61 73 73 77 | 64 2c 20 62 75 74 20 63 |ockpassw|d, but c|
|000018a0| 68 65 63 6b 73 20 6f 6e | 6c 79 20 74 68 65 0a 6c |hecks on|ly the.l|
|000018b0| 65 6e 67 74 68 20 61 6e | 64 20 74 68 65 20 63 68 |ength an|d the ch|
|000018c0| 61 72 61 63 74 65 72 20 | 73 65 74 2e 0a 2e 62 72 |aracter |set...br|
|000018d0| 0a 4f 6e 6c 79 20 74 68 | 65 20 66 69 72 73 74 20 |.Only th|e first |
|000018e0| 38 20 63 68 61 72 61 63 | 74 65 72 73 20 6f 66 20 |8 charac|ters of |
|000018f0| 74 68 65 20 70 61 73 73 | 77 6f 72 64 20 61 72 65 |the pass|word are|
|00001900| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 2e 0a 2e 53 | signifi|cant...S|
|00001910| 48 20 41 55 54 48 4f 52 | 0a 4a 75 65 72 67 65 6e |H AUTHOR|.Juergen|
|00001920| 20 4e 69 63 6b 65 6c 73 | 65 6e 2c 20 54 65 63 68 | Nickels|en, Tech|
|00001930| 6e 69 73 63 68 65 20 55 | 6e 69 76 65 72 73 69 74 |nische U|niversit|
|00001940| 61 65 74 20 42 65 72 6c | 69 6e 2c 20 47 65 72 6d |aet Berl|in, Germ|
|00001950| 61 6e 79 0a 2e 62 72 0a | 6e 69 63 6b 65 6c 40 63 |any..br.|nickel@c|
|00001960| 73 2e 74 75 2d 62 65 72 | 6c 69 6e 2e 64 65 0a 2e |s.tu-ber|lin.de..|
|00001970| 53 48 20 43 4f 50 59 52 | 49 47 48 54 53 0a 4e 6f |SH COPYR|IGHTS.No|
|00001980| 6e 65 2e 0a 53 48 41 52 | 5f 45 4f 46 0a 63 68 6d |ne..SHAR|_EOF.chm|
|00001990| 6f 64 20 30 36 34 34 20 | 6c 6f 63 6b 74 74 79 2e |od 0644 |locktty.|
|000019a0| 31 20 7c 7c 0a 65 63 68 | 6f 20 27 72 65 73 74 6f |1 ||.ech|o 'resto|
|000019b0| 72 65 20 6f 66 20 6c 6f | 63 6b 74 74 79 2e 31 20 |re of lo|cktty.1 |
|000019c0| 66 61 69 6c 65 64 27 0a | 57 63 5f 63 3d 22 60 77 |failed'.|Wc_c="`w|
|000019d0| 63 20 2d 63 20 3c 20 27 | 6c 6f 63 6b 74 74 79 2e |c -c < '|locktty.|
|000019e0| 31 27 60 22 0a 74 65 73 | 74 20 31 34 33 39 20 2d |1'`".tes|t 1439 -|
|000019f0| 65 71 20 22 24 57 63 5f | 63 22 20 7c 7c 0a 09 65 |eq "$Wc_|c" ||..e|
|00001a00| 63 68 6f 20 27 6c 6f 63 | 6b 74 74 79 2e 31 3a 20 |cho 'loc|ktty.1: |
|00001a10| 6f 72 69 67 69 6e 61 6c | 20 73 69 7a 65 20 31 34 |original| size 14|
|00001a20| 33 39 2c 20 63 75 72 72 | 65 6e 74 20 73 69 7a 65 |39, curr|ent size|
|00001a30| 27 20 22 24 57 63 5f 63 | 22 0a 66 69 0a 23 20 3d |' "$Wc_c|".fi.# =|
|00001a40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 20 6c 6f 63 |========|==== loc|
|00001a50| 6b 74 74 79 2e 63 20 3d | 3d 3d 3d 3d 3d 3d 3d 3d |ktty.c =|========|
|00001a60| 3d 3d 3d 3d 3d 0a 69 66 | 20 74 65 73 74 20 2d 66 |=====.if| test -f|
|00001a70| 20 27 6c 6f 63 6b 74 74 | 79 2e 63 27 20 2d 61 20 | 'locktt|y.c' -a |
|00001a80| 58 22 24 31 22 20 21 3d | 20 58 22 2d 63 22 3b 20 |X"$1" !=| X"-c"; |
|00001a90| 74 68 65 6e 0a 09 65 63 | 68 6f 20 27 78 20 2d 20 |then..ec|ho 'x - |
|00001aa0| 73 6b 69 70 70 69 6e 67 | 20 6c 6f 63 6b 74 74 79 |skipping| locktty|
|00001ab0| 2e 63 20 28 46 69 6c 65 | 20 61 6c 72 65 61 64 79 |.c (File| already|
|00001ac0| 20 65 78 69 73 74 73 29 | 27 0a 65 6c 73 65 0a 65 | exists)|'.else.e|
|00001ad0| 63 68 6f 20 27 78 20 2d | 20 65 78 74 72 61 63 74 |cho 'x -| extract|
|00001ae0| 69 6e 67 20 6c 6f 63 6b | 74 74 79 2e 63 20 28 54 |ing lock|tty.c (T|
|00001af0| 65 78 74 29 27 0a 73 65 | 64 20 27 73 2f 5e 58 2f |ext)'.se|d 's/^X/|
|00001b00| 2f 27 20 3c 3c 20 27 53 | 48 41 52 5f 45 4f 46 27 |/' << 'S|HAR_EOF'|
|00001b10| 20 3e 20 27 6c 6f 63 6b | 74 74 79 2e 63 27 20 26 | > 'lock|tty.c' &|
|00001b20| 26 0a 2f 2a 20 6c 6f 63 | 6b 74 74 79 20 2d 20 6c |&./* loc|ktty - l|
|00001b30| 6f 63 6b 20 74 65 72 6d | 69 6e 61 6c 20 0a 58 20 |ock term|inal .X |
|00001b40| 2a 20 76 65 72 73 69 6f | 6e 20 31 2e 31 0a 58 20 |* versio|n 1.1.X |
|00001b50| 2a 0a 58 20 2a 20 63 6f | 6d 70 69 6c 65 20 77 69 |*.X * co|mpile wi|
|00001b60| 74 68 20 63 63 20 2d 6f | 20 6c 6f 63 6b 74 74 79 |th cc -o| locktty|
|00001b70| 20 6c 6f 63 6b 74 74 79 | 2e 63 20 2d 6c 63 75 72 | locktty|.c -lcur|
|00001b80| 73 65 73 20 2d 6c 74 65 | 72 6d 63 61 70 0a 58 20 |ses -lte|rmcap.X |
|00001b90| 2a 20 55 73 61 67 65 3a | 20 6c 6f 63 6b 74 74 79 |* Usage:| locktty|
|00001ba0| 20 5b 20 2d 70 20 5d 0a | 58 20 2a 0a 58 20 2a 20 | [ -p ].|X *.X * |
|00001bb0| 6c 6f 63 6b 74 74 79 20 | 70 75 74 73 20 74 68 65 |locktty |puts the|
|00001bc0| 20 74 65 72 6d 69 6e 61 | 6c 20 69 6e 74 6f 20 72 | termina|l into r|
|00001bd0| 61 77 20 6d 6f 64 65 2c | 20 63 6c 65 61 72 73 20 |aw mode,| clears |
|00001be0| 74 68 65 20 73 63 72 65 | 65 6e 2c 20 61 6e 64 0a |the scre|en, and.|
|00001bf0| 58 20 2a 20 70 72 6f 6d | 70 74 73 20 74 68 65 20 |X * prom|pts the |
|00001c00| 75 73 65 72 20 66 6f 72 | 20 61 20 70 61 73 73 77 |user for| a passw|
|00001c10| 6f 72 64 2e 20 45 6e 74 | 65 72 65 64 20 70 61 73 |ord. Ent|ered pas|
|00001c20| 73 77 6f 72 64 73 20 61 | 72 65 20 63 72 79 70 74 |swords a|re crypt|
|00001c30| 65 64 20 61 6e 64 0a 58 | 20 2a 20 63 68 65 63 6b |ed and.X| * check|
|00001c40| 65 64 20 61 67 61 69 6e | 73 74 20 61 20 63 72 79 |ed again|st a cry|
|00001c50| 70 74 65 64 20 70 61 73 | 73 77 6f 72 64 20 69 6e |pted pas|sword in|
|00001c60| 20 61 20 66 69 6c 65 20 | 69 6e 20 74 68 65 20 75 | a file |in the u|
|00001c70| 73 65 72 73 27 20 68 6f | 6d 65 0a 58 20 2a 20 64 |sers' ho|me.X * d|
|00001c80| 69 72 65 63 74 6f 72 79 | 20 28 7e 2f 2e 6c 6f 63 |irectory| (~/.loc|
|00001c90| 6b 70 61 73 73 77 64 29 | 2e 20 49 66 20 74 68 65 |kpasswd)|. If the|
|00001ca0| 20 63 6f 72 72 65 63 74 | 20 70 61 73 73 77 6f 72 | correct| passwor|
|00001cb0| 64 20 69 73 20 67 69 76 | 65 6e 2c 20 74 68 65 0a |d is giv|en, the.|
|00001cc0| 58 20 2a 20 74 65 72 6d | 69 6e 61 6c 20 69 73 20 |X * term|inal is |
|00001cd0| 73 65 74 20 69 6e 74 6f | 20 6e 6f 72 6d 61 6c 20 |set into| normal |
|00001ce0| 73 74 61 74 65 20 61 67 | 61 69 6e 2e 20 49 66 20 |state ag|ain. If |
|00001cf0| 6e 6f 74 2c 20 61 20 6d | 65 73 73 67 61 65 20 69 |not, a m|essgae i|
|00001d00| 73 0a 58 20 2a 20 67 69 | 76 65 6e 2c 20 61 6e 64 |s.X * gi|ven, and|
|00001d10| 20 61 66 74 65 72 20 73 | 6f 6d 65 20 74 69 6d 65 | after s|ome time|
|00001d20| 20 61 20 6e 65 77 20 70 | 61 73 73 77 6f 72 64 20 | a new p|assword |
|00001d30| 69 73 20 72 65 61 64 2e | 0a 58 20 2a 20 49 66 20 |is read.|.X * If |
|00001d40| 74 68 65 20 66 69 6c 65 | 20 7e 2f 2e 6c 6f 63 6b |the file| ~/.lock|
|00001d50| 70 61 73 73 77 64 20 64 | 6f 65 73 20 6e 6f 74 20 |passwd d|oes not |
|00001d60| 65 78 69 73 74 2c 20 74 | 68 65 20 75 73 65 72 20 |exist, t|he user |
|00001d70| 69 73 20 70 72 6f 6d 70 | 74 65 64 20 66 6f 72 0a |is promp|ted for.|
|00001d80| 58 20 2a 20 61 20 70 61 | 73 73 77 6f 72 64 20 74 |X * a pa|ssword t|
|00001d90| 77 69 63 65 20 62 65 66 | 6f 72 65 20 74 68 65 20 |wice bef|ore the |
|00001da0| 73 63 72 65 65 6e 20 69 | 73 20 6c 6f 63 6b 65 64 |screen i|s locked|
|00001db0| 2e 20 54 68 69 73 20 70 | 61 73 73 77 6f 72 64 20 |. This p|assword |
|00001dc0| 69 73 0a 58 20 2a 20 63 | 72 79 70 74 65 64 20 61 |is.X * c|rypted a|
|00001dd0| 6e 64 20 73 74 6f 72 65 | 64 20 69 6e 20 7e 2f 2e |nd store|d in ~/.|
|00001de0| 6c 6f 63 6b 70 61 73 73 | 77 64 2e 0a 58 20 2a 20 |lockpass|wd..X * |
|00001df0| 54 68 65 20 65 6e 63 72 | 79 70 74 65 64 20 70 61 |The encr|ypted pa|
|00001e00| 73 73 77 6f 72 64 20 69 | 6e 20 7e 2f 2e 6c 6f 63 |ssword i|n ~/.loc|
|00001e10| 6b 70 61 73 73 77 64 20 | 63 61 6e 20 62 65 20 63 |kpasswd |can be c|
|00001e20| 68 61 6e 67 65 64 20 62 | 79 20 69 6e 76 6f 6b 69 |hanged b|y invoki|
|00001e30| 6e 67 0a 58 20 2a 20 6c | 6f 63 6b 74 74 79 20 77 |ng.X * l|ocktty w|
|00001e40| 69 74 68 20 74 68 65 20 | 2d 70 20 6f 70 74 69 6f |ith the |-p optio|
|00001e50| 6e 2e 0a 58 20 2a 0a 58 | 20 2a 20 50 6c 65 61 73 |n..X *.X| * Pleas|
|00001e60| 65 20 73 65 6e 64 20 63 | 6f 72 72 65 63 74 69 6f |e send c|orrectio|
|00001e70| 6e 73 2c 20 69 6d 70 72 | 6f 76 65 6d 65 6e 74 73 |ns, impr|ovements|
|00001e80| 2c 20 61 6e 64 20 66 6c | 61 6d 65 73 20 74 6f 0a |, and fl|ames to.|
|00001e90| 58 20 2a 09 6e 69 63 6b | 65 6c 40 63 73 2e 74 75 |X *.nick|el@cs.tu|
|00001ea0| 2d 62 65 72 6c 69 6e 2e | 64 65 20 28 4a 75 65 72 |-berlin.|de (Juer|
|00001eb0| 67 65 6e 20 4e 69 63 6b | 65 6c 73 65 6e 29 0a 58 |gen Nick|elsen).X|
|00001ec0| 20 2a 2f 0a 58 0a 23 69 | 6e 63 6c 75 64 65 20 3c | */.X.#i|nclude <|
|00001ed0| 63 75 72 73 65 73 2e 68 | 3e 0a 23 69 6e 63 6c 75 |curses.h|>.#inclu|
|00001ee0| 64 65 20 3c 73 69 67 6e | 61 6c 2e 68 3e 0a 23 69 |de <sign|al.h>.#i|
|00001ef0| 6e 63 6c 75 64 65 20 3c | 73 74 64 69 6f 2e 68 3e |nclude <|stdio.h>|
|00001f00| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 65 72 72 6e 6f |.#includ|e <errno|
|00001f10| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 66 63 |.h>.#inc|lude <fc|
|00001f20| 6e 74 6c 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ntl.h>.#|include |
|00001f30| 3c 73 74 72 69 6e 67 2e | 68 3e 0a 23 69 6e 63 6c |<string.|h>.#incl|
|00001f40| 75 64 65 20 3c 70 77 64 | 2e 68 3e 0a 58 0a 23 64 |ude <pwd|.h>.X.#d|
|00001f50| 65 66 69 6e 65 20 74 72 | 75 65 09 31 0a 23 64 65 |efine tr|ue.1.#de|
|00001f60| 66 69 6e 65 20 66 61 6c | 73 65 09 30 0a 58 0a 23 |fine fal|se.0.X.#|
|00001f70| 64 65 66 69 6e 65 20 53 | 49 5a 45 09 31 30 32 34 |define S|IZE.1024|
|00001f80| 09 09 2f 2a 20 6d 61 78 | 69 6d 75 6d 20 73 69 7a |../* max|imum siz|
|00001f90| 65 20 66 6f 72 20 70 61 | 73 73 77 6f 72 64 20 2a |e for pa|ssword *|
|00001fa0| 2f 0a 23 64 65 66 69 6e | 65 20 50 46 49 4c 45 09 |/.#defin|e PFILE.|
|00001fb0| 22 2e 6c 6f 63 6b 70 61 | 73 73 77 64 22 09 2f 2a |".lockpa|sswd"./*|
|00001fc0| 20 6e 61 6d 65 20 6f 66 | 20 70 61 73 73 77 6f 72 | name of| passwor|
|00001fd0| 64 20 66 69 6c 65 20 2a | 2f 0a 23 64 65 66 69 6e |d file *|/.#defin|
|00001fe0| 65 20 4d 41 58 50 41 54 | 48 4c 45 4e 09 34 30 39 |e MAXPAT|HLEN.409|
|00001ff0| 36 09 2f 2a 20 74 68 69 | 73 20 73 68 6f 75 6c 64 |6./* thi|s should|
|00002000| 20 65 78 63 65 65 64 20 | 74 68 65 20 72 65 61 6c | exceed |the real|
|00002010| 20 76 61 6c 75 65 0a 58 | 09 09 09 09 20 2a 20 6f | value.X|.... * o|
|00002020| 6e 20 6e 65 61 72 6c 79 | 20 61 6c 6c 20 6d 61 63 |n nearly| all mac|
|00002030| 68 69 6e 65 73 20 2a 2f | 0a 23 64 65 66 69 6e 65 |hines */|.#define|
|00002040| 20 43 4c 45 4e 09 31 34 | 09 09 2f 2a 20 65 6e 6f | CLEN.14|../* eno|
|00002050| 75 67 68 20 66 6f 72 20 | 74 68 65 20 63 72 79 70 |ugh for |the cryp|
|00002060| 74 65 64 20 70 77 64 27 | 73 20 2a 2f 0a 23 64 65 |ted pwd'|s */.#de|
|00002070| 66 69 6e 65 20 53 41 4c | 54 43 09 5c 0a 58 09 22 |fine SAL|TC.\.X."|
|00002080| 61 62 63 64 65 66 67 68 | 69 6a 6b 6c 6d 6e 6f 70 |abcdefgh|ijklmnop|
|00002090| 71 72 73 74 75 76 77 78 | 79 7a 41 42 43 44 45 46 |qrstuvwx|yzABCDEF|
|000020a0| 47 48 49 4a 4b 4c 4d 4e | 4f 50 51 52 53 54 55 56 |GHIJKLMN|OPQRSTUV|
|000020b0| 57 58 59 5a 30 31 32 33 | 34 35 36 37 38 39 2e 2f |WXYZ0123|456789./|
|000020c0| 22 0a 58 09 09 09 09 2f | 2a 20 63 68 61 72 61 63 |".X..../|* charac|
|000020d0| 74 65 72 73 20 74 68 61 | 74 20 6d 61 79 20 61 70 |ters tha|t may ap|
|000020e0| 70 65 61 72 20 69 6e 20 | 74 68 65 20 73 61 6c 74 |pear in |the salt|
|000020f0| 20 2a 2f 0a 58 0a 69 6e | 74 20 0a 58 20 20 20 20 | */.X.in|t .X |
|00002100| 75 69 64 2c 09 09 09 2f | 2a 20 75 73 65 72 69 64 |uid,.../|* userid|
|00002110| 20 2a 2f 0a 58 20 20 20 | 20 66 61 69 6c 5f 63 6f | */.X | fail_co|
|00002120| 75 6e 74 20 3d 20 2d 31 | 3b 09 09 2f 2a 20 6e 75 |unt = -1|;../* nu|
|00002130| 6d 62 65 72 20 6f 66 20 | 66 61 69 6c 65 64 20 75 |mber of |failed u|
|00002140| 6e 6c 6f 63 6b 20 61 74 | 74 65 6d 70 74 73 20 2a |nlock at|tempts *|
|00002150| 2f 0a 58 0a 73 74 72 75 | 63 74 20 70 61 73 73 77 |/.X.stru|ct passw|
|00002160| 64 20 0a 58 20 20 20 20 | 2a 70 77 5f 65 6e 74 72 |d .X |*pw_entr|
|00002170| 79 3b 09 09 09 2f 2a 20 | 70 61 73 73 77 64 20 66 |y;.../* |passwd f|
|00002180| 69 6c 65 20 65 6e 74 72 | 79 20 2a 2f 0a 58 0a 63 |ile entr|y */.X.c|
|00002190| 68 61 72 0a 58 20 20 20 | 20 2a 70 72 6f 67 6e 61 |har.X | *progna|
|000021a0| 6d 65 2c 09 09 09 2f 2a | 20 74 68 65 20 6e 61 6d |me,.../*| the nam|
|000021b0| 65 20 6f 66 20 74 68 65 | 20 67 61 6d 65 20 2a 2f |e of the| game */|
|000021c0| 0a 58 20 20 20 20 6e 65 | 77 63 5b 43 4c 45 4e 20 |.X ne|wc[CLEN |
|000021d0| 2b 20 31 5d 2c 09 09 2f | 2a 20 65 6e 74 65 72 65 |+ 1],../|* entere|
|000021e0| 64 20 70 77 64 20 28 63 | 72 79 70 74 65 64 29 20 |d pwd (c|rypted) |
|000021f0| 2a 2f 0a 58 20 20 20 20 | 6f 6c 64 63 5b 43 4c 45 |*/.X |oldc[CLE|
|00002200| 4e 20 2b 20 31 5d 2c 09 | 09 2f 2a 20 6f 6c 64 20 |N + 1],.|./* old |
|00002210| 70 77 64 20 28 63 72 79 | 70 74 65 64 29 20 2a 2f |pwd (cry|pted) */|
|00002220| 0a 58 20 20 20 20 70 66 | 69 6c 6e 61 6d 5b 4d 41 |.X pf|ilnam[MA|
|00002230| 58 50 41 54 48 4c 45 4e | 5d 2c 09 2f 2a 20 6e 61 |XPATHLEN|],./* na|
|00002240| 6d 65 20 6f 66 20 70 61 | 73 73 77 6f 72 64 20 66 |me of pa|ssword f|
|00002250| 69 6c 65 20 2a 2f 0a 58 | 20 20 20 20 68 6f 73 74 |ile */.X| host|
|00002260| 6e 61 6d 65 5b 32 30 5d | 2c 09 09 2f 2a 20 68 6f |name[20]|,../* ho|
|00002270| 73 74 6e 61 6d 65 20 2a | 2f 0a 58 20 20 20 20 70 |stname *|/.X p|
|00002280| 72 6f 6d 70 74 5b 34 30 | 5d 20 3b 09 09 2f 2a 20 |rompt[40|] ;../* |
|00002290| 75 6e 6c 6f 63 6b 20 70 | 72 6f 6d 70 74 20 2a 2f |unlock p|rompt */|
|000022a0| 0a 58 0a 65 78 74 65 72 | 6e 20 69 6e 74 20 65 72 |.X.exter|n int er|
|000022b0| 72 6e 6f 20 3b 0a 65 78 | 74 65 72 6e 20 63 68 61 |rno ;.ex|tern cha|
|000022c0| 72 20 2a 67 65 74 65 6e | 76 28 29 2c 20 2a 63 72 |r *geten|v(), *cr|
|000022d0| 79 70 74 28 29 20 3b 0a | 58 0a 58 0a 6d 61 69 6e |ypt() ;.|X.X.main|
|000022e0| 28 61 72 67 63 2c 20 61 | 72 67 76 29 0a 69 6e 74 |(argc, a|rgv).int|
|000022f0| 20 61 72 67 63 20 3b 0a | 63 68 61 72 20 2a 2a 61 | argc ;.|char **a|
|00002300| 72 67 76 20 3b 0a 7b 0a | 58 20 20 20 20 63 68 61 |rgv ;.{.|X cha|
|00002310| 72 20 0a 58 09 74 6d 70 | 6c 5b 53 49 5a 45 2b 31 |r .X.tmp|l[SIZE+1|
|00002320| 5d 2c 09 09 2f 2a 20 73 | 70 61 63 65 20 66 6f 72 |],../* s|pace for|
|00002330| 20 72 65 61 64 69 6e 67 | 20 66 72 6f 6d 20 74 65 | reading| from te|
|00002340| 72 6d 69 6e 61 6c 20 2a | 2f 0a 58 09 2a 73 6c 70 |rminal *|/.X.*slp|
|00002350| 20 3b 09 09 09 2f 2a 20 | 70 6f 69 6e 74 65 72 20 | ;.../* |pointer |
|00002360| 74 6f 20 73 6c 61 73 68 | 20 69 6e 20 70 72 6f 67 |to slash| in prog|
|00002370| 6e 61 6d 65 20 2a 2f 0a | 58 20 20 20 20 69 6e 74 |name */.|X int|
|00002380| 20 70 77 64 66 69 6c 65 | 20 3b 09 09 2f 2a 20 72 | pwdfile| ;../* r|
|00002390| 65 61 64 20 68 61 6e 64 | 6c 65 20 66 6f 72 20 70 |ead hand|le for p|
|000023a0| 61 73 73 77 6f 72 64 20 | 66 69 6c 65 20 2a 2f 0a |assword |file */.|
|000023b0| 58 0a 58 20 20 20 20 2f | 2a 20 64 65 74 65 72 6d |X.X /|* determ|
|000023c0| 69 6e 65 20 6e 61 6d 65 | 20 6f 66 20 70 72 6f 67 |ine name| of prog|
|000023d0| 72 61 6d 20 2a 2f 0a 58 | 20 20 20 20 70 72 6f 67 |ram */.X| prog|
|000023e0| 6e 61 6d 65 20 3d 20 2a | 61 72 67 76 20 3b 0a 58 |name = *|argv ;.X|
|000023f0| 20 20 20 20 69 66 20 28 | 73 6c 70 20 3d 20 73 74 | if (|slp = st|
|00002400| 72 72 63 68 72 28 70 72 | 6f 67 6e 61 6d 65 2c 20 |rrchr(pr|ogname, |
|00002410| 27 2f 27 29 29 20 7b 0a | 58 09 70 72 6f 67 6e 61 |'/')) {.|X.progna|
|00002420| 6d 65 20 3d 20 73 6c 70 | 20 2b 20 31 20 3b 0a 58 |me = slp| + 1 ;.X|
|00002430| 20 20 20 20 7d 0a 58 0a | 58 20 20 20 20 2f 2a 20 | }.X.|X /* |
|00002440| 67 65 74 20 68 6f 73 74 | 20 61 6e 64 20 75 73 65 |get host| and use|
|00002450| 72 20 6e 61 6d 65 73 20 | 2a 2f 0a 58 0a 58 20 20 |r names |*/.X.X |
|00002460| 20 20 69 66 20 28 67 65 | 74 68 6f 73 74 6e 61 6d | if (ge|thostnam|
|00002470| 65 28 68 6f 73 74 6e 61 | 6d 65 2c 20 31 39 29 20 |e(hostna|me, 19) |
|00002480| 3d 3d 20 2d 31 29 20 7b | 0a 58 09 68 6f 73 74 6e |== -1) {|.X.hostn|
|00002490| 61 6d 65 5b 30 5d 20 3d | 20 27 5c 30 27 20 3b 0a |ame[0] =| '\0' ;.|
|000024a0| 58 20 20 20 20 7d 0a 58 | 20 20 20 20 75 69 64 20 |X }.X| uid |
|000024b0| 3d 20 67 65 74 75 69 64 | 28 29 20 3b 0a 58 20 20 |= getuid|() ;.X |
|000024c0| 20 20 70 77 5f 65 6e 74 | 72 79 20 3d 20 67 65 74 | pw_ent|ry = get|
|000024d0| 70 77 75 69 64 28 75 69 | 64 29 20 3b 0a 58 0a 58 |pwuid(ui|d) ;.X.X|
|000024e0| 20 20 20 20 2f 2a 20 6e | 6f 74 65 20 74 68 61 74 | /* n|ote that|
|000024f0| 20 70 77 5f 65 6e 74 72 | 79 2d 3e 70 77 5f 64 69 | pw_entr|y->pw_di|
|00002500| 72 20 69 73 20 74 68 65 | 20 75 73 65 72 27 73 20 |r is the| user's |
|00002510| 68 6f 6d 65 20 64 69 72 | 20 2a 2f 0a 58 20 20 20 |home dir| */.X |
|00002520| 20 69 66 20 28 70 77 5f | 65 6e 74 72 79 20 21 3d | if (pw_|entry !=|
|00002530| 20 4e 55 4c 4c 29 20 7b | 0a 58 09 69 66 20 28 68 | NULL) {|.X.if (h|
|00002540| 6f 73 74 6e 61 6d 65 5b | 30 5d 20 21 3d 20 27 5c |ostname[|0] != '\|
|00002550| 30 27 29 20 7b 0a 58 09 | 20 20 20 20 73 70 72 69 |0') {.X.| spri|
|00002560| 6e 74 66 28 70 72 6f 6d | 70 74 2c 20 22 55 6e 6c |ntf(prom|pt, "Unl|
|00002570| 6f 63 6b 20 25 73 40 25 | 73 3a 20 22 2c 20 70 77 |ock %s@%|s: ", pw|
|00002580| 5f 65 6e 74 72 79 2d 3e | 70 77 5f 6e 61 6d 65 2c |_entry->|pw_name,|
|00002590| 20 68 6f 73 74 6e 61 6d | 65 29 20 3b 0a 58 09 7d | hostnam|e) ;.X.}|
|000025a0| 20 65 6c 73 65 20 7b 0a | 58 09 20 20 20 20 73 70 | else {.|X. sp|
|000025b0| 72 69 6e 74 66 28 70 72 | 6f 6d 70 74 2c 20 22 55 |rintf(pr|ompt, "U|
|000025c0| 6e 6c 6f 63 6b 20 75 73 | 65 72 20 25 73 3a 20 22 |nlock us|er %s: "|
|000025d0| 2c 20 70 77 5f 65 6e 74 | 72 79 2d 3e 70 77 5f 6e |, pw_ent|ry->pw_n|
|000025e0| 61 6d 65 29 20 3b 0a 58 | 09 7d 0a 58 20 20 20 20 |ame) ;.X|.}.X |
|000025f0| 7d 20 65 6c 73 65 20 69 | 66 20 28 68 6f 73 74 6e |} else i|f (hostn|
|00002600| 61 6d 65 5b 30 5d 20 21 | 3d 20 27 5c 30 27 29 20 |ame[0] !|= '\0') |
|00002610| 7b 0a 58 09 73 70 72 69 | 6e 74 66 28 70 72 6f 6d |{.X.spri|ntf(prom|
|00002620| 70 74 2c 20 22 55 6e 6c | 6f 63 6b 20 68 6f 73 74 |pt, "Unl|ock host|
|00002630| 20 25 73 20 22 2c 20 68 | 6f 73 74 6e 61 6d 65 29 | %s ", h|ostname)|
|00002640| 20 3b 0a 58 20 20 20 20 | 7d 20 65 6c 73 65 20 7b | ;.X |} else {|
|00002650| 0a 58 09 73 70 72 69 6e | 74 66 28 70 72 6f 6d 70 |.X.sprin|tf(promp|
|00002660| 74 2c 20 22 55 6e 6c 6f | 63 6b 3a 20 22 20 29 20 |t, "Unlo|ck: " ) |
|00002670| 3b 0a 58 20 20 20 20 7d | 0a 58 0a 58 20 20 20 20 |;.X }|.X.X |
|00002680| 2f 2a 20 62 75 69 6c 64 | 20 6e 61 6d 65 20 6f 66 |/* build| name of|
|00002690| 20 70 61 73 73 77 6f 72 | 64 20 66 69 6c 65 20 2a | passwor|d file *|
|000026a0| 2f 0a 58 20 20 20 20 0a | 58 20 20 20 20 73 74 72 |/.X .|X str|
|000026b0| 63 70 79 28 70 66 69 6c | 6e 61 6d 2c 20 67 65 74 |cpy(pfil|nam, get|
|000026c0| 65 6e 76 28 22 48 4f 4d | 45 22 29 29 20 3b 0a 58 |env("HOM|E")) ;.X|
|000026d0| 20 20 20 20 73 74 72 63 | 61 74 28 70 66 69 6c 6e | strc|at(pfiln|
|000026e0| 61 6d 2c 20 22 2f 22 29 | 20 3b 0a 58 20 20 20 20 |am, "/")| ;.X |
|000026f0| 73 74 72 63 61 74 28 70 | 66 69 6c 6e 61 6d 2c 20 |strcat(p|filnam, |
|00002700| 50 46 49 4c 45 29 20 3b | 0a 58 0a 58 20 20 20 20 |PFILE) ;|.X.X |
|00002710| 70 72 65 70 74 65 72 6d | 28 29 20 3b 09 09 2f 2a |prepterm|() ;../*|
|00002720| 20 70 72 65 70 61 72 65 | 20 74 65 72 6d 69 6e 61 | prepare| termina|
|00002730| 6c 20 2a 2f 0a 58 0a 58 | 20 20 20 20 69 66 20 28 |l */.X.X| if (|
|00002740| 61 72 67 63 20 3e 20 31 | 29 20 7b 09 09 2f 2a 20 |argc > 1|) {../* |
|00002750| 63 68 65 63 6b 20 61 72 | 67 75 6d 65 6e 74 73 20 |check ar|guments |
|00002760| 2a 2f 0a 58 09 69 66 20 | 28 73 74 72 63 6d 70 28 |*/.X.if |(strcmp(|
|00002770| 61 72 67 76 5b 31 5d 2c | 20 22 2d 70 22 29 20 7c |argv[1],| "-p") ||
|00002780| 7c 20 61 72 67 63 20 21 | 3d 20 32 29 20 7b 0a 58 || argc !|= 2) {.X|
|00002790| 09 20 20 20 20 72 65 73 | 65 74 28 29 20 3b 0a 58 |. res|et() ;.X|
|000027a0| 09 20 20 20 20 75 73 61 | 67 65 28 29 20 3b 0a 58 |. usa|ge() ;.X|
|000027b0| 09 20 20 20 20 65 78 69 | 74 28 31 29 20 3b 0a 58 |. exi|t(1) ;.X|
|000027c0| 09 7d 20 65 6c 73 65 20 | 7b 0a 58 09 20 20 20 20 |.} else |{.X. |
|000027d0| 6e 65 77 70 77 64 66 69 | 6c 65 28 29 20 3b 09 2f |newpwdfi|le() ;./|
|000027e0| 2a 20 2d 70 3a 20 6e 65 | 77 20 70 61 73 73 77 6f |* -p: ne|w passwo|
|000027f0| 72 64 20 2a 2f 0a 58 09 | 7d 0a 58 20 20 20 20 7d |rd */.X.|}.X }|
|00002800| 0a 58 0a 58 20 20 20 20 | 2f 2a 20 4f 70 65 6e 20 |.X.X |/* Open |
|00002810| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 2e 20 49 |password| file. I|
|00002820| 66 20 69 74 20 64 6f 65 | 73 20 6e 6f 74 20 65 78 |f it doe|s not ex|
|00002830| 69 73 74 2c 20 63 72 65 | 61 74 65 20 69 74 20 66 |ist, cre|ate it f|
|00002840| 69 72 73 74 2e 20 2a 2f | 0a 58 20 20 20 20 64 6f |irst. */|.X do|
|00002850| 20 7b 0a 58 09 69 66 20 | 28 28 70 77 64 66 69 6c | {.X.if |((pwdfil|
|00002860| 65 20 3d 20 6f 70 65 6e | 28 70 66 69 6c 6e 61 6d |e = open|(pfilnam|
|00002870| 2c 20 4f 5f 52 44 4f 4e | 4c 59 29 29 20 3d 3d 20 |, O_RDON|LY)) == |
|00002880| 2d 31 29 20 7b 0a 58 09 | 20 20 20 20 69 66 20 28 |-1) {.X.| if (|
|00002890| 65 72 72 6e 6f 20 3d 3d | 20 45 4e 4f 45 4e 54 29 |errno ==| ENOENT)|
|000028a0| 20 7b 0a 58 09 09 70 75 | 74 73 28 22 4e 6f 20 70 | {.X..pu|ts("No p|
|000028b0| 61 73 73 77 6f 72 64 20 | 66 69 6c 65 2e 5c 72 22 |assword |file.\r"|
|000028c0| 29 20 3b 0a 58 09 09 66 | 66 6c 75 73 68 28 73 74 |) ;.X..f|flush(st|
|000028d0| 64 6f 75 74 29 20 3b 0a | 58 09 09 6e 65 77 70 77 |dout) ;.|X..newpw|
|000028e0| 64 66 69 6c 65 28 29 20 | 3b 0a 58 09 20 20 20 20 |dfile() |;.X. |
|000028f0| 7d 20 65 6c 73 65 20 7b | 0a 58 09 09 70 65 72 72 |} else {|.X..perr|
|00002900| 6f 72 28 70 66 69 6c 6e | 61 6d 29 20 3b 0a 58 09 |or(pfiln|am) ;.X.|
|00002910| 09 72 65 73 65 74 28 29 | 20 3b 0a 58 09 09 65 78 |.reset()| ;.X..ex|
|00002920| 69 74 28 65 72 72 6e 6f | 29 20 3b 0a 58 09 20 20 |it(errno|) ;.X. |
|00002930| 20 20 7d 0a 58 09 7d 0a | 58 20 20 20 20 7d 20 77 | }.X.}.|X } w|
|00002940| 68 69 6c 65 20 28 70 77 | 64 66 69 6c 65 20 3d 3d |hile (pw|dfile ==|
|00002950| 20 2d 31 29 20 3b 0a 58 | 20 20 20 20 0a 58 20 20 | -1) ;.X| .X |
|00002960| 20 20 2f 2a 20 72 65 61 | 64 20 61 6e 64 20 63 68 | /* rea|d and ch|
|00002970| 65 63 6b 20 6f 6c 64 20 | 63 72 79 70 74 20 2a 2f |eck old |crypt */|
|00002980| 0a 58 20 20 20 20 69 66 | 20 28 72 65 61 64 28 70 |.X if| (read(p|
|00002990| 77 64 66 69 6c 65 2c 20 | 6f 6c 64 63 2c 20 43 4c |wdfile, |oldc, CL|
|000029a0| 45 4e 29 20 21 3d 20 43 | 4c 45 4e 20 7c 7c 20 63 |EN) != C|LEN || c|
|000029b0| 68 65 63 6b 6f 6c 64 63 | 28 29 29 20 7b 0a 58 09 |heckoldc|()) {.X.|
|000029c0| 66 70 75 74 73 28 22 7e | 2f 22 2c 20 73 74 64 6f |fputs("~|/", stdo|
|000029d0| 75 74 29 20 3b 0a 58 09 | 66 70 75 74 73 28 50 46 |ut) ;.X.|fputs(PF|
|000029e0| 49 4c 45 2c 20 73 74 64 | 6f 75 74 29 20 3b 0a 58 |ILE, std|out) ;.X|
|000029f0| 09 70 75 74 73 28 22 20 | 69 6e 20 77 72 6f 6e 67 |.puts(" |in wrong|
|00002a00| 20 66 6f 72 6d 61 74 5c | 72 22 29 20 3b 0a 58 09 | format\|r") ;.X.|
|00002a10| 66 66 6c 75 73 68 28 73 | 74 64 6f 75 74 29 20 3b |fflush(s|tdout) ;|
|00002a20| 0a 58 09 72 65 73 65 74 | 28 29 20 3b 0a 58 09 65 |.X.reset|() ;.X.e|
|00002a30| 78 69 74 28 33 29 20 3b | 0a 58 20 20 20 20 7d 0a |xit(3) ;|.X }.|
|00002a40| 58 0a 58 20 20 20 20 2f | 2a 20 63 6c 65 61 72 20 |X.X /|* clear |
|00002a50| 73 63 72 65 65 6e 20 61 | 6e 64 20 72 65 61 64 20 |screen a|nd read |
|00002a60| 70 61 73 73 77 6f 72 64 | 20 2a 2f 0a 58 20 20 20 |password| */.X |
|00002a70| 20 64 6f 20 7b 0a 58 20 | 20 20 20 20 20 20 20 66 | do {.X | f|
|00002a80| 61 69 6c 5f 63 6f 75 6e | 74 2b 2b 3b 0a 58 09 63 |ail_coun|t++;.X.c|
|00002a90| 6c 65 61 72 28 29 20 3b | 0a 58 09 72 65 66 72 65 |lear() ;|.X.refre|
|00002aa0| 73 68 28 29 20 3b 0a 58 | 09 66 70 75 74 73 28 70 |sh() ;.X|.fputs(p|
|00002ab0| 72 6f 6d 70 74 2c 20 73 | 74 64 6f 75 74 29 20 3b |rompt, s|tdout) ;|
|00002ac0| 0a 58 09 66 66 6c 75 73 | 68 28 73 74 64 6f 75 74 |.X.fflus|h(stdout|
|00002ad0| 29 20 3b 0a 58 0a 58 09 | 72 65 61 64 70 61 73 73 |) ;.X.X.|readpass|
|00002ae0| 28 74 6d 70 6c 2c 20 66 | 61 6c 73 65 29 20 3b 0a |(tmpl, f|alse) ;.|
|00002af0| 58 09 73 74 72 63 70 79 | 28 6e 65 77 63 2c 20 63 |X.strcpy|(newc, c|
|00002b00| 72 79 70 74 28 74 6d 70 | 6c 2c 20 6f 6c 64 63 29 |rypt(tmp|l, oldc)|
|00002b10| 29 20 3b 0a 58 20 20 20 | 20 7d 20 77 68 69 6c 65 |) ;.X | } while|
|00002b20| 20 28 73 74 72 63 6d 70 | 28 6e 65 77 63 2c 20 6f | (strcmp|(newc, o|
|00002b30| 6c 64 63 29 20 26 26 20 | 0a 58 09 20 20 20 20 20 |ldc) && |.X. |
|00002b40| 28 70 75 74 73 28 22 5c | 72 5c 6e 4e 6f 20 77 61 |(puts("\|r\nNo wa|
|00002b50| 79 2e 5c 72 22 29 2c 20 | 66 66 6c 75 73 68 28 73 |y.\r"), |fflush(s|
|00002b60| 74 64 6f 75 74 29 2c 20 | 73 6c 65 65 70 28 33 29 |tdout), |sleep(3)|
|00002b70| 2c 20 31 29 29 20 3b 0a | 58 09 09 09 09 2f 2a 20 |, 1)) ;.|X..../* |
|00002b80| 74 68 69 73 20 69 73 20 | 6e 6f 74 20 6e 69 63 65 |this is |not nice|
|00002b90| 2c 20 49 20 6b 6e 6f 77 | 20 2a 2f 0a 58 0a 58 20 |, I know| */.X.X |
|00002ba0| 20 20 20 2f 2a 20 72 65 | 61 64 79 20 2a 2f 0a 58 | /* re|ady */.X|
|00002bb0| 20 20 20 20 72 65 73 65 | 74 28 29 20 3b 0a 58 20 | rese|t() ;.X |
|00002bc0| 20 20 20 69 66 20 28 66 | 61 69 6c 5f 63 6f 75 6e | if (f|ail_coun|
|00002bd0| 74 29 20 7b 20 20 0a 58 | 09 70 72 69 6e 74 66 28 |t) { .X|.printf(|
|00002be0| 22 46 61 69 6c 65 64 20 | 61 74 74 65 6d 70 73 3a |"Failed |attemps:|
|00002bf0| 20 25 64 5c 6e 50 72 65 | 73 73 20 72 65 74 75 72 | %d\nPre|ss retur|
|00002c00| 6e 20 74 6f 20 65 78 69 | 74 20 22 2c 20 66 61 69 |n to exi|t ", fai|
|00002c10| 6c 5f 63 6f 75 6e 74 29 | 20 3b 0a 58 09 66 66 6c |l_count)| ;.X.ffl|
|00002c20| 75 73 68 28 73 74 64 6f | 75 74 29 20 3b 0a 58 09 |ush(stdo|ut) ;.X.|
|00002c30| 67 65 74 73 28 6f 6c 64 | 63 29 3b 0a 58 20 20 20 |gets(old|c);.X |
|00002c40| 20 7d 0a 58 20 20 20 20 | 65 78 69 74 28 30 29 20 | }.X |exit(0) |
|00002c50| 3b 0a 7d 0a 58 0a 58 0a | 2f 2a 20 72 65 61 64 20 |;.}.X.X.|/* read |
|00002c60| 61 20 6c 69 6e 65 20 69 | 6e 20 72 61 77 20 6d 6f |a line i|n raw mo|
|00002c70| 64 65 2c 20 74 65 72 6d | 69 6e 61 74 65 64 20 62 |de, term|inated b|
|00002c80| 79 20 6e 65 77 6c 69 6e | 65 20 6f 72 20 63 61 72 |y newlin|e or car|
|00002c90| 72 69 61 67 65 20 72 65 | 74 75 72 6e 0a 58 20 2a |riage re|turn.X *|
|00002ca0| 20 6f 72 20 65 78 63 65 | 65 64 69 6e 67 20 53 49 | or exce|eding SI|
|00002cb0| 5a 45 2e 20 43 61 6e 20 | 67 65 74 20 69 6e 74 65 |ZE. Can |get inte|
|00002cc0| 72 72 75 70 74 65 64 20 | 62 79 20 43 74 72 6c 2d |rrupted |by Ctrl-|
|00002cd0| 43 20 69 66 20 69 6e 74 | 72 20 21 3d 20 30 2e 20 |C if int|r != 0. |
|00002ce0| 2a 2f 0a 72 65 61 64 70 | 61 73 73 28 70 2c 20 69 |*/.readp|ass(p, i|
|00002cf0| 6e 74 72 29 0a 63 68 61 | 72 20 2a 70 20 3b 0a 69 |ntr).cha|r *p ;.i|
|00002d00| 6e 74 20 69 6e 74 72 20 | 3b 0a 7b 0a 58 20 20 20 |nt intr |;.{.X |
|00002d10| 20 69 6e 74 20 6e 20 3b | 0a 58 20 20 20 20 63 68 | int n ;|.X ch|
|00002d20| 61 72 20 63 20 3d 20 27 | 20 27 20 3b 09 09 2f 2a |ar c = '| ' ;../*|
|00002d30| 20 74 6f 20 68 61 76 65 | 20 61 20 76 61 6c 75 65 | to have| a value|
|00002d40| 20 77 68 69 63 68 20 69 | 73 20 6e 65 69 74 68 65 | which i|s neithe|
|00002d50| 72 20 2a 2f 0a 58 09 09 | 09 09 2f 2a 20 27 5c 6e |r */.X..|../* '\n|
|00002d60| 27 20 6e 6f 72 20 27 5c | 72 27 20 2a 2f 0a 58 0a |' nor '\|r' */.X.|
|00002d70| 58 20 20 20 20 66 6f 72 | 20 28 6e 20 3d 20 30 3b |X for| (n = 0;|
|00002d80| 20 6e 20 3c 20 53 49 5a | 45 20 26 26 20 63 20 21 | n < SIZ|E && c !|
|00002d90| 3d 20 27 5c 72 27 20 26 | 26 20 63 20 21 3d 20 27 |= '\r' &|& c != '|
|00002da0| 5c 6e 27 3b 20 6e 2b 2b | 29 20 7b 0a 58 09 63 20 |\n'; n++|) {.X.c |
|00002db0| 3d 20 70 5b 6e 5d 20 3d | 20 67 65 74 63 68 61 72 |= p[n] =| getchar|
|00002dc0| 28 29 20 3b 0a 58 09 69 | 66 20 28 69 6e 74 72 20 |() ;.X.i|f (intr |
|00002dd0| 26 26 20 63 20 3d 3d 20 | 27 5c 30 30 33 27 29 20 |&& c == |'\003') |
|00002de0| 7b 0a 58 09 20 20 20 20 | 72 65 73 65 74 28 29 20 |{.X. |reset() |
|00002df0| 3b 0a 58 09 20 20 20 20 | 65 78 69 74 28 31 29 20 |;.X. |exit(1) |
|00002e00| 3b 0a 58 09 7d 0a 58 20 | 20 20 20 7d 0a 58 20 20 |;.X.}.X | }.X |
|00002e10| 20 20 70 5b 6e 5d 20 3d | 20 27 5c 30 27 20 3b 0a | p[n] =| '\0' ;.|
|00002e20| 7d 0a 58 0a 58 0a 2f 2a | 20 70 72 65 70 61 72 65 |}.X.X./*| prepare|
|00002e30| 20 74 65 72 6d 69 6e 61 | 6c 3a 20 6f 70 65 6e 20 | termina|l: open |
|00002e40| 73 74 64 69 6e 20 61 6e | 64 20 73 74 64 6f 75 74 |stdin an|d stdout|
|00002e50| 20 74 6f 20 2f 64 65 76 | 2f 74 74 79 2c 20 64 6f | to /dev|/tty, do|
|00002e60| 6e 27 74 20 65 63 68 6f | 20 2a 2f 0a 2f 2a 20 63 |n't echo| */./* c|
|00002e70| 68 61 72 61 63 74 65 72 | 73 20 61 6e 64 20 6d 61 |haracter|s and ma|
|00002e80| 6b 65 20 73 75 72 65 20 | 77 65 20 67 65 74 20 6e |ke sure |we get n|
|00002e90| 6f 20 73 69 67 6e 61 6c | 20 28 72 61 77 20 6d 6f |o signal| (raw mo|
|00002ea0| 64 65 20 2b 20 73 6f 6d | 65 20 68 65 6c 70 29 2e |de + som|e help).|
|00002eb0| 20 2a 2f 0a 70 72 65 70 | 74 65 72 6d 28 29 0a 7b | */.prep|term().{|
|00002ec0| 0a 58 20 20 20 20 69 6e | 74 20 69 6e 20 3b 0a 58 |.X in|t in ;.X|
|00002ed0| 0a 58 20 20 20 20 2f 2a | 20 77 65 20 77 61 6e 74 |.X /*| we want|
|00002ee0| 20 74 6f 20 72 65 61 64 | 20 74 68 65 20 70 61 73 | to read| the pas|
|00002ef0| 73 77 6f 72 64 20 4f 4e | 4c 59 20 66 72 6f 6d 20 |sword ON|LY from |
|00002f00| 61 20 74 65 72 6d 69 6e | 61 6c 20 2a 2f 0a 58 20 |a termin|al */.X |
|00002f10| 20 20 20 69 66 20 28 28 | 69 6e 20 3d 20 6f 70 65 | if ((|in = ope|
|00002f20| 6e 28 22 2f 64 65 76 2f | 74 74 79 22 2c 20 4f 5f |n("/dev/|tty", O_|
|00002f30| 52 44 57 52 29 29 20 3d | 3d 20 2d 31 29 20 7b 0a |RDWR)) =|= -1) {.|
|00002f40| 58 09 70 65 72 72 6f 72 | 28 22 2f 64 65 76 2f 74 |X.perror|("/dev/t|
|00002f50| 74 79 22 29 20 3b 0a 58 | 09 65 78 69 74 28 31 29 |ty") ;.X|.exit(1)|
|00002f60| 20 3b 0a 58 20 20 20 20 | 7d 0a 58 20 20 20 20 63 | ;.X |}.X c|
|00002f70| 6c 6f 73 65 28 30 29 20 | 3b 0a 58 20 20 20 20 64 |lose(0) |;.X d|
|00002f80| 75 70 28 69 6e 29 20 3b | 0a 58 20 20 20 20 63 6c |up(in) ;|.X cl|
|00002f90| 6f 73 65 28 31 29 20 3b | 0a 58 20 20 20 20 64 75 |ose(1) ;|.X du|
|00002fa0| 70 28 69 6e 29 20 3b 0a | 58 20 20 20 20 63 6c 6f |p(in) ;.|X clo|
|00002fb0| 73 65 28 32 29 20 3b 0a | 58 20 20 20 20 64 75 70 |se(2) ;.|X dup|
|00002fc0| 28 69 6e 29 20 3b 0a 58 | 0a 58 20 20 20 20 2f 2a |(in) ;.X|.X /*|
|00002fd0| 20 6d 61 6b 65 20 73 75 | 72 65 20 77 65 20 77 6f | make su|re we wo|
|00002fe0| 6e 27 74 20 67 65 74 20 | 69 6e 74 65 72 72 75 70 |n't get |interrup|
|00002ff0| 74 65 64 20 2a 2f 0a 58 | 20 20 20 20 69 6e 69 74 |ted */.X| init|
|00003000| 73 63 72 28 29 20 3b 0a | 58 20 20 20 20 72 61 77 |scr() ;.|X raw|
|00003010| 28 29 20 3b 0a 58 20 20 | 20 20 2f 2a 20 74 68 65 |() ;.X | /* the|
|00003020| 20 62 72 65 61 6b 20 6b | 65 79 20 6f 6e 20 49 53 | break k|ey on IS|
|00003030| 43 27 73 20 61 74 33 38 | 36 20 63 6f 6e 73 6f 6c |C's at38|6 consol|
|00003040| 65 20 67 65 6e 65 72 61 | 74 65 73 20 61 20 53 49 |e genera|tes a SI|
|00003050| 47 49 4e 54 20 65 76 65 | 6e 20 69 6e 0a 58 20 20 |GINT eve|n in.X |
|00003060| 20 20 20 2a 20 72 61 77 | 20 6d 6f 64 65 20 2a 2f | * raw| mode */|
|00003070| 0a 58 20 20 20 20 73 69 | 67 6e 61 6c 28 53 49 47 |.X si|gnal(SIG|
|00003080| 49 4e 54 2c 20 53 49 47 | 5f 49 47 4e 29 20 3b 0a |INT, SIG|_IGN) ;.|
|00003090| 58 0a 58 20 20 20 20 2f | 2a 20 64 6f 6e 27 74 20 |X.X /|* don't |
|000030a0| 65 63 68 6f 20 6b 65 79 | 73 74 72 6f 6b 65 73 20 |echo key|strokes |
|000030b0| 2a 2f 0a 58 20 20 20 20 | 6e 6f 65 63 68 6f 28 29 |*/.X |noecho()|
|000030c0| 20 3b 0a 7d 0a 58 0a 58 | 0a 2f 2a 20 70 75 74 20 | ;.}.X.X|./* put |
|000030d0| 74 65 72 6d 69 6e 61 6c | 20 69 6e 74 6f 20 61 20 |terminal| into a |
|000030e0| 73 74 61 74 65 20 74 68 | 65 20 75 73 65 72 20 69 |state th|e user i|
|000030f0| 73 20 73 75 70 70 6f 73 | 65 64 20 74 6f 20 77 61 |s suppos|ed to wa|
|00003100| 6e 74 20 61 66 74 65 72 | 20 74 68 65 20 2a 2f 0a |nt after| the */.|
|00003110| 2f 2a 20 74 65 72 6d 69 | 6e 61 74 69 6f 6e 20 6f |/* termi|nation o|
|00003120| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 2e 20 2a |f the pr|ogram. *|
|00003130| 2f 0a 72 65 73 65 74 28 | 29 0a 7b 0a 58 20 20 20 |/.reset(|).{.X |
|00003140| 20 69 6e 74 20 69 20 3b | 0a 58 0a 58 20 20 20 20 | int i ;|.X.X |
|00003150| 2f 2a 20 72 65 73 65 74 | 20 6d 6f 64 65 73 20 2a |/* reset| modes *|
|00003160| 2f 0a 58 20 20 20 20 63 | 6c 65 61 72 28 29 20 3b |/.X c|lear() ;|
|00003170| 0a 58 20 20 20 20 6e 6f | 72 61 77 28 29 20 3b 0a |.X no|raw() ;.|
|00003180| 58 20 20 20 20 65 63 68 | 6f 28 29 20 3b 0a 58 20 |X ech|o() ;.X |
|00003190| 20 20 20 2f 2a 20 65 6e | 64 20 63 75 72 73 65 73 | /* en|d curses|
|000031a0| 20 2a 2f 0a 58 20 20 20 | 20 65 6e 64 77 69 6e 28 | */.X | endwin(|
|000031b0| 29 20 3b 0a 58 0a 58 20 | 20 20 20 2f 2a 20 64 65 |) ;.X.X | /* de|
|000031c0| 6c 65 74 65 20 70 72 6f | 6d 70 74 20 2a 2f 0a 58 |lete pro|mpt */.X|
|000031d0| 20 20 20 20 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 | for |(i = 0; |
|000031e0| 69 20 3c 20 73 74 72 6c | 65 6e 28 70 72 6f 6d 70 |i < strl|en(promp|
|000031f0| 74 29 3b 20 69 2b 2b 29 | 20 7b 0a 58 09 70 75 74 |t); i++)| {.X.put|
|00003200| 63 68 61 72 28 27 5c 62 | 27 29 3b 0a 58 09 70 75 |char('\b|');.X.pu|
|00003210| 74 63 68 61 72 28 27 20 | 27 29 3b 0a 58 09 70 75 |tchar(' |');.X.pu|
|00003220| 74 63 68 61 72 28 27 5c | 62 27 29 3b 0a 58 20 20 |tchar('\|b');.X |
|00003230| 20 20 7d 0a 7d 0a 58 0a | 58 0a 2f 2a 20 63 72 65 | }.}.X.|X./* cre|
|00003240| 61 74 65 20 61 20 6e 65 | 77 20 70 61 73 73 77 6f |ate a ne|w passwo|
|00003250| 72 64 20 66 69 6c 65 20 | 2a 2f 0a 6e 65 77 70 77 |rd file |*/.newpw|
|00003260| 64 66 69 6c 65 28 29 0a | 7b 0a 58 20 20 20 20 63 |dfile().|{.X c|
|00003270| 68 61 72 20 74 6d 70 6c | 5b 53 49 5a 45 2b 31 5d |har tmpl|[SIZE+1]|
|00003280| 2c 20 73 61 6c 74 5b 33 | 5d 20 3b 0a 58 20 20 20 |, salt[3|] ;.X |
|00003290| 20 69 6e 74 20 6f 75 74 | 20 3b 0a 58 0a 58 20 20 | int out| ;.X.X |
|000032a0| 20 20 2f 2a 20 6d 61 6b | 65 20 73 61 6c 74 20 66 | /* mak|e salt f|
|000032b0| 6f 72 20 63 72 79 70 74 | 20 2a 2f 0a 58 20 20 20 |or crypt| */.X |
|000032c0| 20 73 72 61 6e 64 28 74 | 69 6d 65 28 4e 55 4c 4c | srand(t|ime(NULL|
|000032d0| 29 29 20 3b 0a 58 20 20 | 20 20 73 61 6c 74 5b 30 |)) ;.X | salt[0|
|000032e0| 5d 20 3d 20 53 41 4c 54 | 43 5b 72 61 6e 64 28 29 |] = SALT|C[rand()|
|000032f0| 20 25 20 73 74 72 6c 65 | 6e 28 53 41 4c 54 43 29 | % strle|n(SALTC)|
|00003300| 5d 20 3b 0a 58 20 20 20 | 20 73 61 6c 74 5b 31 5d |] ;.X | salt[1]|
|00003310| 20 3d 20 53 41 4c 54 43 | 5b 72 61 6e 64 28 29 20 | = SALTC|[rand() |
|00003320| 25 20 73 74 72 6c 65 6e | 28 53 41 4c 54 43 29 5d |% strlen|(SALTC)]|
|00003330| 20 3b 0a 58 20 20 20 20 | 73 61 6c 74 5b 33 5d 20 | ;.X |salt[3] |
|00003340| 3d 20 27 5c 30 27 20 3b | 0a 58 0a 58 20 20 20 20 |= '\0' ;|.X.X |
|00003350| 2f 2a 20 72 65 61 64 20 | 61 6e 64 20 76 65 72 69 |/* read |and veri|
|00003360| 66 79 20 70 61 73 73 77 | 6f 72 64 20 2a 2f 0a 58 |fy passw|ord */.X|
|00003370| 20 20 20 20 66 70 75 74 | 73 28 22 45 6e 74 65 72 | fput|s("Enter|
|00003380| 20 70 61 73 73 77 6f 72 | 64 3a 20 20 22 2c 20 73 | passwor|d: ", s|
|00003390| 74 64 6f 75 74 29 20 3b | 0a 58 20 20 20 20 66 66 |tdout) ;|.X ff|
|000033a0| 6c 75 73 68 28 73 74 64 | 6f 75 74 29 20 3b 0a 58 |lush(std|out) ;.X|
|000033b0| 20 20 20 20 72 65 61 64 | 70 61 73 73 28 74 6d 70 | read|pass(tmp|
|000033c0| 6c 2c 20 74 72 75 65 29 | 20 3b 0a 58 20 20 20 20 |l, true)| ;.X |
|000033d0| 73 74 72 63 70 79 28 6f | 6c 64 63 2c 20 63 72 79 |strcpy(o|ldc, cry|
|000033e0| 70 74 28 74 6d 70 6c 2c | 20 73 61 6c 74 29 29 20 |pt(tmpl,| salt)) |
|000033f0| 3b 0a 58 20 20 20 20 66 | 70 75 74 73 28 22 5c 72 |;.X f|puts("\r|
|00003400| 5c 6e 52 65 74 79 70 65 | 20 70 61 73 73 77 6f 72 |\nRetype| passwor|
|00003410| 64 3a 20 22 2c 20 73 74 | 64 6f 75 74 29 20 3b 0a |d: ", st|dout) ;.|
|00003420| 58 20 20 20 20 66 66 6c | 75 73 68 28 73 74 64 6f |X ffl|ush(stdo|
|00003430| 75 74 29 20 3b 0a 58 20 | 20 20 20 72 65 61 64 70 |ut) ;.X | readp|
|00003440| 61 73 73 28 74 6d 70 6c | 2c 20 74 72 75 65 29 20 |ass(tmpl|, true) |
|00003450| 3b 0a 58 20 20 20 20 73 | 74 72 63 70 79 28 6e 65 |;.X s|trcpy(ne|
|00003460| 77 63 2c 20 63 72 79 70 | 74 28 74 6d 70 6c 2c 20 |wc, cryp|t(tmpl, |
|00003470| 73 61 6c 74 29 29 20 3b | 0a 58 20 20 20 20 6e 65 |salt)) ;|.X ne|
|00003480| 77 63 5b 43 4c 45 4e 5d | 20 3d 20 27 5c 30 27 20 |wc[CLEN]| = '\0' |
|00003490| 3b 0a 58 0a 58 20 20 20 | 20 69 66 20 28 73 74 72 |;.X.X | if (str|
|000034a0| 63 6d 70 28 6f 6c 64 63 | 2c 20 6e 65 77 63 29 29 |cmp(oldc|, newc))|
|000034b0| 20 7b 0a 58 09 70 75 74 | 73 28 22 5c 72 5c 6e 4e | {.X.put|s("\r\nN|
|000034c0| 6f 20 6d 61 74 63 68 2e | 5c 72 22 29 20 3b 0a 58 |o match.|\r") ;.X|
|000034d0| 09 66 66 6c 75 73 68 28 | 73 74 64 6f 75 74 29 20 |.fflush(|stdout) |
|000034e0| 3b 0a 58 09 72 65 73 65 | 74 28 29 20 3b 0a 58 09 |;.X.rese|t() ;.X.|
|000034f0| 65 78 69 74 28 32 29 20 | 3b 0a 58 20 20 20 20 7d |exit(2) |;.X }|
|00003500| 0a 58 0a 58 20 20 20 20 | 2f 2a 20 63 72 65 61 74 |.X.X |/* creat|
|00003510| 65 20 70 61 73 73 77 6f | 72 64 20 66 69 6c 65 20 |e passwo|rd file |
|00003520| 2a 2f 0a 58 20 20 20 20 | 69 66 20 28 28 6f 75 74 |*/.X |if ((out|
|00003530| 20 3d 20 6f 70 65 6e 28 | 70 66 69 6c 6e 61 6d 2c | = open(|pfilnam,|
|00003540| 20 4f 5f 57 52 4f 4e 4c | 59 20 7c 20 4f 5f 43 52 | O_WRONL|Y | O_CR|
|00003550| 45 41 54 2c 20 30 36 30 | 30 29 29 20 3d 3d 20 2d |EAT, 060|0)) == -|
|00003560| 31 29 20 7b 0a 58 09 72 | 65 73 65 74 28 29 20 3b |1) {.X.r|eset() ;|
|00003570| 0a 58 09 70 65 72 72 6f | 72 28 70 66 69 6c 6e 61 |.X.perro|r(pfilna|
|00003580| 6d 29 20 3b 0a 58 09 65 | 78 69 74 28 65 72 72 6e |m) ;.X.e|xit(errn|
|00003590| 6f 29 20 3b 0a 58 20 20 | 20 20 7d 0a 58 0a 58 20 |o) ;.X | }.X.X |
|000035a0| 20 20 20 2f 2a 20 77 72 | 69 74 65 20 63 72 79 70 | /* wr|ite cryp|
|000035b0| 74 20 2a 2f 0a 58 20 20 | 20 20 77 72 69 74 65 28 |t */.X | write(|
|000035c0| 6f 75 74 2c 20 6e 65 77 | 63 2c 20 43 4c 45 4e 29 |out, new|c, CLEN)|
|000035d0| 20 3b 0a 58 20 20 20 20 | 63 6c 6f 73 65 28 6f 75 | ;.X |close(ou|
|000035e0| 74 29 20 3b 0a 7d 0a 58 | 0a 58 0a 75 73 61 67 65 |t) ;.}.X|.X.usage|
|000035f0| 28 29 0a 7b 0a 58 20 20 | 20 20 66 70 75 74 73 28 |().{.X | fputs(|
|00003600| 22 55 73 61 67 65 3a 20 | 22 2c 20 73 74 64 6f 75 |"Usage: |", stdou|
|00003610| 74 29 20 3b 0a 58 20 20 | 20 20 66 70 75 74 73 28 |t) ;.X | fputs(|
|00003620| 70 72 6f 67 6e 61 6d 65 | 2c 20 73 74 64 6f 75 74 |progname|, stdout|
|00003630| 29 20 3b 0a 58 20 20 20 | 20 70 75 74 73 28 22 20 |) ;.X | puts(" |
|00003640| 5b 20 2d 70 20 5d 5c 72 | 22 29 20 3b 0a 7d 0a 58 |[ -p ]\r|") ;.}.X|
|00003650| 0a 58 0a 2f 2a 20 72 65 | 74 75 72 6e 73 20 74 72 |.X./* re|turns tr|
|00003660| 75 65 20 69 66 20 6f 6c | 64 63 20 64 6f 65 73 20 |ue if ol|dc does |
|00003670| 6e 6f 74 20 6c 6f 6f 6b | 20 6c 69 6b 65 20 61 20 |not look| like a |
|00003680| 76 61 6c 69 64 20 63 72 | 79 70 74 20 2a 2f 0a 63 |valid cr|ypt */.c|
|00003690| 68 65 63 6b 6f 6c 64 63 | 28 29 0a 7b 0a 58 20 20 |heckoldc|().{.X |
|000036a0| 20 20 69 6e 74 20 69 20 | 3b 0a 58 0a 58 20 20 20 | int i |;.X.X |
|000036b0| 20 2f 2a 20 63 68 65 63 | 6b 20 66 6f 72 20 69 6c | /* chec|k for il|
|000036c0| 6c 65 67 61 6c 20 63 68 | 61 72 61 63 74 65 72 73 |legal ch|aracters|
|000036d0| 20 2a 2f 0a 58 20 20 20 | 20 66 6f 72 20 28 69 20 | */.X | for (i |
|000036e0| 3d 20 30 3b 20 69 20 3c | 20 43 4c 45 4e 20 2d 20 |= 0; i <| CLEN - |
|000036f0| 31 3b 20 69 2b 2b 29 20 | 7b 0a 58 09 69 66 20 28 |1; i++) |{.X.if (|
|00003700| 21 73 74 72 63 68 72 28 | 53 41 4c 54 43 2c 20 6f |!strchr(|SALTC, o|
|00003710| 6c 64 63 5b 69 5d 29 29 | 20 7b 0a 58 09 20 20 20 |ldc[i]))| {.X. |
|00003720| 20 72 65 74 75 72 6e 20 | 74 72 75 65 20 3b 0a 58 | return |true ;.X|
|00003730| 09 7d 0a 58 20 20 20 20 | 7d 0a 58 0a 58 20 20 20 |.}.X |}.X.X |
|00003740| 20 2f 2a 20 63 68 65 63 | 6b 20 66 6f 72 20 74 65 | /* chec|k for te|
|00003750| 72 6d 69 6e 61 74 69 6e | 67 20 6e 75 6c 6c 20 63 |rminatin|g null c|
|00003760| 68 61 72 61 63 74 65 72 | 20 2a 2f 0a 58 20 20 20 |haracter| */.X |
|00003770| 20 72 65 74 75 72 6e 20 | 6f 6c 64 63 5b 69 5d 20 | return |oldc[i] |
|00003780| 3b 0a 7d 0a 53 48 41 52 | 5f 45 4f 46 0a 63 68 6d |;.}.SHAR|_EOF.chm|
|00003790| 6f 64 20 30 36 34 34 20 | 6c 6f 63 6b 74 74 79 2e |od 0644 |locktty.|
|000037a0| 63 20 7c 7c 0a 65 63 68 | 6f 20 27 72 65 73 74 6f |c ||.ech|o 'resto|
|000037b0| 72 65 20 6f 66 20 6c 6f | 63 6b 74 74 79 2e 63 20 |re of lo|cktty.c |
|000037c0| 66 61 69 6c 65 64 27 0a | 57 63 5f 63 3d 22 60 77 |failed'.|Wc_c="`w|
|000037d0| 63 20 2d 63 20 3c 20 27 | 6c 6f 63 6b 74 74 79 2e |c -c < '|locktty.|
|000037e0| 63 27 60 22 0a 74 65 73 | 74 20 37 30 31 34 20 2d |c'`".tes|t 7014 -|
|000037f0| 65 71 20 22 24 57 63 5f | 63 22 20 7c 7c 0a 09 65 |eq "$Wc_|c" ||..e|
|00003800| 63 68 6f 20 27 6c 6f 63 | 6b 74 74 79 2e 63 3a 20 |cho 'loc|ktty.c: |
|00003810| 6f 72 69 67 69 6e 61 6c | 20 73 69 7a 65 20 37 30 |original| size 70|
|00003820| 31 34 2c 20 63 75 72 72 | 65 6e 74 20 73 69 7a 65 |14, curr|ent size|
|00003830| 27 20 22 24 57 63 5f 63 | 22 0a 66 69 0a 65 78 69 |' "$Wc_c|".fi.exi|
|00003840| 74 20 30 0a 2d 2d 0a 4a | 75 65 72 67 65 6e 20 4e |t 0.--.J|uergen N|
|00003850| 69 63 6b 65 6c 73 65 6e | 20 20 20 20 20 20 20 20 |ickelsen| |
|00003860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003870| 20 20 20 20 20 20 20 6e | 69 63 6b 65 6c 40 63 73 | n|ickel@cs|
|00003880| 2e 74 75 2d 62 65 72 6c | 69 6e 2e 64 65 0a |.tu-berl|in.de. |
+--------+-------------------------+-------------------------+--------+--------+