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: Tape Archive
(archive/tar).
You can browse this item here: chkpwd.tar
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| tar archive
| default
| |
99%
| file
| tar archive (V7), file chkpwd/, mode 755 , uid 243 , gid 13 , size 0 , seconds 4426106626
| default
| |
98%
| file
| data
| default
| |
100%
| TrID
| Sybase iAnywhere database files
| default (weak)
| |
100%
| siegfried
| x-fmt/265 Tape Archive Format
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| Pre-POSIX tar archive
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 63 68 6b 70 77 64 2f 00 | 00 00 00 00 00 00 00 00 |chkpwd/.|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 32 |.... 7|55 . 2|
|00000070| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 34 34 32 36 31 30 36 | 0 | 4426106|
|00000090| 36 32 36 20 20 20 35 33 | 30 33 00 20 00 00 00 00 |626 53|03. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 63 68 6b 70 77 64 2f 53 | 68 61 72 46 69 6c 65 2e |chkpwd/S|harFile.|
|00000210| 48 65 61 64 65 72 73 00 | 00 00 00 00 00 00 00 00 |Headers.|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000270| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00000280| 20 20 20 31 30 31 33 20 | 20 34 34 32 36 31 30 36 | 1013 | 4426106|
|00000290| 36 32 37 20 20 31 30 33 | 35 36 00 20 00 00 00 00 |627 103|56. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 3d 3d 3d 20 63 68 6b 70 | 77 64 2e 73 68 61 72 20 |=== chkp|wd.shar |
|00000410| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000420| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0a 46 72 6f 6d 20 72 |========|=.From r|
|00000430| 69 61 63 73 21 65 6f 73 | 21 61 6d 65 73 21 6c 6c |iacs!eos|!ames!ll|
|00000440| 6c 2d 77 69 6e 6b 65 6e | 21 75 75 6e 65 74 21 61 |l-winken|!uunet!a|
|00000450| 6c 6c 62 65 72 79 20 4d | 6f 6e 20 41 70 72 20 32 |llbery M|on Apr 2|
|00000460| 34 20 31 30 3a 31 36 3a | 32 35 20 50 44 54 20 31 |4 10:16:|25 PDT 1|
|00000470| 39 38 39 0a 0a 50 6f 73 | 74 69 6e 67 2d 6e 75 6d |989..Pos|ting-num|
|00000480| 62 65 72 3a 20 56 6f 6c | 75 6d 65 20 36 2c 20 49 |ber: Vol|ume 6, I|
|00000490| 73 73 75 65 20 39 31 0a | 53 75 62 6d 69 74 74 65 |ssue 91.|Submitte|
|000004a0| 64 2d 62 79 3a 20 75 74 | 2d 65 6d 78 21 63 6c 79 |d-by: ut|-emx!cly|
|000004b0| 64 65 40 63 73 2e 75 74 | 65 78 61 73 2e 65 64 75 |de@cs.ut|exas.edu|
|000004c0| 20 28 48 65 61 64 20 55 | 4e 49 58 20 48 61 63 71 | (Head U|NIX Hacq|
|000004d0| 75 65 72 29 0a 41 72 63 | 68 69 76 65 2d 6e 61 6d |uer).Arc|hive-nam|
|000004e0| 65 3a 20 63 68 6b 70 77 | 64 0a 0a 45 6e 63 6c 6f |e: chkpw|d..Enclo|
|000004f0| 73 65 64 20 69 73 20 73 | 6f 6d 65 20 63 6f 64 65 |sed is s|ome code|
|00000500| 20 74 68 61 74 20 49 20 | 77 6f 72 6b 65 64 20 75 | that I |worked u|
|00000510| 70 20 74 6f 20 64 6f 20 | 73 6f 6d 65 20 70 61 73 |p to do |some pas|
|00000520| 73 77 6f 72 64 20 63 68 | 65 63 6b 69 6e 67 2e 0a |sword ch|ecking..|
|00000530| 49 20 68 6f 70 65 20 69 | 74 20 63 61 6e 20 62 65 |I hope i|t can be|
|00000540| 20 75 73 65 66 75 6c 20 | 74 6f 20 6f 74 68 65 72 | useful |to other|
|00000550| 73 2e 0a 0a 23 09 54 68 | 69 73 20 69 73 20 61 20 |s...#.Th|is is a |
|00000560| 73 68 65 6c 6c 20 61 72 | 63 68 69 76 65 2e 0a 23 |shell ar|chive..#|
|00000570| 09 52 65 6d 6f 76 65 20 | 65 76 65 72 79 74 68 69 |.Remove |everythi|
|00000580| 6e 67 20 61 62 6f 76 65 | 20 61 6e 64 20 69 6e 63 |ng above| and inc|
|00000590| 6c 75 64 69 6e 67 20 74 | 68 65 20 63 75 74 20 6c |luding t|he cut l|
|000005a0| 69 6e 65 2e 0a 23 09 54 | 68 65 6e 20 72 75 6e 20 |ine..#.T|hen run |
|000005b0| 74 68 65 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |the rest| of the |
|000005c0| 66 69 6c 65 20 74 68 72 | 6f 75 67 68 20 73 68 2e |file thr|ough sh.|
|000005d0| 0a 2d 2d 2d 2d 2d 63 75 | 74 20 68 65 72 65 2d 2d |.-----cu|t here--|
|000005e0| 2d 2d 2d 63 75 74 20 68 | 65 72 65 2d 2d 2d 2d 2d |---cut h|ere-----|
|000005f0| 63 75 74 20 68 65 72 65 | 2d 2d 2d 2d 2d 63 75 74 |cut here|-----cut|
|00000600| 20 68 65 72 65 2d 2d 2d | 2d 2d 0a 00 00 00 00 00 | here---|--......|
|00000610| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000690| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 63 68 6b 70 77 64 2f 52 | 45 41 44 4d 45 00 00 00 |chkpwd/R|EADME...|
|00000810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00000870| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00000880| 20 20 20 32 30 32 30 20 | 20 34 34 32 36 31 30 36 | 2020 | 4426106|
|00000890| 36 32 30 20 20 20 36 32 | 33 34 00 20 00 00 00 00 |620 62|34. ....|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 0a 54 68 69 73 20 69 73 | 20 61 20 70 61 73 73 77 |.This is| a passw|
|00000a10| 6f 72 64 20 63 68 65 63 | 6b 69 6e 67 20 70 72 6f |ord chec|king pro|
|00000a20| 67 72 61 6d 20 74 68 61 | 74 20 49 20 77 72 6f 74 |gram tha|t I wrot|
|00000a30| 65 20 61 66 74 65 72 20 | 74 68 65 20 69 6e 66 61 |e after |the infa|
|00000a40| 6d 6f 75 73 20 49 6e 74 | 65 72 6e 65 74 0a 77 6f |mous Int|ernet.wo|
|00000a50| 72 6d 2e 20 20 49 20 75 | 73 65 64 20 74 68 65 20 |rm. I u|sed the |
|00000a60| 70 61 73 73 77 6f 72 64 | 20 63 72 61 63 6b 69 6e |password| crackin|
|00000a70| 67 20 61 6c 67 6f 72 69 | 74 68 69 6d 20 74 68 65 |g algori|thim the|
|00000a80| 20 77 6f 72 6d 20 75 73 | 65 64 20 69 6e 20 6f 72 | worm us|ed in or|
|00000a90| 64 65 72 0a 74 6f 20 63 | 68 65 63 6b 20 74 68 65 |der.to c|heck the|
|00000aa0| 20 6f 62 76 69 6f 75 73 | 6e 65 73 73 20 6f 66 20 | obvious|ness of |
|00000ab0| 61 20 70 61 73 73 77 6f | 72 64 2e 0a 0a 54 68 65 |a passwo|rd...The|
|00000ac0| 20 72 6f 75 74 69 6e 65 | 20 63 68 65 63 6b 70 61 | routine| checkpa|
|00000ad0| 73 73 77 64 2e 63 20 64 | 6f 65 73 20 74 68 69 73 |sswd.c d|oes this|
|00000ae0| 2e 20 20 52 65 61 64 20 | 74 68 65 20 73 6f 75 72 |. Read |the sour|
|00000af0| 63 65 20 66 6f 72 20 74 | 68 65 20 72 6f 75 74 69 |ce for t|he routi|
|00000b00| 6e 65 0a 66 6f 72 20 64 | 65 74 61 69 6c 73 20 6f |ne.for d|etails o|
|00000b10| 66 20 68 6f 77 20 69 74 | 20 77 6f 72 6b 73 2e 20 |f how it| works. |
|00000b20| 20 49 6e 20 74 68 69 73 | 20 70 61 63 6b 61 67 65 | In this| package|
|00000b30| 20 61 72 65 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | are the| followi|
|00000b40| 6e 67 3a 0a 0a 52 45 41 | 44 4d 45 09 09 54 68 69 |ng:..REA|DME..Thi|
|00000b50| 73 20 66 69 6c 65 0a 4d | 61 6b 65 66 69 6c 65 09 |s file.M|akefile.|
|00000b60| 51 2e 45 2e 44 2e 0a 63 | 68 65 63 6b 70 61 73 73 |Q.E.D..c|heckpass|
|00000b70| 77 64 2e 63 09 50 61 73 | 73 77 6f 72 64 20 63 68 |wd.c.Pas|sword ch|
|00000b80| 65 63 6b 20 72 6f 75 74 | 69 6e 65 0a 63 68 65 63 |eck rout|ine.chec|
|00000b90| 6b 70 61 73 73 77 64 2e | 68 09 49 6e 63 6c 75 64 |kpasswd.|h.Includ|
|00000ba0| 65 20 66 6f 72 20 63 68 | 65 63 6b 70 61 73 73 77 |e for ch|eckpassw|
|00000bb0| 64 20 63 61 6c 6c 69 6e | 67 0a 64 72 69 76 65 72 |d callin|g.driver|
|00000bc0| 2e 63 09 54 65 73 74 20 | 70 72 6f 67 72 61 6d 0a |.c.Test |program.|
|00000bd0| 6d 61 6b 65 64 69 63 74 | 2e 63 09 50 72 6f 67 72 |makedict|.c.Progr|
|00000be0| 61 6d 20 74 6f 20 62 75 | 69 6c 64 20 64 62 6d 20 |am to bu|ild dbm |
|00000bf0| 64 69 63 74 69 6f 6e 61 | 72 79 0a 77 6f 72 6d 77 |dictiona|ry.wormw|
|00000c00| 6f 72 64 73 09 54 68 65 | 20 69 6e 66 61 6d 6f 75 |ords.The| infamou|
|00000c10| 73 20 77 6f 72 6d 20 70 | 61 73 73 77 6f 72 64 20 |s worm p|assword |
|00000c20| 6c 69 73 74 0a 76 69 65 | 77 64 69 63 74 2e 63 09 |list.vie|wdict.c.|
|00000c30| 50 72 6f 67 72 61 6d 20 | 74 6f 20 76 69 65 77 20 |Program |to view |
|00000c40| 64 62 6d 20 64 69 63 74 | 69 6f 6e 61 72 79 0a 0a |dbm dict|ionary..|
|00000c50| 49 20 68 6f 70 65 20 74 | 68 69 73 20 63 61 6e 20 |I hope t|his can |
|00000c60| 62 65 20 61 20 6b 65 72 | 6e 65 6c 20 6f 66 20 69 |be a ker|nel of i|
|00000c70| 6e 74 65 6c 6c 69 67 65 | 6e 74 20 70 61 73 73 77 |ntellige|nt passw|
|00000c80| 6f 72 64 20 63 68 65 63 | 6b 69 6e 67 20 66 6f 72 |ord chec|king for|
|00000c90| 20 34 42 53 44 20 73 79 | 73 74 65 6d 73 2e 0a 0a | 4BSD sy|stems...|
|00000ca0| 49 20 61 6d 20 77 6f 72 | 6b 69 6e 67 20 6f 6e 20 |I am wor|king on |
|00000cb0| 61 20 72 65 70 6c 61 63 | 65 6d 65 6e 74 20 66 6f |a replac|ement fo|
|00000cc0| 72 20 74 68 65 20 42 53 | 44 20 70 61 73 73 77 64 |r the BS|D passwd|
|00000cd0| 20 70 72 6f 67 72 61 6d | 2c 20 77 68 69 63 68 20 | program|, which |
|00000ce0| 73 68 6f 75 6c 64 20 62 | 65 0a 61 76 61 69 6c 61 |should b|e.availa|
|00000cf0| 62 6c 65 20 73 6f 6f 6e | 2e 0a 0a 43 6f 6e 74 65 |ble soon|...Conte|
|00000d00| 6e 74 73 20 63 6f 70 79 | 72 69 67 68 74 20 31 39 |nts copy|right 19|
|00000d10| 38 39 20 43 6c 79 64 65 | 20 57 2e 20 48 6f 6f 76 |89 Clyde| W. Hoov|
|00000d20| 65 72 20 28 4d 6f 6f 73 | 65 20 26 20 53 71 75 69 |er (Moos|e & Squi|
|00000d30| 72 72 65 6c 20 53 6f 66 | 74 77 61 72 65 2c 20 4e |rrel Sof|tware, N|
|00000d40| 6f 74 49 6e 63 2e 29 0a | 0a 44 69 73 74 72 69 62 |otInc.).|.Distrib|
|00000d50| 75 74 69 6f 6e 20 75 6e | 6c 69 6d 69 74 65 64 20 |ution un|limited |
|00000d60| 70 72 6f 76 69 64 65 64 | 20 63 6f 70 79 72 69 67 |provided| copyrig|
|00000d70| 68 74 20 6e 6f 74 69 63 | 65 20 69 73 20 72 65 74 |ht notic|e is ret|
|00000d80| 61 69 6e 65 64 2e 0a 50 | 6c 65 61 73 65 20 73 70 |ained..P|lease sp|
|00000d90| 72 65 61 64 20 74 68 69 | 73 20 61 72 6f 75 6e 64 |read thi|s around|
|00000da0| 20 61 73 20 6d 75 63 68 | 20 61 73 20 75 73 65 66 | as much| as usef|
|00000db0| 75 6c 2e 0a 0a 09 43 6c | 79 64 65 20 48 6f 6f 76 |ul....Cl|yde Hoov|
|00000dc0| 65 72 0a 09 43 6f 6d 70 | 75 74 61 74 69 6f 6e 20 |er..Comp|utation |
|00000dd0| 43 65 6e 74 65 72 0a 09 | 54 68 65 20 55 6e 69 76 |Center..|The Univ|
|00000de0| 65 72 73 69 74 79 20 6f | 66 20 54 65 78 61 73 20 |ersity o|f Texas |
|00000df0| 61 74 20 41 75 73 74 69 | 6e 0a 09 63 6c 79 64 65 |at Austi|n..clyde|
|00000e00| 40 65 6d 78 2e 75 74 65 | 78 61 73 2e 65 64 75 0a |@emx.ute|xas.edu.|
|00000e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001000| 63 68 6b 70 77 64 2f 4d | 61 6b 65 66 69 6c 65 00 |chkpwd/M|akefile.|
|00001010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001070| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00001080| 20 20 20 31 32 33 36 20 | 20 34 34 32 36 31 30 36 | 1236 | 4426106|
|00001090| 36 32 31 20 20 20 37 30 | 32 35 00 20 00 00 00 00 |621 70|25. ....|
|000010a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 23 0a 23 09 4d 61 6b 65 | 20 70 61 73 73 77 6f 72 |#.#.Make| passwor|
|00001210| 64 20 63 68 65 63 6b 69 | 6e 67 20 72 6f 75 74 69 |d checki|ng routi|
|00001220| 6e 65 73 20 61 6e 64 20 | 74 65 73 74 20 70 72 6f |nes and |test pro|
|00001230| 67 72 61 6d 0a 0a 23 0a | 23 09 54 68 65 20 63 68 |gram..#.|#.The ch|
|00001240| 65 63 6b 70 61 73 73 77 | 64 20 72 6f 75 74 69 6e |eckpassw|d routin|
|00001250| 65 20 64 65 70 65 6e 64 | 73 20 75 70 6f 6e 20 74 |e depend|s upon t|
|00001260| 68 65 20 65 78 69 73 74 | 65 6e 63 65 20 6f 66 20 |he exist|ence of |
|00001270| 74 68 65 20 6e 64 62 6d | 0a 23 09 72 6f 75 74 69 |the ndbm|.#.routi|
|00001280| 6e 65 73 20 69 6e 20 74 | 68 65 20 34 2e 33 42 53 |nes in t|he 4.3BS|
|00001290| 44 20 6c 69 62 63 2e 20 | 20 43 68 61 6e 67 65 73 |D libc. | Changes|
|000012a0| 20 77 69 6c 6c 20 68 61 | 76 65 20 74 6f 20 62 65 | will ha|ve to be|
|000012b0| 20 6d 61 64 65 20 74 6f | 0a 23 09 63 68 65 63 6b | made to|.#.check|
|000012c0| 70 61 73 73 77 64 2e 63 | 20 69 66 20 74 68 65 73 |passwd.c| if thes|
|000012d0| 65 20 61 72 65 20 6e 6f | 74 20 61 76 61 69 6c 61 |e are no|t availa|
|000012e0| 62 6c 65 2e 0a 23 0a 43 | 46 4c 41 47 53 09 3d 20 |ble..#.C|FLAGS.= |
|000012f0| 2d 67 0a 0a 70 77 74 65 | 73 74 3a 20 64 72 69 76 |-g..pwte|st: driv|
|00001300| 65 72 2e 6f 20 63 68 65 | 63 6b 70 61 73 73 77 64 |er.o che|ckpasswd|
|00001310| 2e 6f 0a 09 63 63 20 24 | 28 43 46 4c 41 47 53 29 |.o..cc $|(CFLAGS)|
|00001320| 20 2d 6f 20 70 77 74 65 | 73 74 20 64 72 69 76 65 | -o pwte|st drive|
|00001330| 72 2e 6f 20 63 68 65 63 | 6b 70 61 73 73 77 64 2e |r.o chec|kpasswd.|
|00001340| 6f 0a 0a 63 68 65 63 6b | 70 61 73 73 77 64 2e 6f |o..check|passwd.o|
|00001350| 3a 20 63 68 65 63 6b 70 | 61 73 73 77 64 2e 63 20 |: checkp|asswd.c |
|00001360| 63 68 65 63 6b 70 61 73 | 73 77 64 2e 68 0a 09 63 |checkpas|swd.h..c|
|00001370| 63 20 24 28 43 46 4c 41 | 47 53 29 20 2d 63 20 63 |c $(CFLA|GS) -c c|
|00001380| 68 65 63 6b 70 61 73 73 | 77 64 2e 63 0a 0a 6d 61 |heckpass|wd.c..ma|
|00001390| 6b 65 64 69 63 74 3a 20 | 6d 61 6b 65 64 69 63 74 |kedict: |makedict|
|000013a0| 2e 63 0a 09 63 63 20 24 | 28 43 46 4c 41 47 53 29 |.c..cc $|(CFLAGS)|
|000013b0| 20 2d 6f 20 6d 61 6b 65 | 64 69 63 74 20 6d 61 6b | -o make|dict mak|
|000013c0| 65 64 69 63 74 2e 63 0a | 0a 76 69 65 77 64 69 63 |edict.c.|.viewdic|
|000013d0| 74 3a 20 76 69 65 77 64 | 69 63 74 2e 63 0a 09 63 |t: viewd|ict.c..c|
|000013e0| 63 20 24 28 43 46 4c 41 | 47 53 29 20 2d 6f 20 76 |c $(CFLA|GS) -o v|
|000013f0| 69 65 77 64 69 63 74 20 | 76 69 65 77 64 69 63 74 |iewdict |viewdict|
|00001400| 2e 63 0a 0a 70 77 64 69 | 63 74 3a 09 77 6f 72 6d |.c..pwdi|ct:.worm|
|00001410| 6c 69 73 74 20 6d 61 6b | 65 64 69 63 74 0a 09 2d |list mak|edict..-|
|00001420| 72 6d 20 2d 66 20 70 77 | 64 69 63 74 0a 09 63 61 |rm -f pw|dict..ca|
|00001430| 74 20 2f 75 73 72 2f 64 | 69 63 74 2f 77 6f 72 64 |t /usr/d|ict/word|
|00001440| 73 20 77 6f 72 6d 6c 69 | 73 74 20 7c 20 6d 61 6b |s wormli|st | mak|
|00001450| 65 64 69 63 74 20 70 77 | 64 69 63 74 0a 09 40 65 |edict pw|dict..@e|
|00001460| 63 68 6f 20 69 6e 73 74 | 61 6c 6c 20 70 77 64 69 |cho inst|all pwdi|
|00001470| 63 74 20 74 6f 20 77 68 | 65 72 65 20 50 57 44 49 |ct to wh|ere PWDI|
|00001480| 43 54 20 70 6f 69 6e 74 | 73 20 74 6f 20 69 6e 20 |CT point|s to in |
|00001490| 63 68 65 63 6b 70 61 73 | 73 77 64 2e 63 0a 0a 0a |checkpas|swd.c...|
|000014a0| 49 20 61 6d 20 77 6f 72 | 6b 69 6e 67 20 6f 6e 20 |I am wor|king on |
|000014b0| 61 20 72 65 70 6c 61 63 | 65 6d 65 6e 74 20 66 6f |a replac|ement fo|
|000014c0| 72 20 74 68 65 20 42 53 | 44 20 70 61 73 73 77 64 |r the BS|D passwd|
|000014d0| 20 70 72 6f 67 72 61 6d | 2c 20 77 68 69 63 68 20 | program|, which |
|000014e0| 73 68 6f 75 6c 64 20 62 | 65 0a 61 76 61 69 6c 61 |should b|e.availa|
|000014f0| 62 6c 65 20 73 6f 6f 6e | 2e 0a 0a 43 6f 6e 74 65 |ble soon|...Conte|
|00001500| 6e 74 73 20 63 6f 70 79 | 72 69 67 68 74 20 31 39 |nts copy|right 19|
|00001510| 38 39 20 43 6c 79 64 65 | 20 57 2e 20 48 6f 6f 76 |89 Clyde| W. Hoov|
|00001520| 65 72 20 28 4d 6f 6f 73 | 65 20 26 20 53 71 75 69 |er (Moos|e & Squi|
|00001530| 72 72 65 6c 20 53 6f 66 | 74 77 61 72 65 2c 20 4e |rrel Sof|tware, N|
|00001540| 6f 74 49 6e 63 2e 29 0a | 0a 44 69 73 74 72 69 62 |otInc.).|.Distrib|
|00001550| 75 74 69 6f 6e 20 75 6e | 6c 69 6d 69 74 65 64 20 |ution un|limited |
|00001560| 70 72 6f 76 69 64 65 64 | 20 63 6f 70 79 72 69 67 |provided| copyrig|
|00001570| 68 74 20 6e 6f 74 69 63 | 65 20 69 73 20 72 65 74 |ht notic|e is ret|
|00001580| 61 69 6e 65 64 2e 0a 50 | 6c 65 61 73 65 20 73 70 |ained..P|lease sp|
|00001590| 72 65 61 64 20 74 68 69 | 73 20 61 72 6f 75 6e 64 |read thi|s around|
|000015a0| 20 61 73 20 6d 75 63 68 | 20 61 73 20 75 73 65 66 | as much| as usef|
|000015b0| 75 6c 2e 0a 0a 09 43 6c | 79 64 65 20 48 6f 6f 76 |ul....Cl|yde Hoov|
|000015c0| 65 72 0a 09 43 6f 6d 70 | 75 74 61 74 69 6f 6e 20 |er..Comp|utation |
|000015d0| 43 65 6e 74 65 72 0a 09 | 54 68 65 20 55 6e 69 76 |Center..|The Univ|
|000015e0| 65 72 73 69 74 79 20 6f | 66 20 54 65 78 61 73 20 |ersity o|f Texas |
|000015f0| 61 74 20 41 75 73 74 69 | 6e 0a 09 63 6c 79 64 65 |at Austi|n..clyde|
|00001600| 63 68 6b 70 77 64 2f 63 | 68 65 63 6b 70 61 73 73 |chkpwd/c|heckpass|
|00001610| 77 64 2e 68 00 00 00 00 | 00 00 00 00 00 00 00 00 |wd.h....|........|
|00001620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001670| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00001680| 20 20 20 32 35 36 37 20 | 20 34 34 32 36 31 30 36 | 2567 | 4426106|
|00001690| 36 32 32 20 20 31 30 30 | 34 36 00 20 00 00 00 00 |622 100|46. ....|
|000016a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000016f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001800| 2f 2a 0a 20 2a 09 70 61 | 73 73 77 64 63 68 65 63 |/*. *.pa|sswdchec|
|00001810| 6b 2e 68 0a 20 2a 0a 20 | 2a 20 20 20 20 20 20 43 |k.h. *. |* C|
|00001820| 6f 70 79 72 69 67 68 74 | 20 31 39 38 39 20 43 6c |opyright| 1989 Cl|
|00001830| 79 64 65 20 57 2e 20 48 | 6f 6f 76 65 72 20 28 4d |yde W. H|oover (M|
|00001840| 6f 6f 73 65 20 26 20 53 | 71 75 69 72 72 65 6c 20 |oose & S|quirrel |
|00001850| 53 6f 66 74 77 61 72 65 | 2c 20 4e 6f 74 49 6e 63 |Software|, NotInc|
|00001860| 2e 29 0a 20 2a 0a 20 2a | 2f 0a 0a 23 64 65 66 69 |.). *. *|/..#defi|
|00001870| 6e 65 09 45 58 50 4f 52 | 54 09 2f 2a 2a 2f 0a 23 |ne.EXPOR|T./**/.#|
|00001880| 64 65 66 69 6e 65 09 49 | 4d 50 4f 52 54 09 65 78 |define.I|MPORT.ex|
|00001890| 74 65 72 6e 0a 0a 23 64 | 65 66 69 6e 65 09 50 57 |tern..#d|efine.PW|
|000018a0| 43 4b 5f 46 41 49 4c 09 | 2d 31 0a 23 64 65 66 69 |CK_FAIL.|-1.#defi|
|000018b0| 6e 65 09 50 57 43 4b 5f | 4f 4b 09 09 30 0a 23 64 |ne.PWCK_|OK..0.#d|
|000018c0| 65 66 69 6e 65 09 50 57 | 43 4b 5f 4e 55 4c 4c 09 |efine.PW|CK_NULL.|
|000018d0| 31 0a 23 64 65 66 69 6e | 65 09 50 57 43 4b 5f 4f |1.#defin|e.PWCK_O|
|000018e0| 42 56 49 4f 55 53 09 32 | 0a 23 64 65 66 69 6e 65 |BVIOUS.2|.#define|
|000018f0| 09 50 57 43 4b 5f 46 49 | 4e 47 45 52 09 33 0a 23 |.PWCK_FI|NGER.3.#|
|00001900| 64 65 66 69 6e 65 09 50 | 57 43 4b 5f 49 4e 44 49 |define.P|WCK_INDI|
|00001910| 43 54 09 34 0a 23 64 65 | 66 69 6e 65 09 50 57 43 |CT.4.#de|fine.PWC|
|00001920| 4b 5f 49 4c 4c 43 48 41 | 52 09 35 0a 23 64 65 66 |K_ILLCHA|R.5.#def|
|00001930| 69 6e 65 09 50 57 43 4b | 5f 53 48 4f 52 54 09 36 |ine.PWCK|_SHORT.6|
|00001940| 0a 0a 2f 2a 0a 20 2a 09 | 52 65 74 75 72 6e 20 63 |../*. *.|Return c|
|00001950| 6f 64 65 73 20 66 6f 72 | 20 63 68 65 63 6b 70 61 |odes for| checkpa|
|00001960| 73 73 77 6f 72 64 28 29 | 20 61 72 65 3a 0a 20 2a |ssword()| are:. *|
|00001970| 0a 20 2a 09 50 57 43 4b | 5f 4f 4b 20 69 66 20 3c |. *.PWCK|_OK if <|
|00001980| 70 61 73 73 77 6f 72 64 | 3e 20 69 73 20 6f 6b 20 |password|> is ok |
|00001990| 74 6f 20 75 73 65 0a 20 | 2a 09 50 57 43 4b 5f 46 |to use. |*.PWCK_F|
|000019a0| 41 49 4c 20 69 66 20 73 | 6f 6d 65 74 68 69 6e 67 |AIL if s|omething|
|000019b0| 20 66 61 69 6c 65 64 20 | 64 75 72 69 6e 67 20 74 | failed |during t|
|000019c0| 68 65 20 63 68 65 63 6b | 20 70 72 6f 63 65 73 73 |he check| process|
|000019d0| 0a 20 2a 09 50 57 43 4b | 5f 4e 55 4c 4c 20 69 66 |. *.PWCK|_NULL if|
|000019e0| 20 3c 70 61 73 73 77 6f | 72 64 3e 20 69 73 20 74 | <passwo|rd> is t|
|000019f0| 68 65 20 6e 75 6c 6c 20 | 73 74 72 69 6e 67 0a 20 |he null |string. |
|00001a00| 2a 09 50 57 43 4b 5f 4f | 42 56 49 4f 55 53 20 69 |*.PWCK_O|BVIOUS i|
|00001a10| 66 20 3c 70 61 73 73 77 | 6f 72 64 3e 20 69 73 20 |f <passw|ord> is |
|00001a20| 74 6f 6f 20 22 6f 62 76 | 69 6f 75 73 22 0a 20 2a |too "obv|ious". *|
|00001a30| 09 09 28 65 71 75 61 6c | 73 20 6c 6f 67 69 6e 20 |..(equal|s login |
|00001a40| 6e 61 6d 65 2c 20 68 6f | 73 74 20 6e 61 6d 65 2c |name, ho|st name,|
|00001a50| 20 27 7a 7a 7a 7a 27 20 | 29 0a 20 2a 09 50 57 43 | 'zzzz' |). *.PWC|
|00001a60| 4b 5f 46 49 4e 47 45 52 | 20 69 66 20 3c 70 61 73 |K_FINGER| if <pas|
|00001a70| 73 77 6f 72 64 3e 20 69 | 73 20 69 6e 20 74 68 65 |sword> i|s in the|
|00001a80| 20 75 73 65 72 73 27 20 | 70 61 73 73 77 64 2f 66 | users' |passwd/f|
|00001a90| 69 6e 67 65 72 20 69 6e | 66 6f 0a 20 2a 09 50 57 |inger in|fo. *.PW|
|00001aa0| 43 4b 5f 49 4e 44 49 43 | 54 20 69 66 20 3c 70 61 |CK_INDIC|T if <pa|
|00001ab0| 73 73 77 6f 72 64 3e 20 | 69 73 20 69 6e 20 74 68 |ssword> |is in th|
|00001ac0| 65 20 64 69 63 74 69 6f | 6e 61 72 69 65 73 20 63 |e dictio|naries c|
|00001ad0| 68 65 63 6b 65 64 0a 20 | 2a 09 50 57 43 4b 5f 49 |hecked. |*.PWCK_I|
|00001ae0| 4c 4c 43 48 41 52 20 69 | 66 20 3c 70 61 73 73 77 |LLCHAR i|f <passw|
|00001af0| 6f 72 64 3e 20 69 73 20 | 6c 65 78 69 63 61 6c 6c |ord> is |lexicall|
|00001b00| 79 20 69 6c 6c 65 67 61 | 6c 0a 20 2a 09 50 57 43 |y illega|l. *.PWC|
|00001b10| 4b 5f 53 48 4f 52 54 20 | 69 66 20 3c 70 61 73 73 |K_SHORT |if <pass|
|00001b20| 77 6f 72 64 3e 20 69 73 | 20 74 6f 6f 20 73 68 6f |word> is| too sho|
|00001b30| 72 74 0a 20 2a 2f 0a 0a | 2f 2a 0a 20 2a 09 50 61 |rt. */..|/*. *.Pa|
|00001b40| 73 73 77 6f 72 64 20 63 | 68 65 63 6b 69 6e 67 20 |ssword c|hecking |
|00001b50| 70 65 66 65 72 65 6e 63 | 65 20 62 6c 6f 63 6b 0a |peferenc|e block.|
|00001b60| 20 2a 2f 0a 73 74 72 75 | 63 74 20 70 77 63 6b 5f | */.stru|ct pwck_|
|00001b70| 70 72 65 66 65 72 65 6e | 63 65 73 20 7b 0a 09 63 |preferen|ces {..c|
|00001b80| 68 61 72 09 4f 6e 65 43 | 61 73 65 4f 6b 2c 09 2f |har.OneC|aseOk,./|
|00001b90| 2a 20 41 72 65 20 73 69 | 6e 67 6c 65 2d 63 61 73 |* Are si|ngle-cas|
|00001ba0| 65 20 70 77 64 73 20 61 | 63 63 65 70 74 61 62 6c |e pwds a|cceptabl|
|00001bb0| 65 20 2a 2f 0a 09 09 43 | 74 72 6c 4f 6b 2c 09 09 |e */...C|trlOk,..|
|00001bc0| 2f 2a 20 41 72 65 20 63 | 6f 6e 74 72 6f 6c 20 63 |/* Are c|ontrol c|
|00001bd0| 68 61 72 61 63 74 65 72 | 73 20 61 63 63 65 70 74 |haracter|s accept|
|00001be0| 61 62 6c 65 20 2a 2f 0a | 09 09 43 68 61 72 52 75 |able */.|..CharRu|
|00001bf0| 6e 4c 65 6e 2c 09 2f 2a | 20 48 6f 77 20 6c 6f 6e |nLen,./*| How lon|
|00001c00| 67 20 63 61 6e 20 72 75 | 6e 20 6f 66 20 63 68 61 |g can ru|n of cha|
|00001c10| 72 61 63 74 65 72 73 20 | 62 65 20 20 2a 2f 0a 09 |racters |be */..|
|00001c20| 09 4d 69 6e 50 77 4c 65 | 6e 3b 09 2f 2a 20 4d 69 |.MinPwLe|n;./* Mi|
|00001c30| 6e 69 6d 75 6d 20 70 61 | 73 73 77 6f 72 64 20 6c |nimum pa|ssword l|
|00001c40| 65 6e 67 74 68 20 2a 2f | 0a 09 63 68 61 72 09 2a |ength */|..char.*|
|00001c50| 45 67 72 65 70 50 61 74 | 68 3b 09 2f 2a 20 50 61 |EgrepPat|h;./* Pa|
|00001c60| 74 68 20 74 6f 20 74 68 | 65 20 27 65 67 72 65 70 |th to th|e 'egrep|
|00001c70| 27 20 70 72 6f 67 72 61 | 6d 20 2a 2f 0a 7d 3b 0a |' progra|m */.};.|
|00001c80| 0a 2f 2a 0a 20 2a 09 50 | 72 65 66 65 72 65 6e 63 |./*. *.P|referenc|
|00001c90| 65 20 6c 69 73 74 0a 20 | 2a 2f 0a 49 4d 50 4f 52 |e list. |*/.IMPOR|
|00001ca0| 54 20 73 74 72 75 63 74 | 20 70 77 63 6b 5f 70 72 |T struct| pwck_pr|
|00001cb0| 65 66 65 72 65 6e 63 65 | 73 09 70 77 63 6b 5f 70 |eference|s.pwck_p|
|00001cc0| 72 65 66 65 72 65 6e 63 | 65 73 3b 0a 0a 2f 2a 0a |referenc|es;../*.|
|00001cd0| 20 2a 09 4c 69 73 74 20 | 6f 66 20 63 6f 6e 74 72 | *.List |of contr|
|00001ce0| 6f 6c 20 63 68 61 72 61 | 63 74 65 72 73 20 6e 6f |ol chara|cters no|
|00001cf0| 74 20 61 6c 6c 6f 77 65 | 64 20 69 6e 20 70 61 73 |t allowe|d in pas|
|00001d00| 73 77 6f 72 64 73 0a 20 | 2a 2f 0a 49 4d 50 4f 52 |swords. |*/.IMPOR|
|00001d10| 54 20 63 68 61 72 09 09 | 70 77 63 6b 5f 69 6c 6c |T char..|pwck_ill|
|00001d20| 65 67 61 6c 63 63 5b 5d | 3b 0a 0a 2f 2a 0a 20 2a |egalcc[]|;../*. *|
|00001d30| 09 4c 69 73 74 20 6f 66 | 20 64 69 63 74 69 6f 6e |.List of| diction|
|00001d40| 61 72 69 65 73 20 74 6f | 20 63 68 65 63 6b 0a 20 |aries to| check. |
|00001d50| 2a 2f 0a 49 4d 50 4f 52 | 54 20 63 68 61 72 09 09 |*/.IMPOR|T char..|
|00001d60| 2a 70 77 63 6b 5f 64 69 | 63 69 74 6f 6e 61 72 69 |*pwck_di|citonari|
|00001d70| 65 73 5b 5d 3b 0a 0a 00 | 00 00 00 00 00 00 00 00 |es[];...|........|
|00001d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e00| 63 68 6b 70 77 64 2f 63 | 68 65 63 6b 70 61 73 73 |chkpwd/c|heckpass|
|00001e10| 77 64 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |wd.c....|........|
|00001e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00001e70| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00001e80| 20 20 33 32 33 35 36 20 | 20 34 34 32 36 31 30 36 | 32356 | 4426106|
|00001e90| 36 32 33 20 20 31 30 30 | 36 31 00 20 00 00 00 00 |623 100|61. ....|
|00001ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002000| 2f 2a 0a 20 2a 09 63 68 | 65 63 6b 70 61 73 73 77 |/*. *.ch|eckpassw|
|00002010| 64 2e 63 20 2d 20 4c 6f | 67 69 6e 20 70 61 73 73 |d.c - Lo|gin pass|
|00002020| 77 6f 72 64 20 63 68 65 | 63 6b 20 72 6f 75 74 69 |word che|ck routi|
|00002030| 6e 65 73 2e 0a 20 2a 0a | 20 2a 09 50 65 72 66 6f |nes.. *.| *.Perfo|
|00002040| 72 6d 20 76 61 72 69 6f | 75 73 20 73 61 6e 69 74 |rm vario|us sanit|
|00002050| 79 20 61 6e 64 20 73 65 | 63 75 72 69 74 79 20 63 |y and se|curity c|
|00002060| 68 65 63 6b 73 20 6f 6e | 20 61 20 70 61 73 73 77 |hecks on| a passw|
|00002070| 6f 72 64 20 63 61 6e 64 | 69 64 61 74 65 2e 0a 20 |ord cand|idate.. |
|00002080| 2a 0a 20 2a 09 57 72 69 | 74 74 65 6e 20 44 65 63 |*. *.Wri|tten Dec|
|00002090| 65 6d 62 65 72 2c 20 31 | 39 38 38 0a 20 2a 0a 20 |ember, 1|988. *. |
|000020a0| 2a 09 43 6f 70 79 72 69 | 67 68 74 20 31 39 38 39 |*.Copyri|ght 1989|
|000020b0| 20 43 6c 79 64 65 20 57 | 2e 20 48 6f 6f 76 65 72 | Clyde W|. Hoover|
|000020c0| 20 28 4d 6f 6f 73 65 20 | 26 20 53 71 75 69 72 72 | (Moose |& Squirr|
|000020d0| 65 6c 20 53 6f 66 74 77 | 61 72 65 2c 20 4e 6f 74 |el Softw|are, Not|
|000020e0| 49 6e 63 2e 29 0a 20 2a | 0a 20 2a 09 09 43 6c 79 |Inc.). *|. *..Cly|
|000020f0| 64 65 20 48 6f 6f 76 65 | 72 0a 20 2a 09 09 43 6f |de Hoove|r. *..Co|
|00002100| 6d 70 75 74 61 74 69 6f | 6e 20 43 65 6e 74 65 72 |mputatio|n Center|
|00002110| 0a 20 2a 09 09 54 68 65 | 20 55 6e 69 76 65 72 73 |. *..The| Univers|
|00002120| 69 74 79 20 6f 66 20 54 | 65 78 61 73 20 61 74 20 |ity of T|exas at |
|00002130| 41 75 73 74 69 6e 0a 20 | 2a 09 09 41 75 73 74 69 |Austin. |*..Austi|
|00002140| 6e 2c 20 54 65 78 61 73 | 0a 20 2a 09 09 63 6c 79 |n, Texas|. *..cly|
|00002150| 64 65 40 65 6d 78 2e 75 | 74 65 78 61 73 2e 65 64 |de@emx.u|texas.ed|
|00002160| 75 0a 20 2a 2f 0a 0a 23 | 69 66 6e 64 65 66 20 6c |u. */..#|ifndef l|
|00002170| 69 6e 74 0a 73 74 61 74 | 69 63 20 63 68 61 72 20 |int.stat|ic char |
|00002180| 73 63 63 73 69 64 5b 5d | 20 3d 20 22 25 57 25 20 |sccsid[]| = "%W% |
|00002190| 25 47 25 20 28 63 63 2e | 75 74 65 78 61 73 2e 65 |%G% (cc.|utexas.e|
|000021a0| 64 75 29 20 25 50 25 22 | 3b 0a 23 65 6e 64 69 66 |du) %P%"|;.#endif|
|000021b0| 0a 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |..#inclu|de <sys/|
|000021c0| 74 79 70 65 73 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |types.h>|.#includ|
|000021d0| 65 20 3c 73 74 72 69 6e | 67 73 2e 68 3e 0a 23 69 |e <strin|gs.h>.#i|
|000021e0| 6e 63 6c 75 64 65 20 3c | 63 74 79 70 65 2e 68 3e |nclude <|ctype.h>|
|000021f0| 0a 0a 23 64 65 66 69 6e | 65 09 4c 4f 43 41 4c 09 |..#defin|e.LOCAL.|
|00002200| 73 74 61 74 69 63 0a 0a | 23 69 6e 63 6c 75 64 65 |static..|#include|
|00002210| 20 22 63 68 65 63 6b 70 | 61 73 73 77 64 2e 68 22 | "checkp|asswd.h"|
|00002220| 0a 0a 2f 2a 0a 20 2a 09 | 53 70 65 63 69 61 6c 20 |../*. *.|Special |
|00002230| 73 74 72 69 6e 67 20 63 | 6f 6d 70 61 72 65 20 64 |string c|ompare d|
|00002240| 65 66 69 6e 65 73 2e 0a | 20 2a 2f 0a 23 64 65 66 |efines..| */.#def|
|00002250| 69 6e 65 09 74 72 79 28 | 50 2c 43 2c 56 29 09 7b |ine.try(|P,C,V).{|
|00002260| 20 69 66 20 28 63 69 73 | 74 72 63 6d 70 28 50 2c | if (cis|trcmp(P,|
|00002270| 43 29 20 3d 3d 20 30 29 | 20 72 65 74 75 72 6e 28 |C) == 0)| return(|
|00002280| 56 29 3b 20 7d 0a 23 64 | 65 66 69 6e 65 09 6d 74 |V); }.#d|efine.mt|
|00002290| 72 79 28 50 2c 43 2c 56 | 29 09 7b 20 69 6e 74 20 |ry(P,C,V|).{ int |
|000022a0| 69 3b 20 69 66 20 28 28 | 69 20 3d 20 53 74 72 41 |i; if ((|i = StrA|
|000022b0| 6c 6c 43 6d 70 28 50 2c | 43 2c 56 29 29 20 21 3d |llCmp(P,|C,V)) !=|
|000022c0| 20 50 57 43 4b 5f 4f 4b | 29 20 72 65 74 75 72 6e | PWCK_OK|) return|
|000022d0| 28 69 29 3b 20 7d 0a 0a | 2f 2a 0a 20 2a 09 54 61 |(i); }..|/*. *.Ta|
|000022e0| 62 6c 65 20 6f 66 20 6f | 70 65 72 61 74 69 6f 6e |ble of o|peration|
|000022f0| 61 6c 20 70 61 72 61 6d | 65 74 65 72 20 70 72 65 |al param|eter pre|
|00002300| 66 65 72 65 6e 63 65 73 | 2e 0a 20 2a 09 4d 61 79 |ferences|.. *.May|
|00002310| 20 62 65 20 6d 6f 64 69 | 66 69 65 64 20 62 79 20 | be modi|fied by |
|00002320| 74 68 65 20 63 61 6c 6c | 65 72 2e 0a 20 2a 2f 0a |the call|er.. */.|
|00002330| 45 58 50 4f 52 54 0a 73 | 74 72 75 63 74 20 70 77 |EXPORT.s|truct pw|
|00002340| 63 6b 5f 70 72 65 66 65 | 72 65 6e 63 65 73 09 70 |ck_prefe|rences.p|
|00002350| 77 63 6b 5f 70 72 65 66 | 65 72 65 6e 63 65 73 20 |wck_pref|erences |
|00002360| 3d 20 7b 0a 09 31 2c 09 | 09 2f 2a 20 73 69 6e 67 |= {..1,.|./* sing|
|00002370| 6c 65 2d 63 61 73 65 20 | 70 77 64 73 20 6f 6b 20 |le-case |pwds ok |
|00002380| 2a 2f 0a 09 31 2c 09 09 | 2f 2a 20 63 6f 6e 74 72 |*/..1,..|/* contr|
|00002390| 6f 6c 20 63 68 61 72 73 | 20 6f 6b 20 2a 2f 0a 09 |ol chars| ok */..|
|000023a0| 33 2c 09 09 2f 2a 20 64 | 75 70 20 6c 65 6e 67 74 |3,../* d|up lengt|
|000023b0| 68 20 3d 20 33 20 2a 2f | 0a 09 34 2c 09 09 2f 2a |h = 3 */|..4,../*|
|000023c0| 20 6d 69 6e 69 6d 75 6d | 20 6c 65 6e 67 74 68 20 | minimum| length |
|000023d0| 2a 2f 0a 09 22 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |*/.."PAT|H=/bin:/|
|000023e0| 75 73 72 2f 62 69 6e 3a | 2f 75 73 72 2f 75 63 62 |usr/bin:|/usr/ucb|
|000023f0| 3b 20 65 67 72 65 70 22 | 09 2f 2a 20 48 6f 77 20 |; egrep"|./* How |
|00002400| 74 6f 20 66 69 6e 64 20 | 65 67 72 65 70 20 2a 2f |to find |egrep */|
|00002410| 0a 7d 3b 0a 0a 2f 2a 0a | 20 2a 09 54 61 62 6c 65 |.};../*.| *.Table|
|00002420| 20 6f 66 20 63 6f 6e 74 | 72 6f 6c 20 63 68 61 72 | of cont|rol char|
|00002430| 73 20 62 65 73 74 20 61 | 76 6f 69 64 65 64 20 2d |s best a|voided -|
|00002440| 0a 20 2a 09 6d 6f 73 74 | 6c 79 20 63 6f 6d 6d 6f |. *.most|ly commo|
|00002450| 6e 6c 79 2d 75 73 65 64 | 20 74 65 72 6d 69 6e 61 |nly-used| termina|
|00002460| 6c 20 73 70 65 63 69 61 | 6c 20 63 68 61 72 73 2e |l specia|l chars.|
|00002470| 0a 20 2a 09 4d 61 79 20 | 62 65 20 6d 6f 64 69 66 |. *.May |be modif|
|00002480| 69 65 64 20 62 79 20 74 | 68 65 20 63 61 6c 6c 65 |ied by t|he calle|
|00002490| 72 2e 0a 20 2a 2f 0a 23 | 64 65 66 69 6e 65 09 63 |r.. */.#|define.c|
|000024a0| 74 72 6c 28 64 29 09 28 | 27 64 27 20 26 20 30 33 |trl(d).(|'d' & 03|
|000024b0| 37 29 0a 0a 45 58 50 4f | 52 54 0a 63 68 61 72 09 |7)..EXPO|RT.char.|
|000024c0| 70 77 63 6b 5f 69 6c 6c | 65 67 61 6c 63 63 5b 31 |pwck_ill|egalcc[1|
|000024d0| 32 38 5d 20 3d 20 7b 0a | 09 63 74 72 6c 28 63 29 |28] = {.|.ctrl(c)|
|000024e0| 2c 20 63 74 72 6c 28 64 | 29 2c 20 63 74 72 6c 28 |, ctrl(d|), ctrl(|
|000024f0| 68 29 2c 20 2f 2a 20 63 | 74 72 6c 28 69 29 2c 2a |h), /* c|trl(i),*|
|00002500| 2f 20 20 63 74 72 6c 28 | 6a 29 2c 20 63 74 72 6c |/ ctrl(|j), ctrl|
|00002510| 28 6d 29 2c 0a 09 63 74 | 72 6c 28 6f 29 2c 20 63 |(m),..ct|rl(o), c|
|00002520| 74 72 6c 28 72 29 2c 20 | 63 74 72 6c 28 73 29 2c |trl(r), |ctrl(s),|
|00002530| 20 63 74 72 6c 28 71 29 | 2c 20 63 74 72 6c 28 7a | ctrl(q)|, ctrl(z|
|00002540| 29 2c 20 63 74 72 6c 28 | 5c 5c 29 2c 0a 09 63 74 |), ctrl(|\\),..ct|
|00002550| 72 6c 28 5b 29 2c 09 2f | 2a 20 65 73 63 61 70 65 |rl([),./|* escape|
|00002560| 20 2a 2f 0a 09 27 5c 30 | 31 37 37 27 2c 09 2f 2a | */..'\0|177',./*|
|00002570| 20 72 75 62 6f 75 74 20 | 2a 2f 0a 09 30 0a 7d 3b | rubout |*/..0.};|
|00002580| 0a 0a 23 64 65 66 69 6e | 65 09 50 57 44 49 43 54 |..#defin|e.PWDICT|
|00002590| 09 09 22 2f 75 73 72 2f | 64 69 63 74 2f 70 77 77 |.."/usr/|dict/pww|
|000025a0| 6f 72 64 73 22 0a 2f 2a | 0a 20 2a 09 4c 69 73 74 |ords"./*|. *.List|
|000025b0| 20 6f 66 20 66 6f 72 62 | 69 64 64 65 6e 20 70 61 | of forb|idden pa|
|000025c0| 73 73 77 6f 72 64 20 64 | 69 63 74 69 6f 6e 61 72 |ssword d|ictionar|
|000025d0| 69 65 73 20 74 6f 20 6c | 6f 6f 6b 20 69 6e 2e 0a |ies to l|ook in..|
|000025e0| 20 2a 09 4d 61 79 20 62 | 65 20 6d 6f 64 69 66 69 | *.May b|e modifi|
|000025f0| 65 64 20 62 79 20 74 68 | 65 20 63 61 6c 6c 65 72 |ed by th|e caller|
|00002600| 2e 0a 20 2a 2f 0a 73 74 | 61 74 69 63 20 63 68 61 |.. */.st|atic cha|
|00002610| 72 09 2a 70 77 63 6b 5f | 64 69 63 69 74 6f 6e 61 |r.*pwck_|dicitona|
|00002620| 72 69 65 73 5b 31 36 5d | 20 3d 20 7b 0a 09 50 57 |ries[16]| = {..PW|
|00002630| 44 49 43 54 2c 09 09 09 | 2f 2a 20 69 6c 6c 65 67 |DICT,...|/* illeg|
|00002640| 61 6c 20 70 61 73 73 77 | 6f 72 64 73 20 6c 69 73 |al passw|ords lis|
|00002650| 74 20 2a 2f 0a 09 30 0a | 7d 3b 0a 0a 2f 2a 0a 20 |t */..0.|};../*. |
|00002660| 2a 09 54 68 65 20 27 70 | 77 63 6b 5f 2a 27 20 72 |*.The 'p|wck_*' r|
|00002670| 6f 75 74 69 6e 65 73 20 | 61 6c 6c 20 75 73 65 20 |outines |all use |
|00002680| 74 68 65 20 50 57 43 4b | 5f 2a 20 72 65 74 75 72 |the PWCK|_* retur|
|00002690| 6e 0a 20 2a 09 63 6f 64 | 65 73 2c 20 77 68 69 63 |n. *.cod|es, whic|
|000026a0| 68 20 61 72 65 20 74 68 | 65 6e 20 70 72 6f 70 69 |h are th|en propi|
|000026b0| 67 61 74 65 64 20 75 70 | 20 74 6f 20 74 68 65 20 |gated up| to the |
|000026c0| 63 61 6c 6c 65 72 20 6f | 66 20 63 68 65 63 6b 70 |caller o|f checkp|
|000026d0| 61 73 73 77 6f 72 64 28 | 29 2e 0a 20 2a 0a 20 2a |assword(|).. *. *|
|000026e0| 09 41 6c 6c 20 70 77 63 | 6b 5f 2a 20 72 6f 75 74 |.All pwc|k_* rout|
|000026f0| 69 6e 65 73 20 69 6e 20 | 74 68 65 20 74 61 62 6c |ines in |the tabl|
|00002700| 65 20 62 65 6c 6f 77 20 | 61 72 65 20 63 61 6c 6c |e below |are call|
|00002710| 65 64 20 74 68 75 73 6c | 79 3a 0a 20 2a 09 09 70 |ed thusl|y:. *..p|
|00002720| 77 63 6b 5f 2a 28 70 61 | 73 73 77 6f 72 64 2c 20 |wck_*(pa|ssword, |
|00002730| 75 73 65 72 69 64 29 0a | 20 2a 09 09 09 70 61 73 |userid).| *...pas|
|00002740| 73 77 6f 72 64 20 3d 20 | 70 6c 61 69 6e 74 65 78 |sword = |plaintex|
|00002750| 74 20 70 61 73 73 77 6f | 72 64 20 73 74 72 69 6e |t passwo|rd strin|
|00002760| 67 20 74 6f 20 74 65 73 | 74 2e 0a 20 2a 09 09 09 |g to tes|t.. *...|
|00002770| 75 73 65 72 69 64 20 3d | 20 74 68 65 20 75 73 65 |userid =| the use|
|00002780| 72 20 69 64 20 77 68 69 | 63 68 20 77 61 6e 74 73 |r id whi|ch wants|
|00002790| 20 74 6f 20 75 73 65 20 | 3c 70 61 73 73 77 6f 72 | to use |<passwor|
|000027a0| 64 3e 2e 0a 20 2a 0a 20 | 2a 09 54 61 62 6c 65 20 |d>.. *. |*.Table |
|000027b0| 6f 66 20 63 68 65 63 6b | 20 66 75 6e 63 74 69 6f |of check| functio|
|000027c0| 6e 73 20 74 6f 20 62 65 | 20 63 61 6c 6c 65 64 20 |ns to be| called |
|000027d0| 62 79 20 63 68 65 63 6b | 70 61 73 73 77 6f 72 64 |by check|password|
|000027e0| 28 29 0a 20 2a 2f 0a 69 | 6e 74 09 70 77 63 6b 5f |(). */.i|nt.pwck_|
|000027f0| 6c 65 78 69 63 61 6c 28 | 29 2c 20 70 77 63 6b 5f |lexical(|), pwck_|
|00002800| 6c 6f 63 61 6c 28 29 2c | 20 70 77 63 6b 5f 70 61 |local(),| pwck_pa|
|00002810| 73 73 77 64 28 29 2c 20 | 70 77 63 6b 5f 64 69 63 |sswd(), |pwck_dic|
|00002820| 74 69 6f 6e 61 72 79 28 | 29 3b 0a 0a 74 79 70 65 |tionary(|);..type|
|00002830| 64 65 66 09 69 6e 74 09 | 28 2a 66 75 6e 63 74 69 |def.int.|(*functi|
|00002840| 6f 6e 29 28 29 3b 0a 0a | 4c 4f 43 41 4c 0a 66 75 |on)();..|LOCAL.fu|
|00002850| 6e 63 74 69 6f 6e 20 70 | 77 63 6b 5f 76 65 63 74 |nction p|wck_vect|
|00002860| 6f 72 5b 5d 20 3d 20 7b | 0a 09 70 77 63 6b 5f 6c |or[] = {|..pwck_l|
|00002870| 65 78 69 63 61 6c 2c 0a | 09 70 77 63 6b 5f 6c 6f |exical,.|.pwck_lo|
|00002880| 63 61 6c 2c 0a 09 70 77 | 63 6b 5f 70 61 73 73 77 |cal,..pw|ck_passw|
|00002890| 64 2c 0a 09 70 77 63 6b | 5f 64 69 63 74 69 6f 6e |d,..pwck|_diction|
|000028a0| 61 72 79 2c 0a 09 30 0a | 7d 3b 0a 0a 2f 2a 20 2d |ary,..0.|};../* -|
|000028b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000028c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000028d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000028e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000028f0| 2d 2d 20 2a 2f 0a 0a 2f | 2a 0a 20 2a 09 63 68 65 |-- */../|*. *.che|
|00002900| 63 6b 70 61 73 73 77 6f | 72 64 20 2d 20 50 61 73 |ckpasswo|rd - Pas|
|00002910| 73 77 6f 72 64 20 63 61 | 6e 64 69 64 61 74 65 20 |sword ca|ndidate |
|00002920| 73 61 6e 69 74 79 20 63 | 68 65 63 6b 65 72 2e 0a |sanity c|hecker..|
|00002930| 20 2a 0a 20 2a 09 41 72 | 67 75 6d 65 6e 74 73 3b | *. *.Ar|guments;|
|00002940| 0a 20 2a 09 09 70 61 73 | 73 77 6f 72 64 20 3d 20 |. *..pas|sword = |
|00002950| 70 6c 61 69 6e 20 74 65 | 78 74 20 70 61 73 73 77 |plain te|xt passw|
|00002960| 6f 72 64 20 73 74 72 69 | 6e 67 20 74 6f 20 63 68 |ord stri|ng to ch|
|00002970| 65 63 6b 2e 0a 20 2a 09 | 09 75 73 65 72 69 64 20 |eck.. *.|.userid |
|00002980| 3d 20 74 68 65 20 75 69 | 64 20 77 68 6f 6d 20 74 |= the ui|d whom t|
|00002990| 68 65 20 70 61 73 73 77 | 6f 72 64 20 69 73 20 66 |he passw|ord is f|
|000029a0| 6f 72 2c 20 2d 31 20 74 | 6f 20 64 69 73 61 62 6c |or, -1 t|o disabl|
|000029b0| 65 2e 0a 20 2a 0a 20 2a | 09 52 65 74 75 72 6e 73 |e.. *. *|.Returns|
|000029c0| 3a 0a 20 2a 09 09 50 57 | 43 4b 5f 4f 4b 20 69 66 |:. *..PW|CK_OK if|
|000029d0| 20 3c 70 61 73 73 77 6f | 72 64 3e 20 69 73 20 6f | <passwo|rd> is o|
|000029e0| 6b 20 74 6f 20 75 73 65 | 2e 0a 20 2a 09 09 50 57 |k to use|.. *..PW|
|000029f0| 43 4b 5f 46 41 49 4c 20 | 69 66 20 73 6f 6d 65 74 |CK_FAIL |if somet|
|00002a00| 68 69 6e 67 20 66 61 69 | 6c 65 64 20 64 75 72 69 |hing fai|led duri|
|00002a10| 6e 67 20 74 68 65 20 63 | 68 65 63 6b 20 70 72 6f |ng the c|heck pro|
|00002a20| 63 65 73 73 2e 0a 20 2a | 09 09 50 57 43 4b 5f 4e |cess.. *|..PWCK_N|
|00002a30| 55 4c 4c 20 69 66 20 3c | 70 61 73 73 77 6f 72 64 |ULL if <|password|
|00002a40| 3e 20 69 73 20 74 68 65 | 20 6e 75 6c 6c 20 73 74 |> is the| null st|
|00002a50| 72 69 6e 67 0a 20 2a 09 | 09 50 57 43 4b 5f 4f 42 |ring. *.|.PWCK_OB|
|00002a60| 56 49 4f 55 53 20 69 66 | 20 3c 70 61 73 73 77 6f |VIOUS if| <passwo|
|00002a70| 72 64 3e 20 69 73 20 74 | 6f 6f 20 22 6f 62 76 69 |rd> is t|oo "obvi|
|00002a80| 6f 75 73 22 2e 0a 20 2a | 09 09 09 28 65 71 75 61 |ous".. *|...(equa|
|00002a90| 6c 73 20 6c 6f 67 69 6e | 20 6e 61 6d 65 2c 20 68 |ls login| name, h|
|00002aa0| 6f 73 74 20 6e 61 6d 65 | 2c 20 27 7a 7a 7a 7a 27 |ost name|, 'zzzz'|
|00002ab0| 20 29 2e 0a 20 2a 09 09 | 50 57 43 4b 5f 46 49 4e | ).. *..|PWCK_FIN|
|00002ac0| 47 45 52 20 69 66 20 3c | 70 61 73 73 77 6f 72 64 |GER if <|password|
|00002ad0| 3e 20 69 73 20 69 6e 20 | 74 68 65 20 75 73 65 72 |> is in |the user|
|00002ae0| 73 27 20 70 61 73 73 77 | 64 2f 66 69 6e 67 65 72 |s' passw|d/finger|
|00002af0| 20 69 6e 66 6f 2e 0a 20 | 2a 09 09 50 57 43 4b 5f | info.. |*..PWCK_|
|00002b00| 49 4e 44 49 43 54 20 69 | 66 20 3c 70 61 73 73 77 |INDICT i|f <passw|
|00002b10| 6f 72 64 3e 20 69 73 20 | 69 6e 20 74 68 65 20 64 |ord> is |in the d|
|00002b20| 69 63 74 69 6f 6e 61 72 | 69 65 73 20 63 68 65 63 |ictionar|ies chec|
|00002b30| 6b 65 64 2e 0a 20 2a 09 | 09 50 57 43 4b 5f 49 4c |ked.. *.|.PWCK_IL|
|00002b40| 4c 43 48 41 52 20 69 66 | 20 3c 70 61 73 73 77 6f |LCHAR if| <passwo|
|00002b50| 72 64 3e 20 69 73 20 6c | 65 78 69 63 61 6c 6c 79 |rd> is l|exically|
|00002b60| 20 69 6c 6c 65 67 61 6c | 2e 0a 20 2a 09 09 50 57 | illegal|.. *..PW|
|00002b70| 43 4b 5f 53 48 4f 52 54 | 20 69 66 20 3c 70 61 73 |CK_SHORT| if <pas|
|00002b80| 73 77 6f 72 64 3e 20 69 | 73 20 74 6f 6f 20 73 68 |sword> i|s too sh|
|00002b90| 6f 72 74 2e 0a 20 2a 0a | 20 2a 2f 0a 63 68 65 63 |ort.. *.| */.chec|
|00002ba0| 6b 70 61 73 73 77 6f 72 | 64 28 70 61 73 73 77 6f |kpasswor|d(passwo|
|00002bb0| 72 64 2c 20 75 73 65 72 | 69 64 29 0a 63 68 61 72 |rd, user|id).char|
|00002bc0| 09 2a 70 61 73 73 77 6f | 72 64 3b 09 09 2f 2a 20 |.*passwo|rd;../* |
|00002bd0| 50 6c 61 69 6e 74 65 78 | 74 20 6f 66 20 70 61 73 |Plaintex|t of pas|
|00002be0| 73 77 6f 72 64 20 74 6f | 20 63 68 65 63 6b 20 2a |sword to| check *|
|00002bf0| 2f 0a 69 6e 74 09 75 73 | 65 72 69 64 3b 09 09 09 |/.int.us|erid;...|
|00002c00| 2f 2a 20 54 68 65 20 75 | 73 65 72 20 74 68 69 73 |/* The u|ser this|
|00002c10| 20 69 73 20 66 6f 72 20 | 2a 2f 0a 7b 0a 09 69 6e | is for |*/.{..in|
|00002c20| 74 09 09 72 63 6f 64 65 | 3b 09 09 2f 2a 20 47 65 |t..rcode|;../* Ge|
|00002c30| 6e 65 72 61 6c 20 70 75 | 72 70 6f 73 65 20 73 63 |neral pu|rpose sc|
|00002c40| 72 61 74 63 68 20 2a 2f | 0a 09 66 75 6e 63 74 69 |ratch */|..functi|
|00002c50| 6f 6e 09 2a 63 68 65 63 | 6b 66 75 6e 63 3b 09 2f |on.*chec|kfunc;./|
|00002c60| 2a 20 43 68 65 63 6b 20 | 66 75 6e 63 74 69 6f 6e |* Check |function|
|00002c70| 20 70 6f 69 6e 74 65 72 | 20 2a 2f 0a 0a 09 69 66 | pointer| */...if|
|00002c80| 20 28 70 61 73 73 77 6f | 72 64 20 3d 3d 20 30 20 | (passwo|rd == 0 |
|00002c90| 7c 7c 20 2a 70 61 73 73 | 77 6f 72 64 20 3d 3d 20 ||| *pass|word == |
|00002ca0| 30 29 0a 09 09 72 65 74 | 75 72 6e 28 50 57 43 4b |0)...ret|urn(PWCK|
|00002cb0| 5f 4e 55 4c 4c 29 3b 09 | 09 2f 2a 20 4e 75 6c 6c |_NULL);.|./* Null|
|00002cc0| 20 70 61 73 73 77 6f 72 | 64 20 2a 2f 0a 0a 09 66 | passwor|d */...f|
|00002cd0| 6f 72 20 28 63 68 65 63 | 6b 66 75 6e 63 20 3d 20 |or (chec|kfunc = |
|00002ce0| 70 77 63 6b 5f 76 65 63 | 74 6f 72 3b 20 2a 63 68 |pwck_vec|tor; *ch|
|00002cf0| 65 63 6b 66 75 6e 63 3b | 20 63 68 65 63 6b 66 75 |eckfunc;| checkfu|
|00002d00| 6e 63 2b 2b 29 20 7b 0a | 09 09 69 66 20 28 28 72 |nc++) {.|..if ((r|
|00002d10| 63 6f 64 65 20 3d 20 28 | 2a 63 68 65 63 6b 66 75 |code = (|*checkfu|
|00002d20| 6e 63 29 28 70 61 73 73 | 77 6f 72 64 2c 20 75 73 |nc)(pass|word, us|
|00002d30| 65 72 69 64 29 29 20 21 | 3d 20 50 57 43 4b 5f 4f |erid)) !|= PWCK_O|
|00002d40| 4b 29 0a 09 09 09 72 65 | 74 75 72 6e 28 72 63 6f |K)....re|turn(rco|
|00002d50| 64 65 29 3b 0a 09 7d 0a | 09 72 65 74 75 72 6e 28 |de);..}.|.return(|
|00002d60| 50 57 43 4b 5f 4f 4b 29 | 3b 0a 7d 0a 0a 0a 2f 2a |PWCK_OK)|;.}.../*|
|00002d70| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|00002d80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002d90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002da0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002db0| 2d 2d 2d 2d 20 2a 2f 0a | 0a 23 64 65 66 69 6e 65 |---- */.|.#define|
|00002dc0| 09 50 5f 55 09 30 78 31 | 20 09 2f 2a 20 55 70 70 |.P_U.0x1| ./* Upp|
|00002dd0| 65 72 20 63 61 73 65 20 | 69 6e 20 70 61 73 73 77 |er case |in passw|
|00002de0| 6f 72 64 20 2a 2f 0a 23 | 64 65 66 69 6e 65 09 50 |ord */.#|define.P|
|00002df0| 5f 4c 09 30 78 32 20 09 | 2f 2a 20 4c 6f 77 65 72 |_L.0x2 .|/* Lower|
|00002e00| 20 63 61 73 65 20 69 6e | 20 70 61 73 73 77 6f 72 | case in| passwor|
|00002e10| 64 20 2a 2f 0a 23 64 65 | 66 69 6e 65 09 50 5f 43 |d */.#de|fine.P_C|
|00002e20| 09 30 78 34 20 09 2f 2a | 20 43 6f 6e 74 72 6f 6c |.0x4 ./*| Control|
|00002e30| 20 63 68 61 72 73 20 69 | 6e 20 70 61 73 73 77 6f | chars i|n passwo|
|00002e40| 72 64 20 2a 2f 0a 23 64 | 65 66 69 6e 65 09 50 5f |rd */.#d|efine.P_|
|00002e50| 44 09 30 78 38 20 09 2f | 2a 20 44 69 67 69 74 73 |D.0x8 ./|* Digits|
|00002e60| 20 69 6e 20 70 61 73 73 | 77 6f 72 64 20 2a 2f 0a | in pass|word */.|
|00002e70| 23 64 65 66 69 6e 65 09 | 50 5f 50 09 30 78 31 30 |#define.|P_P.0x10|
|00002e80| 20 09 2f 2a 20 50 75 6e | 63 74 75 74 61 74 69 6f | ./* Pun|ctutatio|
|00002e90| 6e 20 63 68 61 72 73 20 | 69 6e 20 70 61 73 73 77 |n chars |in passw|
|00002ea0| 6f 72 64 20 2a 2f 0a 0a | 23 64 65 66 69 6e 65 09 |ord */..|#define.|
|00002eb0| 68 61 73 6f 6e 65 28 50 | 29 09 28 77 68 61 74 20 |hasone(P|).(what |
|00002ec0| 7c 3d 20 28 50 29 29 0a | 23 64 65 66 69 6e 65 09 ||= (P)).|#define.|
|00002ed0| 68 61 73 61 6e 79 28 50 | 29 09 28 28 77 68 61 74 |hasany(P|).((what|
|00002ee0| 20 26 20 28 50 29 29 20 | 3d 3d 20 28 50 29 29 0a | & (P)) |== (P)).|
|00002ef0| 0a 23 64 65 66 69 6e 65 | 09 63 63 6f 6b 09 70 77 |.#define|.ccok.pw|
|00002f00| 63 6b 5f 70 72 65 66 65 | 72 65 6e 63 65 73 2e 43 |ck_prefe|rences.C|
|00002f10| 74 72 6c 4f 6b 0a 23 64 | 65 66 69 6e 65 09 6d 63 |trlOk.#d|efine.mc|
|00002f20| 6f 6b 09 70 77 63 6b 5f | 70 72 65 66 65 72 65 6e |ok.pwck_|preferen|
|00002f30| 63 65 73 2e 4f 6e 65 43 | 61 73 65 4f 6b 0a 23 64 |ces.OneC|aseOk.#d|
|00002f40| 65 66 69 6e 65 09 72 75 | 6e 6c 09 70 77 63 6b 5f |efine.ru|nl.pwck_|
|00002f50| 70 72 65 66 65 72 65 6e | 63 65 73 2e 43 68 61 72 |preferen|ces.Char|
|00002f60| 52 75 6e 4c 65 6e 0a 23 | 64 65 66 69 6e 65 09 6d |RunLen.#|define.m|
|00002f70| 69 6e 6c 09 70 77 63 6b | 5f 70 72 65 66 65 72 65 |inl.pwck|_prefere|
|00002f80| 6e 63 65 73 2e 4d 69 6e | 50 77 4c 65 6e 0a 0a 2f |nces.Min|PwLen../|
|00002f90| 2a 0a 20 2a 09 70 77 63 | 6b 5f 6c 65 78 69 63 61 |*. *.pwc|k_lexica|
|00002fa0| 6c 20 2d 20 50 65 72 66 | 6f 72 6d 20 6c 65 78 69 |l - Perf|orm lexi|
|00002fb0| 63 61 6c 20 61 6e 61 6c | 79 73 69 73 20 6f 66 20 |cal anal|ysis of |
|00002fc0| 70 61 73 73 77 6f 72 64 | 20 63 61 6e 64 69 64 61 |password| candida|
|00002fd0| 74 65 2e 0a 20 2a 0a 20 | 2a 09 54 68 69 6e 67 73 |te.. *. |*.Things|
|00002fe0| 20 77 68 69 63 68 20 61 | 72 65 20 6f 6b 3a 0a 20 | which a|re ok:. |
|00002ff0| 2a 09 09 4d 69 78 65 64 | 20 63 61 73 65 0a 20 2a |*..Mixed| case. *|
|00003000| 09 09 44 69 67 69 74 73 | 0a 20 2a 09 09 50 75 6e |..Digits|. *..Pun|
|00003010| 63 74 75 74 61 74 69 6f | 6e 0a 20 2a 09 09 43 6f |ctutatio|n. *..Co|
|00003020| 6e 74 72 6f 6c 20 63 68 | 61 72 61 63 74 65 72 73 |ntrol ch|aracters|
|00003030| 20 28 65 78 63 65 70 74 | 20 66 6f 72 20 74 68 6f | (except| for tho|
|00003040| 73 65 20 69 6e 20 74 68 | 65 20 66 6f 72 62 69 64 |se in th|e forbid|
|00003050| 64 65 6e 20 74 61 62 6c | 65 29 0a 20 2a 09 09 09 |den tabl|e). *...|
|00003060| 28 63 6f 6e 74 72 6f 6c | 6c 65 64 20 62 79 20 74 |(control|led by t|
|00003070| 68 65 20 70 72 65 66 65 | 72 65 6e 63 65 73 29 0a |he prefe|rences).|
|00003080| 20 2a 0a 20 2a 09 54 68 | 69 6e 67 73 20 77 68 69 | *. *.Th|ings whi|
|00003090| 63 68 20 61 72 65 20 4e | 4f 54 20 6f 6b 3a 0a 20 |ch are N|OT ok:. |
|000030a0| 2a 09 09 50 61 73 73 77 | 6f 72 64 73 20 6c 65 73 |*..Passw|ords les|
|000030b0| 73 20 74 68 61 74 20 27 | 6d 69 6e 6c 27 20 6c 65 |s that '|minl' le|
|000030c0| 6e 67 74 68 0a 20 2a 09 | 09 52 75 6e 73 20 6f 66 |ngth. *.|.Runs of|
|000030d0| 20 6d 6f 72 65 20 74 68 | 61 6e 20 3c 72 75 6e 6c | more th|an <runl|
|000030e0| 3e 20 6f 66 20 74 68 65 | 20 73 61 6d 65 20 63 68 |> of the| same ch|
|000030f0| 61 72 61 63 74 65 72 20 | 28 65 2e 67 2e 20 27 7a |aracter |(e.g. 'z|
|00003100| 7a 7a 27 29 0a 20 2a 09 | 09 53 69 6e 67 6c 65 2d |zz'). *.|.Single-|
|00003110| 63 61 73 65 20 73 74 72 | 69 6e 67 73 0a 20 2a 09 |case str|ings. *.|
|00003120| 09 09 28 63 6f 6e 74 72 | 6f 6c 6c 65 64 20 62 79 |..(contr|olled by|
|00003130| 20 74 68 65 20 70 72 65 | 66 65 72 65 6e 63 65 73 | the pre|ferences|
|00003140| 29 0a 20 2a 0a 20 2a 09 | 54 68 69 6e 67 73 20 6e |). *. *.|Things n|
|00003150| 6f 74 20 63 68 65 63 6b | 65 64 20 66 6f 72 3a 0a |ot check|ed for:.|
|00003160| 20 2a 09 09 43 79 63 6c | 65 73 20 6f 66 20 63 68 | *..Cycl|es of ch|
|00003170| 61 72 61 63 74 65 72 20 | 67 72 6f 75 70 73 20 28 |aracter |groups (|
|00003180| 65 2e 67 2e 20 27 61 61 | 62 62 63 63 27 20 6f 72 |e.g. 'aa|bbcc' or|
|00003190| 20 27 61 62 61 62 61 62 | 27 29 0a 20 2a 2f 0a 73 | 'ababab|'). */.s|
|000031a0| 74 61 74 69 63 20 69 6e | 74 0a 70 77 63 6b 5f 6c |tatic in|t.pwck_l|
|000031b0| 65 78 69 63 61 6c 28 70 | 61 73 73 77 6f 72 64 2c |exical(p|assword,|
|000031c0| 20 75 73 65 72 69 64 29 | 0a 63 68 61 72 09 2a 70 | userid)|.char.*p|
|000031d0| 61 73 73 77 6f 72 64 3b | 0a 69 6e 74 09 75 73 65 |assword;|.int.use|
|000031e0| 72 69 64 3b 09 09 2f 2a | 20 4e 4f 54 55 53 45 44 |rid;../*| NOTUSED|
|000031f0| 20 2a 2f 0a 7b 0a 09 69 | 6e 74 09 72 63 3b 09 09 | */.{..i|nt.rc;..|
|00003200| 2f 2a 20 44 75 70 6c 69 | 63 61 74 65 20 63 68 61 |/* Dupli|cate cha|
|00003210| 72 61 63 74 65 72 20 72 | 75 6e 20 63 6f 75 6e 74 |racter r|un count|
|00003220| 20 2a 2f 0a 09 63 68 61 | 72 09 2a 70 20 3d 20 70 | */..cha|r.*p = p|
|00003230| 61 73 73 77 6f 72 64 3b | 09 2f 2a 20 53 63 72 61 |assword;|./* Scra|
|00003240| 74 63 68 20 2a 2f 0a 09 | 63 68 61 72 09 77 68 61 |tch */..|char.wha|
|00003250| 74 20 3d 20 30 2c 09 2f | 2a 20 4c 65 78 69 63 61 |t = 0,./|* Lexica|
|00003260| 6c 20 61 6e 61 6c 79 73 | 69 73 20 72 65 73 75 6c |l analys|is resul|
|00003270| 74 20 66 6c 61 67 73 20 | 2a 2f 0a 09 09 6c 61 73 |t flags |*/...las|
|00003280| 74 20 3d 20 30 3b 09 2f | 2a 20 4c 61 73 74 20 63 |t = 0;./|* Last c|
|00003290| 68 61 72 61 63 74 65 72 | 20 73 65 65 6e 20 28 66 |haracter| seen (f|
|000032a0| 6f 72 20 72 75 6e 20 63 | 68 65 63 6b 73 29 20 2a |or run c|hecks) *|
|000032b0| 2f 0a 0a 09 69 66 20 28 | 6d 69 6e 6c 20 26 26 20 |/...if (|minl && |
|000032c0| 73 74 72 6c 65 6e 28 70 | 61 73 73 77 6f 72 64 29 |strlen(p|assword)|
|000032d0| 20 3c 20 6d 69 6e 6c 29 | 0a 09 09 72 65 74 75 72 | < minl)|...retur|
|000032e0| 6e 28 50 57 43 4b 5f 53 | 48 4f 52 54 29 3b 0a 0a |n(PWCK_S|HORT);..|
|000032f0| 09 66 6f 72 20 28 70 20 | 3d 20 70 61 73 73 77 6f |.for (p |= passwo|
|00003300| 72 64 3b 20 2a 70 3b 20 | 70 2b 2b 29 20 7b 0a 09 |rd; *p; |p++) {..|
|00003310| 09 69 66 20 28 2a 70 20 | 21 3d 20 6c 61 73 74 29 |.if (*p |!= last)|
|00003320| 20 7b 0a 09 09 09 6c 61 | 73 74 20 3d 20 2a 70 3b | {....la|st = *p;|
|00003330| 0a 09 09 09 72 63 20 3d | 20 30 3b 0a 09 09 7d 0a |....rc =| 0;...}.|
|00003340| 09 09 65 6c 73 65 20 7b | 09 09 2f 2a 20 52 75 6e |..else {|../* Run|
|00003350| 20 6f 66 20 73 61 6d 65 | 20 63 68 61 72 61 63 74 | of same| charact|
|00003360| 65 72 73 20 2a 2f 0a 09 | 09 09 69 66 20 28 72 75 |ers */..|..if (ru|
|00003370| 6e 6c 20 26 26 20 2b 2b | 72 63 20 3e 3d 20 72 75 |nl && ++|rc >= ru|
|00003380| 6e 6c 29 0a 09 09 09 09 | 72 65 74 75 72 6e 28 50 |nl).....|return(P|
|00003390| 57 43 4b 5f 4f 42 56 49 | 4f 55 53 29 3b 0a 09 09 |WCK_OBVI|OUS);...|
|000033a0| 7d 0a 09 09 69 66 20 28 | 2a 70 20 3c 20 27 20 27 |}...if (|*p < ' '|
|000033b0| 29 20 7b 09 09 2f 2a 20 | 43 6f 6e 74 72 6f 6c 20 |) {../* |Control |
|000033c0| 63 68 61 72 61 63 74 65 | 72 20 2a 2f 0a 09 09 09 |characte|r */....|
|000033d0| 69 66 20 28 21 63 63 6f | 6b 29 0a 09 09 09 09 72 |if (!cco|k).....r|
|000033e0| 65 74 75 72 6e 28 50 57 | 43 4b 5f 49 4c 4c 43 48 |eturn(PW|CK_ILLCH|
|000033f0| 41 52 29 3b 0a 09 09 09 | 69 66 20 28 69 6e 64 65 |AR);....|if (inde|
|00003400| 78 20 28 70 77 63 6b 5f | 69 6c 6c 65 67 61 6c 63 |x (pwck_|illegalc|
|00003410| 63 2c 20 2a 70 29 29 0a | 09 09 09 09 72 65 74 75 |c, *p)).|....retu|
|00003420| 72 6e 28 50 57 43 4b 5f | 49 4c 4c 43 48 41 52 29 |rn(PWCK_|ILLCHAR)|
|00003430| 3b 0a 09 09 09 68 61 73 | 6f 6e 65 28 50 5f 43 29 |;....has|one(P_C)|
|00003440| 3b 0a 09 09 7d 0a 09 09 | 65 6c 73 65 20 69 66 20 |;...}...|else if |
|00003450| 28 69 73 75 70 70 65 72 | 28 2a 70 29 29 09 68 61 |(isupper|(*p)).ha|
|00003460| 73 6f 6e 65 28 50 5f 55 | 29 3b 0a 09 09 65 6c 73 |sone(P_U|);...els|
|00003470| 65 20 69 66 20 28 69 73 | 6c 6f 77 65 72 28 2a 70 |e if (is|lower(*p|
|00003480| 29 29 09 68 61 73 6f 6e | 65 28 50 5f 4c 29 3b 0a |)).hason|e(P_L);.|
|00003490| 09 09 65 6c 73 65 20 69 | 66 20 28 69 73 70 75 6e |..else i|f (ispun|
|000034a0| 63 74 28 2a 70 29 29 09 | 68 61 73 6f 6e 65 28 50 |ct(*p)).|hasone(P|
|000034b0| 5f 50 29 3b 0a 09 09 65 | 6c 73 65 20 69 66 20 28 |_P);...e|lse if (|
|000034c0| 69 73 64 69 67 69 74 28 | 2a 70 29 29 09 68 61 73 |isdigit(|*p)).has|
|000034d0| 6f 6e 65 28 50 5f 44 29 | 3b 0a 09 7d 0a 09 69 66 |one(P_D)|;..}..if|
|000034e0| 20 28 68 61 73 61 6e 79 | 28 50 5f 55 20 7c 20 50 | (hasany|(P_U | P|
|000034f0| 5f 4c 29 29 09 72 65 74 | 75 72 6e 28 50 57 43 4b |_L)).ret|urn(PWCK|
|00003500| 5f 4f 4b 29 3b 09 2f 2a | 20 55 43 2b 6c 63 20 2a |_OK);./*| UC+lc *|
|00003510| 2f 0a 09 69 66 20 28 68 | 61 73 61 6e 79 28 50 5f |/..if (h|asany(P_|
|00003520| 44 29 29 09 72 65 74 75 | 72 6e 28 50 57 43 4b 5f |D)).retu|rn(PWCK_|
|00003530| 4f 4b 29 3b 09 2f 2a 20 | 4e 75 6d 62 65 72 73 20 |OK);./* |Numbers |
|00003540| 2a 2f 0a 09 69 66 20 28 | 68 61 73 61 6e 79 28 50 |*/..if (|hasany(P|
|00003550| 5f 50 29 29 09 72 65 74 | 75 72 6e 28 50 57 43 4b |_P)).ret|urn(PWCK|
|00003560| 5f 4f 4b 29 3b 09 2f 2a | 20 50 75 6e 63 74 75 74 |_OK);./*| Punctut|
|00003570| 61 74 69 6f 6e 20 63 68 | 61 72 73 20 2a 2f 0a 09 |ation ch|ars */..|
|00003580| 69 66 20 28 68 61 73 61 | 6e 79 28 50 5f 43 29 29 |if (hasa|ny(P_C))|
|00003590| 09 72 65 74 75 72 6e 28 | 50 57 43 4b 5f 4f 4b 29 |.return(|PWCK_OK)|
|000035a0| 3b 09 2f 2a 20 43 6f 6e | 74 72 6f 6c 20 63 68 61 |;./* Con|trol cha|
|000035b0| 72 73 20 2a 2f 0a 09 2f | 2a 0a 09 20 2a 09 43 68 |rs */../|*.. *.Ch|
|000035c0| 65 63 6b 20 66 6f 72 20 | 6d 6f 6e 6f 2d 63 61 73 |eck for |mono-cas|
|000035d0| 65 20 70 61 73 73 77 6f | 72 64 73 20 0a 09 20 2a |e passwo|rds .. *|
|000035e0| 2f 0a 09 69 66 20 28 21 | 68 61 73 61 6e 79 28 50 |/..if (!|hasany(P|
|000035f0| 5f 55 29 20 26 26 20 6d | 63 6f 6b 29 09 2f 2a 20 |_U) && m|cok)./* |
|00003600| 41 6c 6c 20 6c 6f 77 65 | 72 20 63 61 73 65 20 61 |All lowe|r case a|
|00003610| 6c 70 68 61 20 2a 2f 0a | 09 09 72 65 74 75 72 6e |lpha */.|..return|
|00003620| 28 50 57 43 4b 5f 4f 4b | 29 3b 0a 09 69 66 20 28 |(PWCK_OK|);..if (|
|00003630| 21 68 61 73 61 6e 79 28 | 50 5f 4c 29 20 26 26 20 |!hasany(|P_L) && |
|00003640| 6d 63 6f 6b 29 09 2f 2a | 20 41 6c 6c 20 75 70 70 |mcok)./*| All upp|
|00003650| 65 72 20 63 61 73 65 20 | 61 6c 70 68 61 20 2a 2f |er case |alpha */|
|00003660| 0a 09 09 72 65 74 75 72 | 6e 28 50 57 43 4b 5f 4f |...retur|n(PWCK_O|
|00003670| 4b 29 3b 0a 0a 09 72 65 | 74 75 72 6e 28 50 57 43 |K);...re|turn(PWC|
|00003680| 4b 5f 49 4c 4c 43 48 41 | 52 29 3b 0a 7d 0a 23 75 |K_ILLCHA|R);.}.#u|
|00003690| 6e 64 65 66 09 68 61 73 | 6f 6e 65 0a 23 75 6e 64 |ndef.has|one.#und|
|000036a0| 65 66 09 68 61 73 61 6e | 79 0a 0a 2f 2a 0a 20 2a |ef.hasan|y../*. *|
|000036b0| 09 70 77 63 6b 5f 6c 6f | 63 61 6c 20 2d 20 50 65 |.pwck_lo|cal - Pe|
|000036c0| 72 66 6f 72 6d 20 27 6c | 6f 63 61 6c 27 20 70 61 |rform 'l|ocal' pa|
|000036d0| 73 73 77 6f 72 64 20 63 | 68 65 63 6b 73 2e 0a 20 |ssword c|hecks.. |
|000036e0| 2a 0a 20 2a 09 52 65 74 | 75 72 6e 73 3a 0a 20 2a |*. *.Ret|urns:. *|
|000036f0| 09 09 50 57 43 4b 5f 4f | 42 56 49 4f 55 53 20 69 |..PWCK_O|BVIOUS i|
|00003700| 66 20 3c 70 61 73 73 77 | 6f 72 64 3e 20 3d 3d 20 |f <passw|ord> == |
|00003710| 68 6f 73 74 6e 61 6d 65 | 0a 20 2a 09 09 50 57 43 |hostname|. *..PWC|
|00003720| 4b 5f 4f 4b 20 69 66 20 | 6f 74 68 65 72 77 69 73 |K_OK if |otherwis|
|00003730| 65 0a 20 2a 2f 0a 4c 4f | 43 41 4c 20 69 6e 74 0a |e. */.LO|CAL int.|
|00003740| 70 77 63 6b 5f 6c 6f 63 | 61 6c 28 70 61 73 73 77 |pwck_loc|al(passw|
|00003750| 6f 72 64 2c 20 75 73 65 | 72 69 64 29 0a 63 68 61 |ord, use|rid).cha|
|00003760| 72 09 2a 70 61 73 73 77 | 6f 72 64 3b 0a 69 6e 74 |r.*passw|ord;.int|
|00003770| 09 75 73 65 72 69 64 3b | 09 09 2f 2a 20 4e 4f 54 |.userid;|../* NOT|
|00003780| 55 53 45 44 20 2a 2f 0a | 7b 0a 09 63 68 61 72 09 |USED */.|{..char.|
|00003790| 6d 79 6e 61 6d 65 5b 33 | 32 5d 3b 09 09 2f 2a 20 |myname[3|2];../* |
|000037a0| 53 63 72 61 74 63 68 20 | 2a 2f 0a 0a 09 28 76 6f |Scratch |*/...(vo|
|000037b0| 69 64 29 20 67 65 74 68 | 6f 73 74 6e 61 6d 65 28 |id) geth|ostname(|
|000037c0| 6d 79 6e 61 6d 65 2c 20 | 73 69 7a 65 6f 66 28 6d |myname, |sizeof(m|
|000037d0| 79 6e 61 6d 65 29 29 3b | 0a 09 74 72 79 28 70 61 |yname));|..try(pa|
|000037e0| 73 73 77 6f 72 64 2c 20 | 6d 79 6e 61 6d 65 2c 20 |ssword, |myname, |
|000037f0| 50 57 43 4b 5f 4f 42 56 | 49 4f 55 53 29 3b 0a 09 |PWCK_OBV|IOUS);..|
|00003800| 2f 2a 0a 09 20 2a 20 57 | 61 6e 74 20 74 6f 20 74 |/*.. * W|ant to t|
|00003810| 72 79 20 66 75 6c 6c 20 | 63 61 6e 6f 6e 63 61 6c |ry full |canoncal|
|00003820| 69 7a 65 64 20 68 6f 73 | 74 6e 61 6d 65 20 68 65 |ized hos|tname he|
|00003830| 72 65 20 69 6e 20 63 61 | 73 65 20 67 65 74 68 6f |re in ca|se getho|
|00003840| 73 74 6e 61 6d 65 0a 09 | 20 2a 20 64 69 64 6e 27 |stname..| * didn'|
|00003850| 74 20 67 65 74 20 74 68 | 61 74 20 66 6f 72 20 75 |t get th|at for u|
|00003860| 73 2e 0a 09 20 2a 0a 09 | 20 2a 20 54 68 65 6e 20 |s... *..| * Then |
|00003870| 6c 6f 6f 6b 20 69 6e 20 | 75 73 65 72 73 27 20 2e |look in |users' .|
|00003880| 72 68 6f 73 74 73 20 61 | 6e 64 20 74 72 79 20 74 |rhosts a|nd try t|
|00003890| 68 6f 73 65 20 73 74 72 | 69 6e 67 73 20 28 6d 61 |hose str|ings (ma|
|000038a0| 79 62 65 29 0a 09 20 2a | 2f 0a 09 72 65 74 75 72 |ybe).. *|/..retur|
|000038b0| 6e 28 50 57 43 4b 5f 4f | 4b 29 3b 0a 7d 0a 0a 2f |n(PWCK_O|K);.}../|
|000038c0| 2a 0a 20 2a 09 70 77 63 | 6b 5f 64 69 63 74 69 6f |*. *.pwc|k_dictio|
|000038d0| 6e 61 72 79 20 2d 20 4c | 6f 6f 6b 20 69 6e 20 74 |nary - L|ook in t|
|000038e0| 68 65 20 66 6f 72 62 69 | 64 64 65 6e 20 70 61 73 |he forbi|dden pas|
|000038f0| 73 77 6f 72 64 20 64 69 | 63 74 69 6f 6e 61 72 69 |sword di|ctionari|
|00003900| 65 73 2e 0a 20 2a 0a 20 | 2a 09 52 65 74 75 72 6e |es.. *. |*.Return|
|00003910| 73 3a 0a 20 2a 09 09 50 | 57 43 4b 5f 49 4e 44 49 |s:. *..P|WCK_INDI|
|00003920| 43 54 20 69 66 20 3c 70 | 61 73 73 77 6f 72 64 3e |CT if <p|assword>|
|00003930| 20 77 61 73 20 69 6e 20 | 61 6e 79 20 64 69 63 74 | was in |any dict|
|00003940| 69 6f 6e 61 72 79 0a 20 | 2a 09 09 50 57 43 4b 5f |ionary. |*..PWCK_|
|00003950| 4f 4b 20 69 66 20 6e 6f | 74 0a 20 2a 2f 0a 4c 4f |OK if no|t. */.LO|
|00003960| 43 41 4c 20 69 6e 74 0a | 70 77 63 6b 5f 64 69 63 |CAL int.|pwck_dic|
|00003970| 74 69 6f 6e 61 72 79 28 | 70 61 73 73 77 6f 72 64 |tionary(|password|
|00003980| 2c 20 75 73 65 72 69 64 | 29 0a 63 68 61 72 09 2a |, userid|).char.*|
|00003990| 70 61 73 73 77 6f 72 64 | 3b 0a 69 6e 74 09 75 73 |password|;.int.us|
|000039a0| 65 72 69 64 3b 09 09 2f | 2a 20 4e 4f 54 55 53 45 |erid;../|* NOTUSE|
|000039b0| 44 20 2a 2f 0a 7b 0a 09 | 69 6e 74 09 69 2c 09 09 |D */.{..|int.i,..|
|000039c0| 2f 2a 20 43 6f 75 6e 74 | 65 72 20 2a 2f 0a 09 09 |/* Count|er */...|
|000039d0| 72 63 6f 64 65 3b 09 09 | 2f 2a 20 52 65 74 75 72 |rcode;..|/* Retur|
|000039e0| 6e 20 63 6f 64 65 20 74 | 65 6d 70 20 2a 2f 0a 0a |n code t|emp */..|
|000039f0| 09 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 70 77 63 |.for (i |= 0; pwc|
|00003a00| 6b 5f 64 69 63 69 74 6f | 6e 61 72 69 65 73 5b 69 |k_dicito|naries[i|
|00003a10| 5d 3b 20 69 2b 2b 29 20 | 7b 0a 09 09 69 66 20 28 |]; i++) |{...if (|
|00003a20| 28 72 63 6f 64 65 20 3d | 0a 09 09 20 20 20 20 20 |(rcode =|... |
|00003a30| 49 73 49 6e 44 69 63 74 | 69 6f 6e 61 72 79 28 70 |IsInDict|ionary(p|
|00003a40| 77 63 6b 5f 64 69 63 69 | 74 6f 6e 61 72 69 65 73 |wck_dici|tonaries|
|00003a50| 5b 69 5d 2c 20 70 61 73 | 73 77 6f 72 64 29 29 20 |[i], pas|sword)) |
|00003a60| 21 3d 20 50 57 43 4b 5f | 4f 4b 29 0a 09 09 09 72 |!= PWCK_|OK)....r|
|00003a70| 65 74 75 72 6e 28 72 63 | 6f 64 65 29 3b 0a 09 7d |eturn(rc|ode);..}|
|00003a80| 0a 09 72 65 74 75 72 6e | 28 50 57 43 4b 5f 4f 4b |..return|(PWCK_OK|
|00003a90| 29 3b 0a 7d 0a 0a 2f 2a | 0a 20 2a 09 49 73 49 6e |);.}../*|. *.IsIn|
|00003aa0| 44 69 63 74 69 6f 6e 61 | 72 79 20 2d 20 6c 6f 6f |Dictiona|ry - loo|
|00003ab0| 6b 20 66 6f 72 20 3c 70 | 61 73 73 77 6f 72 64 3e |k for <p|assword>|
|00003ac0| 20 69 6e 20 3c 64 69 63 | 74 69 6f 6e 61 72 79 3e | in <dic|tionary>|
|00003ad0| 0a 20 2a 0a 20 2a 09 55 | 73 65 20 61 20 44 42 4d |. *. *.U|se a DBM|
|00003ae0| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 65 20 | version| of the |
|00003af0| 64 69 63 74 69 6f 6e 61 | 72 79 20 69 66 20 70 72 |dictiona|ry if pr|
|00003b00| 65 73 65 6e 74 2c 20 0a | 20 2a 09 75 73 65 20 65 |esent, .| *.use e|
|00003b10| 67 72 65 70 20 74 6f 20 | 73 65 61 72 63 68 20 74 |grep to |search t|
|00003b20| 68 65 20 66 6c 61 74 20 | 66 69 6c 65 20 69 66 20 |he flat |file if |
|00003b30| 6e 6f 74 2e 0a 20 2a 0a | 20 2a 09 52 65 74 75 72 |not.. *.| *.Retur|
|00003b40| 6e 73 3a 0a 20 2a 09 09 | 50 57 43 4b 5f 49 4e 44 |ns:. *..|PWCK_IND|
|00003b50| 49 43 54 20 69 66 20 3c | 70 61 73 73 77 6f 72 64 |ICT if <|password|
|00003b60| 3e 20 77 61 73 20 66 6f | 75 6e 64 20 69 6e 20 3c |> was fo|und in <|
|00003b70| 64 69 63 74 69 6f 6e 61 | 72 79 3e 0a 20 2a 09 09 |dictiona|ry>. *..|
|00003b80| 50 57 43 4b 5f 4f 4b 20 | 69 66 20 6e 6f 74 0a 20 |PWCK_OK |if not. |
|00003b90| 2a 2f 0a 23 64 65 66 69 | 6e 65 09 72 65 74 75 72 |*/.#defi|ne.retur|
|00003ba0| 6e 77 69 74 68 28 63 6f | 64 65 29 20 7b 20 64 62 |nwith(co|de) { db|
|00003bb0| 6d 5f 63 6c 6f 73 65 28 | 64 62 70 29 3b 20 72 65 |m_close(|dbp); re|
|00003bc0| 74 75 72 6e 28 63 6f 64 | 65 29 3b 20 7d 0a 23 64 |turn(cod|e); }.#d|
|00003bd0| 65 66 69 6e 65 09 45 47 | 52 45 50 09 70 77 63 6b |efine.EG|REP.pwck|
|00003be0| 5f 70 72 65 66 65 72 65 | 6e 63 65 73 2e 45 67 72 |_prefere|nces.Egr|
|00003bf0| 65 70 50 61 74 68 0a 0a | 23 69 6e 63 6c 75 64 65 |epPath..|#include|
|00003c00| 20 3c 6e 64 62 6d 2e 68 | 3e 0a 0a 4c 4f 43 41 4c | <ndbm.h|>..LOCAL|
|00003c10| 20 69 6e 74 0a 49 73 49 | 6e 44 69 63 74 69 6f 6e | int.IsI|nDiction|
|00003c20| 61 72 79 28 64 69 63 74 | 69 6f 6e 61 72 79 2c 20 |ary(dict|ionary, |
|00003c30| 70 61 73 73 77 6f 72 64 | 29 0a 63 68 61 72 09 2a |password|).char.*|
|00003c40| 64 69 63 74 69 6f 6e 61 | 72 79 2c 09 09 2f 2a 20 |dictiona|ry,../* |
|00003c50| 50 61 74 68 6e 61 6d 65 | 20 6f 66 20 64 69 63 74 |Pathname| of dict|
|00003c60| 69 6f 6e 61 72 79 20 2a | 2f 0a 09 2a 70 61 73 73 |ionary *|/..*pass|
|00003c70| 77 6f 72 64 3b 09 09 2f | 2a 20 50 6c 61 69 6e 74 |word;../|* Plaint|
|00003c80| 65 78 74 20 6f 66 20 70 | 61 73 73 77 6f 72 64 20 |ext of p|assword |
|00003c90| 2a 2f 0a 7b 0a 09 44 42 | 4d 09 2a 64 62 70 3b 09 |*/.{..DB|M.*dbp;.|
|00003ca0| 09 2f 2a 20 44 42 4d 20 | 64 61 74 61 62 61 73 65 |./* DBM |database|
|00003cb0| 20 70 6f 69 6e 74 65 72 | 20 2a 2f 0a 09 64 61 74 | pointer| */..dat|
|00003cc0| 75 6d 09 6b 2c 09 09 2f | 2a 20 44 42 4d 20 6c 6f |um.k,../|* DBM lo|
|00003cd0| 6f 6b 75 70 20 6b 65 79 | 20 2a 2f 0a 09 09 64 3b |okup key| */...d;|
|00003ce0| 09 09 2f 2a 20 44 42 4d | 20 6c 6f 6f 6b 75 70 20 |../* DBM| lookup |
|00003cf0| 64 61 74 75 6d 20 2a 2f | 0a 09 69 6e 74 09 75 63 |datum */|..int.uc|
|00003d00| 20 3d 20 69 73 75 70 70 | 65 72 28 70 61 73 73 77 | = isupp|er(passw|
|00003d10| 6f 72 64 5b 30 5d 29 3b | 09 2f 2a 20 49 73 20 66 |ord[0]);|./* Is f|
|00003d20| 69 72 73 74 20 63 68 61 | 72 20 55 43 3f 20 2a 2f |irst cha|r UC? */|
|00003d30| 0a 09 63 68 61 72 09 70 | 77 74 65 6d 70 5b 31 32 |..char.p|wtemp[12|
|00003d40| 38 5d 3b 09 2f 2a 20 53 | 63 72 61 74 63 68 20 62 |8];./* S|cratch b|
|00003d50| 75 66 66 65 72 20 2a 2f | 0a 0a 09 69 66 20 28 28 |uffer */|...if ((|
|00003d60| 64 62 70 20 3d 20 64 62 | 6d 5f 6f 70 65 6e 28 64 |dbp = db|m_open(d|
|00003d70| 69 63 74 69 6f 6e 61 72 | 79 2c 20 30 2c 20 30 29 |ictionar|y, 0, 0)|
|00003d80| 29 20 3d 3d 20 28 44 42 | 4d 20 2a 29 30 29 20 7b |) == (DB|M *)0) {|
|00003d90| 0a 09 09 63 68 61 72 09 | 63 6f 6d 6d 61 6e 64 5b |...char.|command[|
|00003da0| 31 32 38 5d 3b 09 2f 2a | 20 43 6f 6d 6d 61 6e 64 |128];./*| Command|
|00003db0| 20 62 75 69 6c 64 20 62 | 75 66 66 65 72 20 2a 2f | build b|uffer */|
|00003dc0| 0a 09 09 69 6e 74 09 72 | 63 3b 09 09 2f 2a 20 53 |...int.r|c;../* S|
|00003dd0| 79 73 74 65 6d 28 29 20 | 72 65 74 75 72 6e 20 63 |ystem() |return c|
|00003de0| 6f 64 65 20 2a 2f 0a 0a | 09 09 69 66 20 28 61 63 |ode */..|..if (ac|
|00003df0| 63 65 73 73 28 64 69 63 | 74 69 6f 6e 61 72 79 2c |cess(dic|tionary,|
|00003e00| 20 30 29 20 3c 20 30 29 | 0a 09 09 09 72 65 74 75 | 0) < 0)|....retu|
|00003e10| 72 6e 28 50 57 43 4b 5f | 4f 4b 29 3b 0a 09 09 2f |rn(PWCK_|OK);.../|
|00003e20| 2a 0a 09 09 20 2a 20 49 | 66 20 74 68 65 20 66 69 |*... * I|f the fi|
|00003e30| 72 73 74 20 6c 65 74 74 | 65 72 20 69 73 20 63 61 |rst lett|er is ca|
|00003e40| 70 69 74 61 6c 69 7a 65 | 64 2c 20 6c 6f 6f 6b 20 |pitalize|d, look |
|00003e50| 66 6f 72 0a 09 09 20 2a | 20 22 5b 77 57 5d 6f 72 |for... *| "[wW]or|
|00003e60| 64 22 20 65 6c 73 65 20 | 6c 6f 6f 6b 20 66 6f 72 |d" else |look for|
|00003e70| 20 22 77 6f 72 64 22 0a | 09 09 20 2a 2f 0a 09 09 | "word".|.. */...|
|00003e80| 69 66 20 28 75 63 29 20 | 0a 09 09 09 28 76 6f 69 |if (uc) |....(voi|
|00003e90| 64 29 20 73 70 72 69 6e | 74 66 28 63 6f 6d 6d 61 |d) sprin|tf(comma|
|00003ea0| 6e 64 2c 0a 09 09 09 09 | 22 25 73 20 2d 73 20 27 |nd,.....|"%s -s '|
|00003eb0| 5e 5b 25 63 25 63 5d 25 | 73 24 27 20 25 73 20 3e |^[%c%c]%|s$' %s >|
|00003ec0| 20 2f 64 65 76 2f 6e 75 | 6c 6c 22 2c 0a 09 09 09 | /dev/nu|ll",....|
|00003ed0| 09 45 47 52 45 50 2c 20 | 70 61 73 73 77 6f 72 64 |.EGREP, |password|
|00003ee0| 5b 30 5d 2c 20 70 61 73 | 73 77 6f 72 64 5b 30 5d |[0], pas|sword[0]|
|00003ef0| 20 26 20 7e 30 34 30 2c | 0a 09 09 09 09 26 70 61 | & ~040,|.....&pa|
|00003f00| 73 73 77 6f 72 64 5b 31 | 5d 2c 20 64 69 63 74 69 |ssword[1|], dicti|
|00003f10| 6f 6e 61 72 79 29 3b 0a | 09 09 65 6c 73 65 0a 09 |onary);.|..else..|
|00003f20| 09 09 28 76 6f 69 64 29 | 20 73 70 72 69 6e 74 66 |..(void)| sprintf|
|00003f30| 28 63 6f 6d 6d 61 6e 64 | 2c 20 22 25 73 20 2d 73 |(command|, "%s -s|
|00003f40| 20 27 5e 25 73 24 27 20 | 25 73 20 3e 20 2f 64 65 | '^%s$' |%s > /de|
|00003f50| 76 2f 6e 75 6c 6c 22 2c | 0a 09 09 09 09 45 47 52 |v/null",|.....EGR|
|00003f60| 45 50 2c 20 70 61 73 73 | 77 6f 72 64 2c 20 64 69 |EP, pass|word, di|
|00003f70| 63 74 69 6f 6e 61 72 79 | 29 3b 0a 09 09 72 63 20 |ctionary|);...rc |
|00003f80| 3d 20 73 79 73 74 65 6d | 28 63 6f 6d 6d 61 6e 64 |= system|(command|
|00003f90| 29 3b 0a 09 09 69 66 20 | 28 72 63 20 3d 3d 20 30 |);...if |(rc == 0|
|00003fa0| 29 0a 09 09 09 72 65 74 | 75 72 6e 28 50 57 43 4b |)....ret|urn(PWCK|
|00003fb0| 5f 49 4e 44 49 43 54 29 | 3b 0a 09 09 65 6c 73 65 |_INDICT)|;...else|
|00003fc0| 0a 09 09 09 72 65 74 75 | 72 6e 28 50 57 43 4b 5f |....retu|rn(PWCK_|
|00003fd0| 4f 4b 29 3b 0a 09 7d 20 | 0a 09 2f 2a 0a 09 20 2a |OK);..} |../*.. *|
|00003fe0| 20 4c 6f 6f 6b 20 69 6e | 20 74 68 65 20 44 42 4d | Look in| the DBM|
|00003ff0| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 65 20 | version| of the |
|00004000| 64 69 63 74 69 6f 6e 61 | 72 79 2e 0a 09 20 2a 20 |dictiona|ry... * |
|00004010| 4c 6f 6f 6b 20 66 6f 72 | 20 3c 70 61 73 73 77 6f |Look for| <passwo|
|00004020| 72 64 3e 2c 20 74 68 65 | 6e 20 69 66 20 74 68 65 |rd>, the|n if the|
|00004030| 20 66 69 72 73 74 20 6c | 65 74 74 65 72 0a 09 20 | first l|etter.. |
|00004040| 2a 20 69 73 20 63 61 70 | 69 74 61 6c 69 7a 65 64 |* is cap|italized|
|00004050| 2c 20 66 6f 72 63 65 20 | 74 6f 20 6c 6f 77 65 72 |, force |to lower|
|00004060| 20 61 6e 64 20 6c 6f 6f | 6b 20 61 67 61 69 6e 2e | and loo|k again.|
|00004070| 20 20 49 20 64 6f 6e 27 | 74 20 63 61 72 65 0a 09 | I don'|t care..|
|00004080| 20 2a 20 69 66 20 3c 70 | 61 73 73 77 6f 72 64 3e | * if <p|assword>|
|00004090| 20 69 73 20 69 6e 20 74 | 68 65 20 64 69 63 74 69 | is in t|he dicti|
|000040a0| 6f 6e 61 72 79 20 62 75 | 74 20 68 61 73 20 6d 69 |onary bu|t has mi|
|000040b0| 78 65 64 20 63 61 73 65 | 20 6c 65 74 74 65 72 73 |xed case| letters|
|000040c0| 2c 0a 09 20 2a 20 62 75 | 74 20 69 66 20 74 68 65 |,.. * bu|t if the|
|000040d0| 20 66 69 72 73 74 20 6c | 65 74 74 65 72 20 68 61 | first l|etter ha|
|000040e0| 73 20 62 65 65 6e 20 63 | 61 70 69 74 61 6c 69 7a |s been c|apitaliz|
|000040f0| 65 64 2c 20 49 20 63 61 | 72 65 20 62 65 63 61 75 |ed, I ca|re becau|
|00004100| 73 65 0a 09 20 2a 20 74 | 68 61 74 27 73 20 6e 6f |se.. * t|hat's no|
|00004110| 74 20 61 20 73 75 66 66 | 69 63 65 6e 74 20 70 65 |t a suff|icent pe|
|00004120| 72 6d 75 74 61 74 69 6f | 6e 20 74 6f 20 62 65 20 |rmutatio|n to be |
|00004130| 73 65 63 75 72 65 2e 0a | 09 20 2a 2f 0a 09 28 76 |secure..|. */..(v|
|00004140| 6f 69 64 29 20 73 74 72 | 63 70 79 28 70 77 74 65 |oid) str|cpy(pwte|
|00004150| 6d 70 2c 20 70 61 73 73 | 77 6f 72 64 29 3b 0a 09 |mp, pass|word);..|
|00004160| 6b 2e 64 70 74 72 20 3d | 20 70 77 74 65 6d 70 3b |k.dptr =| pwtemp;|
|00004170| 0a 09 6b 2e 64 73 69 7a | 65 20 3d 20 73 74 72 6c |..k.dsiz|e = strl|
|00004180| 65 6e 28 70 77 74 65 6d | 70 29 3b 0a 09 64 20 3d |en(pwtem|p);..d =|
|00004190| 20 64 62 6d 5f 66 65 74 | 63 68 28 64 62 70 2c 20 | dbm_fet|ch(dbp, |
|000041a0| 6b 29 3b 0a 09 69 66 20 | 28 64 2e 64 70 74 72 29 |k);..if |(d.dptr)|
|000041b0| 0a 09 09 72 65 74 75 72 | 6e 77 69 74 68 28 50 57 |...retur|nwith(PW|
|000041c0| 43 4b 5f 49 4e 44 49 43 | 54 29 3b 0a 09 69 66 20 |CK_INDIC|T);..if |
|000041d0| 28 75 63 29 20 7b 0a 09 | 09 70 77 74 65 6d 70 5b |(uc) {..|.pwtemp[|
|000041e0| 30 5d 20 7c 3d 20 30 34 | 30 3b 0a 09 09 64 20 3d |0] |= 04|0;...d =|
|000041f0| 20 64 62 6d 5f 66 65 74 | 63 68 28 64 62 70 2c 20 | dbm_fet|ch(dbp, |
|00004200| 6b 29 3b 0a 09 09 69 66 | 20 28 64 2e 64 70 74 72 |k);...if| (d.dptr|
|00004210| 29 0a 09 09 09 72 65 74 | 75 72 6e 77 69 74 68 28 |)....ret|urnwith(|
|00004220| 50 57 43 4b 5f 49 4e 44 | 49 43 54 29 3b 0a 09 7d |PWCK_IND|ICT);..}|
|00004230| 0a 09 72 65 74 75 72 6e | 77 69 74 68 28 50 57 43 |..return|with(PWC|
|00004240| 4b 5f 4f 4b 29 3b 0a 7d | 0a 23 75 6e 64 65 66 09 |K_OK);.}|.#undef.|
|00004250| 72 65 74 75 72 6e 77 69 | 74 68 0a 0a 0a 2f 2a 0a |returnwi|th.../*.|
|00004260| 20 2a 09 70 77 63 6b 5f | 70 61 73 73 77 6f 72 64 | *.pwck_|password|
|00004270| 20 2d 20 43 68 65 63 6b | 20 70 61 73 73 77 6f 72 | - Check| passwor|
|00004280| 64 20 63 61 6e 64 69 64 | 61 74 65 20 61 67 61 69 |d candid|ate agai|
|00004290| 6e 73 74 20 74 68 65 20 | 75 73 65 72 73 27 20 70 |nst the |users' p|
|000042a0| 61 73 73 77 6f 72 64 0a | 20 2a 09 09 66 69 6c 65 |assword.| *..file|
|000042b0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 2c 20 6f 72 | informa|tion, or|
|000042c0| 20 61 6e 79 20 6f 74 68 | 65 72 20 69 6e 66 6f 72 | any oth|er infor|
|000042d0| 6d 61 74 69 6f 6e 20 74 | 68 61 74 20 69 73 20 70 |mation t|hat is p|
|000042e0| 75 62 6c 69 63 6c 79 0a | 20 2a 09 09 61 76 61 69 |ublicly.| *..avai|
|000042f0| 6c 61 62 6c 65 20 61 62 | 6f 75 74 20 74 68 69 73 |lable ab|out this|
|00004300| 20 75 73 65 72 20 74 68 | 61 74 20 61 20 62 61 6e | user th|at a ban|
|00004310| 64 69 74 20 63 6f 75 6c | 64 20 75 73 65 20 61 73 |dit coul|d use as|
|00004320| 0a 20 2a 09 09 70 61 73 | 73 77 6f 72 64 20 67 75 |. *..pas|sword gu|
|00004330| 65 73 73 65 73 2e 0a 20 | 2a 0a 20 2a 09 48 65 72 |esses.. |*. *.Her|
|00004340| 65 20 69 73 20 74 68 65 | 20 70 6c 61 63 65 20 74 |e is the| place t|
|00004350| 6f 20 73 65 61 72 63 68 | 20 79 6f 75 72 20 27 66 |o search| your 'f|
|00004360| 69 6e 67 65 72 27 20 64 | 61 74 61 62 61 73 65 2e |inger' d|atabase.|
|00004370| 0a 20 2a 2f 0a 23 69 6e | 63 6c 75 64 65 09 3c 70 |. */.#in|clude.<p|
|00004380| 77 64 2e 68 3e 0a 0a 73 | 74 61 74 69 63 20 69 6e |wd.h>..s|tatic in|
|00004390| 74 0a 70 77 63 6b 5f 70 | 61 73 73 77 64 28 70 61 |t.pwck_p|asswd(pa|
|000043a0| 73 73 77 6f 72 64 2c 20 | 75 73 65 72 69 64 29 0a |ssword, |userid).|
|000043b0| 63 68 61 72 09 2a 70 61 | 73 73 77 6f 72 64 3b 0a |char.*pa|ssword;.|
|000043c0| 69 6e 74 09 75 73 65 72 | 69 64 3b 0a 7b 0a 09 63 |int.user|id;.{..c|
|000043d0| 68 61 72 09 74 65 6d 70 | 5b 31 32 38 5d 3b 09 09 |har.temp|[128];..|
|000043e0| 2f 2a 20 53 63 72 61 74 | 63 68 20 2a 2f 0a 09 73 |/* Scrat|ch */..s|
|000043f0| 74 72 75 63 74 20 70 61 | 73 73 77 64 09 2a 70 77 |truct pa|sswd.*pw|
|00004400| 70 3b 09 09 2f 2a 20 50 | 6f 69 6e 74 65 72 20 74 |p;../* P|ointer t|
|00004410| 6f 20 75 73 65 72 20 69 | 6e 66 6f 72 6d 61 74 69 |o user i|nformati|
|00004420| 6f 6e 20 2a 2f 0a 0a 09 | 69 66 20 28 75 73 65 72 |on */...|if (user|
|00004430| 69 64 20 3c 20 30 29 09 | 09 09 2f 2a 20 43 61 6e |id < 0).|../* Can|
|00004440| 27 74 20 64 6f 20 75 73 | 65 72 20 63 68 65 63 6b |'t do us|er check|
|00004450| 73 20 2a 2f 0a 09 09 72 | 65 74 75 72 6e 28 50 57 |s */...r|eturn(PW|
|00004460| 43 4b 5f 4f 4b 29 3b 0a | 0a 09 70 77 70 20 3d 20 |CK_OK);.|..pwp = |
|00004470| 67 65 74 70 77 75 69 64 | 28 75 73 65 72 69 64 29 |getpwuid|(userid)|
|00004480| 3b 0a 09 69 66 20 28 70 | 77 70 20 3d 3d 20 30 29 |;..if (p|wp == 0)|
|00004490| 0a 09 09 72 65 74 75 72 | 6e 28 50 57 43 4b 5f 46 |...retur|n(PWCK_F|
|000044a0| 41 49 4c 29 3b 0a 0a 09 | 74 72 79 28 70 61 73 73 |AIL);...|try(pass|
|000044b0| 77 6f 72 64 2c 20 70 77 | 70 2d 3e 70 77 5f 6e 61 |word, pw|p->pw_na|
|000044c0| 6d 65 2c 20 50 57 43 4b | 5f 4f 42 56 49 4f 55 53 |me, PWCK|_OBVIOUS|
|000044d0| 29 3b 20 2f 2a 20 43 68 | 65 63 6b 73 20 27 6e 61 |); /* Ch|ecks 'na|
|000044e0| 6d 65 27 20 61 6e 64 20 | 27 4e 61 6d 65 27 20 2a |me' and |'Name' *|
|000044f0| 2f 0a 0a 09 28 76 6f 69 | 64 29 20 73 74 72 63 70 |/...(voi|d) strcp|
|00004500| 79 28 74 65 6d 70 2c 20 | 70 77 70 2d 3e 70 77 5f |y(temp, |pwp->pw_|
|00004510| 6e 61 6d 65 29 3b 0a 09 | 28 76 6f 69 64 29 20 73 |name);..|(void) s|
|00004520| 74 72 63 61 74 28 74 65 | 6d 70 2c 20 70 77 70 2d |trcat(te|mp, pwp-|
|00004530| 3e 70 77 5f 6e 61 6d 65 | 29 3b 0a 09 74 72 79 28 |>pw_name|);..try(|
|00004540| 70 61 73 73 77 6f 72 64 | 2c 20 74 65 6d 70 2c 20 |password|, temp, |
|00004550| 50 57 43 4b 5f 4f 42 56 | 49 4f 55 53 29 3b 09 2f |PWCK_OBV|IOUS);./|
|00004560| 2a 20 43 68 65 63 6b 20 | 27 6e 61 6d 65 6e 61 6d |* Check |'namenam|
|00004570| 65 27 20 2a 2f 0a 0a 09 | 28 76 6f 69 64 29 20 73 |e' */...|(void) s|
|00004580| 74 72 63 70 79 28 74 65 | 6d 70 2c 20 70 77 70 2d |trcpy(te|mp, pwp-|
|00004590| 3e 70 77 5f 6e 61 6d 65 | 29 3b 0a 09 4d 69 72 72 |>pw_name|);..Mirr|
|000045a0| 6f 72 53 74 72 69 6e 67 | 28 74 65 6d 70 29 3b 0a |orString|(temp);.|
|000045b0| 09 74 72 79 28 70 61 73 | 73 77 6f 72 64 2c 20 74 |.try(pas|sword, t|
|000045c0| 65 6d 70 2c 20 50 57 43 | 4b 5f 4f 42 56 49 4f 55 |emp, PWC|K_OBVIOU|
|000045d0| 53 29 3b 09 2f 2a 20 27 | 65 6d 61 6e 27 20 2a 2f |S);./* '|eman' */|
|000045e0| 0a 0a 09 2f 2a 0a 09 20 | 2a 20 54 72 79 20 65 76 |.../*.. |* Try ev|
|000045f0| 65 72 79 20 77 6f 72 64 | 20 69 6e 20 75 73 65 72 |ery word| in user|
|00004600| 27 73 20 47 45 43 4f 53 | 20 65 6e 74 72 79 0a 09 |'s GECOS| entry..|
|00004610| 20 2a 2f 0a 09 6d 74 72 | 79 28 70 61 73 73 77 6f | */..mtr|y(passwo|
|00004620| 72 64 2c 20 70 77 70 2d | 3e 70 77 5f 67 65 63 6f |rd, pwp-|>pw_geco|
|00004630| 73 2c 20 50 57 43 4b 5f | 46 49 4e 47 45 52 29 3b |s, PWCK_|FINGER);|
|00004640| 0a 09 72 65 74 75 72 6e | 28 50 57 43 4b 5f 4f 4b |..return|(PWCK_OK|
|00004650| 29 3b 0a 7d 0a 2f 2a 20 | 2d 2d 2d 2d 2d 2d 2d 2d |);.}./* |--------|
|00004660| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004670| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0a 2f |--------|--- */./|
|000046a0| 2a 0a 20 2a 09 53 74 72 | 41 6c 6c 43 6d 70 20 2d |*. *.Str|AllCmp -|
|000046b0| 20 43 6f 6d 70 61 72 65 | 20 61 6c 6c 20 73 75 62 | Compare| all sub|
|000046c0| 2d 73 74 72 69 6e 67 73 | 20 28 64 65 6c 69 6e 65 |-strings| (deline|
|000046d0| 61 74 65 64 20 62 79 20 | 77 68 69 74 65 20 73 70 |ated by |white sp|
|000046e0| 61 63 65 29 0a 20 2a 0a | 20 2a 09 52 65 74 75 72 |ace). *.| *.Retur|
|000046f0| 6e 73 3a 0a 20 2a 09 09 | 50 57 43 4b 5f 4f 4b 20 |ns:. *..|PWCK_OK |
|00004700| 69 66 20 6e 6f 20 6d 61 | 74 63 68 20 66 6f 75 6e |if no ma|tch foun|
|00004710| 64 0a 20 2a 09 09 72 63 | 20 69 66 20 6d 61 74 63 |d. *..rc| if matc|
|00004720| 68 20 66 6f 75 6e 64 0a | 20 2a 2f 0a 4c 4f 43 41 |h found.| */.LOCA|
|00004730| 4c 0a 53 74 72 41 6c 6c | 43 6d 70 28 73 31 2c 20 |L.StrAll|Cmp(s1, |
|00004740| 73 32 2c 20 72 63 29 0a | 63 68 61 72 09 2a 73 31 |s2, rc).|char.*s1|
|00004750| 2c 09 09 2f 2a 20 53 74 | 72 69 6e 67 20 74 6f 20 |,../* St|ring to |
|00004760| 6c 6f 6f 6b 20 66 6f 72 | 20 2a 2f 0a 09 2a 73 32 |look for| */..*s2|
|00004770| 3b 09 09 2f 2a 20 53 74 | 72 69 6e 67 20 74 6f 20 |;../* St|ring to |
|00004780| 6c 6f 6f 6b 20 66 6f 72 | 20 3c 73 31 3e 20 69 6e |look for| <s1> in|
|00004790| 20 2a 2f 0a 69 6e 74 09 | 72 63 3b 09 09 2f 2a 20 | */.int.|rc;../* |
|000047a0| 57 68 61 74 20 74 6f 20 | 72 65 74 75 72 6e 20 6f |What to |return o|
|000047b0| 6e 20 6d 61 74 63 68 20 | 2a 2f 0a 7b 0a 09 69 6e |n match |*/.{..in|
|000047c0| 74 09 6c 3b 09 09 2f 2a | 20 54 65 6d 70 20 2a 2f |t.l;../*| Temp */|
|000047d0| 0a 0a 09 66 6f 72 20 28 | 6c 20 3d 20 73 74 72 6c |...for (|l = strl|
|000047e0| 65 6e 28 73 31 29 3b 20 | 2a 73 32 3b 20 73 32 2b |en(s1); |*s2; s2+|
|000047f0| 2b 29 0a 09 09 69 66 20 | 28 63 69 73 74 72 6e 63 |+)...if |(cistrnc|
|00004800| 6d 70 28 73 31 2c 20 73 | 32 2c 20 6c 29 20 3d 3d |mp(s1, s|2, l) ==|
|00004810| 20 30 29 0a 09 09 09 72 | 65 74 75 72 6e 20 28 72 | 0)....r|eturn (r|
|00004820| 63 29 3b 0a 09 72 65 74 | 75 72 6e 28 50 57 43 4b |c);..ret|urn(PWCK|
|00004830| 5f 4f 4b 29 3b 0a 7d 0a | 0a 2f 2a 0a 20 2a 09 4d |_OK);.}.|./*. *.M|
|00004840| 69 72 72 6f 72 53 74 72 | 69 6e 67 20 2d 20 72 65 |irrorStr|ing - re|
|00004850| 76 65 72 73 65 20 61 20 | 73 74 72 69 6e 67 20 69 |verse a |string i|
|00004860| 6e 20 70 6c 61 63 65 0a | 20 2a 2f 0a 4c 4f 43 41 |n place.| */.LOCA|
|00004870| 4c 0a 4d 69 72 72 6f 72 | 53 74 72 69 6e 67 28 73 |L.Mirror|String(s|
|00004880| 29 0a 63 68 61 72 09 2a | 73 3b 09 09 2f 2a 20 53 |).char.*|s;../* S|
|00004890| 74 72 69 6e 67 20 74 6f | 20 72 65 76 65 72 73 65 |tring to| reverse|
|000048a0| 20 2a 2f 0a 7b 0a 09 63 | 68 61 72 09 2a 70 3b 09 | */.{..c|har.*p;.|
|000048b0| 2f 2a 20 53 63 72 61 74 | 63 68 20 2a 2f 0a 09 63 |/* Scrat|ch */..c|
|000048c0| 68 61 72 09 74 5b 31 32 | 38 5d 3b 09 2f 2a 20 53 |har.t[12|8];./* S|
|000048d0| 63 72 61 74 63 68 20 2a | 2f 0a 09 0a 09 28 76 6f |cratch *|/....(vo|
|000048e0| 69 64 29 20 73 74 72 63 | 70 79 28 74 2c 73 29 3b |id) strc|py(t,s);|
|000048f0| 0a 09 70 20 3d 20 74 3b | 0a 09 77 68 69 6c 65 20 |..p = t;|..while |
|00004900| 28 2a 70 29 20 70 2b 2b | 3b 09 09 2f 2a 20 46 69 |(*p) p++|;../* Fi|
|00004910| 6e 64 20 65 6e 64 20 6f | 66 20 73 74 72 69 6e 67 |nd end o|f string|
|00004920| 20 2a 2f 0a 09 2d 2d 70 | 3b 0a 09 66 6f 72 20 28 | */..--p|;..for (|
|00004930| 3b 20 2a 73 3b 20 29 0a | 09 09 2a 73 2b 2b 20 3d |; *s; ).|..*s++ =|
|00004940| 20 2a 70 2d 2d 3b 0a 7d | 0a 0a 2f 2a 0a 20 2a 09 | *p--;.}|../*. *.|
|00004950| 43 61 73 65 20 69 6e 64 | 65 70 65 64 61 6e 74 20 |Case ind|epedant |
|00004960| 73 74 72 69 6e 67 20 63 | 6f 6d 70 61 72 61 73 69 |string c|omparasi|
|00004970| 6f 6e 20 72 6f 75 74 69 | 6e 65 73 20 73 77 69 70 |on routi|nes swip|
|00004980| 65 64 20 66 72 6f 6d 0a | 20 2a 09 74 68 65 20 73 |ed from.| *.the s|
|00004990| 6f 75 72 63 65 20 74 6f | 20 4d 49 54 20 48 65 73 |ource to| MIT Hes|
|000049a0| 69 6f 64 2e 0a 20 2a 2f | 0a 2f 2a 0a 20 2a 20 43 |iod.. */|./*. * C|
|000049b0| 6f 70 79 72 69 67 68 74 | 20 28 63 29 20 31 39 38 |opyright| (c) 198|
|000049c0| 36 20 52 65 67 65 6e 74 | 73 20 6f 66 20 74 68 65 |6 Regent|s of the|
|000049d0| 20 55 6e 69 76 65 72 73 | 69 74 79 20 6f 66 20 43 | Univers|ity of C|
|000049e0| 61 6c 69 66 6f 72 6e 69 | 61 2e 0a 20 2a 20 41 6c |aliforni|a.. * Al|
|000049f0| 6c 20 72 69 67 68 74 73 | 20 72 65 73 65 72 76 65 |l rights| reserve|
|00004a00| 64 2e 20 20 54 68 65 20 | 42 65 72 6b 65 6c 65 79 |d. The |Berkeley|
|00004a10| 20 73 6f 66 74 77 61 72 | 65 20 4c 69 63 65 6e 73 | softwar|e Licens|
|00004a20| 65 20 41 67 72 65 65 6d | 65 6e 74 0a 20 2a 20 73 |e Agreem|ent. * s|
|00004a30| 70 65 63 69 66 69 65 73 | 20 74 68 65 20 74 65 72 |pecifies| the ter|
|00004a40| 6d 73 20 61 6e 64 20 63 | 6f 6e 64 69 74 69 6f 6e |ms and c|ondition|
|00004a50| 73 20 66 6f 72 20 72 65 | 64 69 73 74 72 69 62 75 |s for re|distribu|
|00004a60| 74 69 6f 6e 2e 0a 20 2a | 2f 0a 0a 2f 2a 0a 20 2a |tion.. *|/../*. *|
|00004a70| 20 54 68 69 73 20 61 72 | 72 61 79 20 69 73 20 64 | This ar|ray is d|
|00004a80| 65 73 69 67 6e 65 64 20 | 66 6f 72 20 6d 61 70 70 |esigned |for mapp|
|00004a90| 69 6e 67 20 75 70 70 65 | 72 20 61 6e 64 20 6c 6f |ing uppe|r and lo|
|00004aa0| 77 65 72 20 63 61 73 65 | 20 6c 65 74 74 65 72 0a |wer case| letter.|
|00004ab0| 20 2a 20 74 6f 67 65 74 | 68 65 72 20 66 6f 72 20 | * toget|her for |
|00004ac0| 61 20 63 61 73 65 20 69 | 6e 64 65 70 65 6e 64 65 |a case i|ndepende|
|00004ad0| 6e 74 20 63 6f 6d 70 61 | 72 69 73 6f 6e 2e 20 20 |nt compa|rison. |
|00004ae0| 54 68 65 20 6d 61 70 70 | 69 6e 67 73 20 61 72 65 |The mapp|ings are|
|00004af0| 0a 20 2a 20 62 61 73 65 | 64 20 75 70 6f 6e 20 61 |. * base|d upon a|
|00004b00| 73 63 69 69 20 63 68 61 | 72 61 63 74 65 72 20 73 |scii cha|racter s|
|00004b10| 65 71 75 65 6e 63 65 73 | 2e 0a 20 2a 2f 0a 0a 4c |equences|.. */..L|
|00004b20| 4f 43 41 4c 20 63 68 61 | 72 20 63 68 61 72 6d 61 |OCAL cha|r charma|
|00004b30| 70 5b 5d 20 3d 20 7b 0a | 09 27 5c 30 30 30 27 2c |p[] = {.|.'\000',|
|00004b40| 20 27 5c 30 30 31 27 2c | 20 27 5c 30 30 32 27 2c | '\001',| '\002',|
|00004b50| 20 27 5c 30 30 33 27 2c | 20 27 5c 30 30 34 27 2c | '\003',| '\004',|
|00004b60| 20 27 5c 30 30 35 27 2c | 20 27 5c 30 30 36 27 2c | '\005',| '\006',|
|00004b70| 20 27 5c 30 30 37 27 2c | 0a 09 27 5c 30 31 30 27 | '\007',|..'\010'|
|00004b80| 2c 20 27 5c 30 31 31 27 | 2c 20 27 5c 30 31 32 27 |, '\011'|, '\012'|
|00004b90| 2c 20 27 5c 30 31 33 27 | 2c 20 27 5c 30 31 34 27 |, '\013'|, '\014'|
|00004ba0| 2c 20 27 5c 30 31 35 27 | 2c 20 27 5c 30 31 36 27 |, '\015'|, '\016'|
|00004bb0| 2c 20 27 5c 30 31 37 27 | 2c 0a 09 27 5c 30 32 30 |, '\017'|,..'\020|
|00004bc0| 27 2c 20 27 5c 30 32 31 | 27 2c 20 27 5c 30 32 32 |', '\021|', '\022|
|00004bd0| 27 2c 20 27 5c 30 32 33 | 27 2c 20 27 5c 30 32 34 |', '\023|', '\024|
|00004be0| 27 2c 20 27 5c 30 32 35 | 27 2c 20 27 5c 30 32 36 |', '\025|', '\026|
|00004bf0| 27 2c 20 27 5c 30 32 37 | 27 2c 0a 09 27 5c 30 33 |', '\027|',..'\03|
|00004c00| 30 27 2c 20 27 5c 30 33 | 31 27 2c 20 27 5c 30 33 |0', '\03|1', '\03|
|00004c10| 32 27 2c 20 27 5c 30 33 | 33 27 2c 20 27 5c 30 33 |2', '\03|3', '\03|
|00004c20| 34 27 2c 20 27 5c 30 33 | 35 27 2c 20 27 5c 30 33 |4', '\03|5', '\03|
|00004c30| 36 27 2c 20 27 5c 30 33 | 37 27 2c 0a 09 27 5c 30 |6', '\03|7',..'\0|
|00004c40| 34 30 27 2c 20 27 5c 30 | 34 31 27 2c 20 27 5c 30 |40', '\0|41', '\0|
|00004c50| 34 32 27 2c 20 27 5c 30 | 34 33 27 2c 20 27 5c 30 |42', '\0|43', '\0|
|00004c60| 34 34 27 2c 20 27 5c 30 | 34 35 27 2c 20 27 5c 30 |44', '\0|45', '\0|
|00004c70| 34 36 27 2c 20 27 5c 30 | 34 37 27 2c 0a 09 27 5c |46', '\0|47',..'\|
|00004c80| 30 35 30 27 2c 20 27 5c | 30 35 31 27 2c 20 27 5c |050', '\|051', '\|
|00004c90| 30 35 32 27 2c 20 27 5c | 30 35 33 27 2c 20 27 5c |052', '\|053', '\|
|00004ca0| 30 35 34 27 2c 20 27 5c | 30 35 35 27 2c 20 27 5c |054', '\|055', '\|
|00004cb0| 30 35 36 27 2c 20 27 5c | 30 35 37 27 2c 0a 09 27 |056', '\|057',..'|
|00004cc0| 5c 30 36 30 27 2c 20 27 | 5c 30 36 31 27 2c 20 27 |\060', '|\061', '|
|00004cd0| 5c 30 36 32 27 2c 20 27 | 5c 30 36 33 27 2c 20 27 |\062', '|\063', '|
|00004ce0| 5c 30 36 34 27 2c 20 27 | 5c 30 36 35 27 2c 20 27 |\064', '|\065', '|
|00004cf0| 5c 30 36 36 27 2c 20 27 | 5c 30 36 37 27 2c 0a 09 |\066', '|\067',..|
|00004d00| 27 5c 30 37 30 27 2c 20 | 27 5c 30 37 31 27 2c 20 |'\070', |'\071', |
|00004d10| 27 5c 30 37 32 27 2c 20 | 27 5c 30 37 33 27 2c 20 |'\072', |'\073', |
|00004d20| 27 5c 30 37 34 27 2c 20 | 27 5c 30 37 35 27 2c 20 |'\074', |'\075', |
|00004d30| 27 5c 30 37 36 27 2c 20 | 27 5c 30 37 37 27 2c 0a |'\076', |'\077',.|
|00004d40| 09 27 5c 31 30 30 27 2c | 20 27 5c 31 34 31 27 2c |.'\100',| '\141',|
|00004d50| 20 27 5c 31 34 32 27 2c | 20 27 5c 31 34 33 27 2c | '\142',| '\143',|
|00004d60| 20 27 5c 31 34 34 27 2c | 20 27 5c 31 34 35 27 2c | '\144',| '\145',|
|00004d70| 20 27 5c 31 34 36 27 2c | 20 27 5c 31 34 37 27 2c | '\146',| '\147',|
|00004d80| 0a 09 27 5c 31 35 30 27 | 2c 20 27 5c 31 35 31 27 |..'\150'|, '\151'|
|00004d90| 2c 20 27 5c 31 35 32 27 | 2c 20 27 5c 31 35 33 27 |, '\152'|, '\153'|
|00004da0| 2c 20 27 5c 31 35 34 27 | 2c 20 27 5c 31 35 35 27 |, '\154'|, '\155'|
|00004db0| 2c 20 27 5c 31 35 36 27 | 2c 20 27 5c 31 35 37 27 |, '\156'|, '\157'|
|00004dc0| 2c 0a 09 27 5c 31 36 30 | 27 2c 20 27 5c 31 36 31 |,..'\160|', '\161|
|00004dd0| 27 2c 20 27 5c 31 36 32 | 27 2c 20 27 5c 31 36 33 |', '\162|', '\163|
|00004de0| 27 2c 20 27 5c 31 36 34 | 27 2c 20 27 5c 31 36 35 |', '\164|', '\165|
|00004df0| 27 2c 20 27 5c 31 36 36 | 27 2c 20 27 5c 31 36 37 |', '\166|', '\167|
|00004e00| 27 2c 0a 09 27 5c 31 37 | 30 27 2c 20 27 5c 31 37 |',..'\17|0', '\17|
|00004e10| 31 27 2c 20 27 5c 31 37 | 32 27 2c 20 27 5c 31 33 |1', '\17|2', '\13|
|00004e20| 33 27 2c 20 27 5c 31 33 | 34 27 2c 20 27 5c 31 33 |3', '\13|4', '\13|
|00004e30| 35 27 2c 20 27 5c 31 33 | 36 27 2c 20 27 5c 31 33 |5', '\13|6', '\13|
|00004e40| 37 27 2c 0a 09 27 5c 31 | 34 30 27 2c 20 27 5c 31 |7',..'\1|40', '\1|
|00004e50| 34 31 27 2c 20 27 5c 31 | 34 32 27 2c 20 27 5c 31 |41', '\1|42', '\1|
|00004e60| 34 33 27 2c 20 27 5c 31 | 34 34 27 2c 20 27 5c 31 |43', '\1|44', '\1|
|00004e70| 34 35 27 2c 20 27 5c 31 | 34 36 27 2c 20 27 5c 31 |45', '\1|46', '\1|
|00004e80| 34 37 27 2c 0a 09 27 5c | 31 35 30 27 2c 20 27 5c |47',..'\|150', '\|
|00004e90| 31 35 31 27 2c 20 27 5c | 31 35 32 27 2c 20 27 5c |151', '\|152', '\|
|00004ea0| 31 35 33 27 2c 20 27 5c | 31 35 34 27 2c 20 27 5c |153', '\|154', '\|
|00004eb0| 31 35 35 27 2c 20 27 5c | 31 35 36 27 2c 20 27 5c |155', '\|156', '\|
|00004ec0| 31 35 37 27 2c 0a 09 27 | 5c 31 36 30 27 2c 20 27 |157',..'|\160', '|
|00004ed0| 5c 31 36 31 27 2c 20 27 | 5c 31 36 32 27 2c 20 27 |\161', '|\162', '|
|00004ee0| 5c 31 36 33 27 2c 20 27 | 5c 31 36 34 27 2c 20 27 |\163', '|\164', '|
|00004ef0| 5c 31 36 35 27 2c 20 27 | 5c 31 36 36 27 2c 20 27 |\165', '|\166', '|
|00004f00| 5c 31 36 37 27 2c 0a 09 | 27 5c 31 37 30 27 2c 20 |\167',..|'\170', |
|00004f10| 27 5c 31 37 31 27 2c 20 | 27 5c 31 37 32 27 2c 20 |'\171', |'\172', |
|00004f20| 27 5c 31 37 33 27 2c 20 | 27 5c 31 37 34 27 2c 20 |'\173', |'\174', |
|00004f30| 27 5c 31 37 35 27 2c 20 | 27 5c 31 37 36 27 2c 20 |'\175', |'\176', |
|00004f40| 27 5c 31 37 37 27 2c 0a | 09 27 5c 32 30 30 27 2c |'\177',.|.'\200',|
|00004f50| 20 27 5c 32 30 31 27 2c | 20 27 5c 32 30 32 27 2c | '\201',| '\202',|
|00004f60| 20 27 5c 32 30 33 27 2c | 20 27 5c 32 30 34 27 2c | '\203',| '\204',|
|00004f70| 20 27 5c 32 30 35 27 2c | 20 27 5c 32 30 36 27 2c | '\205',| '\206',|
|00004f80| 20 27 5c 32 30 37 27 2c | 0a 09 27 5c 32 31 30 27 | '\207',|..'\210'|
|00004f90| 2c 20 27 5c 32 31 31 27 | 2c 20 27 5c 32 31 32 27 |, '\211'|, '\212'|
|00004fa0| 2c 20 27 5c 32 31 33 27 | 2c 20 27 5c 32 31 34 27 |, '\213'|, '\214'|
|00004fb0| 2c 20 27 5c 32 31 35 27 | 2c 20 27 5c 32 31 36 27 |, '\215'|, '\216'|
|00004fc0| 2c 20 27 5c 32 31 37 27 | 2c 0a 09 27 5c 32 32 30 |, '\217'|,..'\220|
|00004fd0| 27 2c 20 27 5c 32 32 31 | 27 2c 20 27 5c 32 32 32 |', '\221|', '\222|
|00004fe0| 27 2c 20 27 5c 32 32 33 | 27 2c 20 27 5c 32 32 34 |', '\223|', '\224|
|00004ff0| 27 2c 20 27 5c 32 32 35 | 27 2c 20 27 5c 32 32 36 |', '\225|', '\226|
|00005000| 27 2c 20 27 5c 32 32 37 | 27 2c 0a 09 27 5c 32 33 |', '\227|',..'\23|
|00005010| 30 27 2c 20 27 5c 32 33 | 31 27 2c 20 27 5c 32 33 |0', '\23|1', '\23|
|00005020| 32 27 2c 20 27 5c 32 33 | 33 27 2c 20 27 5c 32 33 |2', '\23|3', '\23|
|00005030| 34 27 2c 20 27 5c 32 33 | 35 27 2c 20 27 5c 32 33 |4', '\23|5', '\23|
|00005040| 36 27 2c 20 27 5c 32 33 | 37 27 2c 0a 09 27 5c 32 |6', '\23|7',..'\2|
|00005050| 34 30 27 2c 20 27 5c 32 | 34 31 27 2c 20 27 5c 32 |40', '\2|41', '\2|
|00005060| 34 32 27 2c 20 27 5c 32 | 34 33 27 2c 20 27 5c 32 |42', '\2|43', '\2|
|00005070| 34 34 27 2c 20 27 5c 32 | 34 35 27 2c 20 27 5c 32 |44', '\2|45', '\2|
|00005080| 34 36 27 2c 20 27 5c 32 | 34 37 27 2c 0a 09 27 5c |46', '\2|47',..'\|
|00005090| 32 35 30 27 2c 20 27 5c | 32 35 31 27 2c 20 27 5c |250', '\|251', '\|
|000050a0| 32 35 32 27 2c 20 27 5c | 32 35 33 27 2c 20 27 5c |252', '\|253', '\|
|000050b0| 32 35 34 27 2c 20 27 5c | 32 35 35 27 2c 20 27 5c |254', '\|255', '\|
|000050c0| 32 35 36 27 2c 20 27 5c | 32 35 37 27 2c 0a 09 27 |256', '\|257',..'|
|000050d0| 5c 32 36 30 27 2c 20 27 | 5c 32 36 31 27 2c 20 27 |\260', '|\261', '|
|000050e0| 5c 32 36 32 27 2c 20 27 | 5c 32 36 33 27 2c 20 27 |\262', '|\263', '|
|000050f0| 5c 32 36 34 27 2c 20 27 | 5c 32 36 35 27 2c 20 27 |\264', '|\265', '|
|00005100| 5c 32 36 36 27 2c 20 27 | 5c 32 36 37 27 2c 0a 09 |\266', '|\267',..|
|00005110| 27 5c 32 37 30 27 2c 20 | 27 5c 32 37 31 27 2c 20 |'\270', |'\271', |
|00005120| 27 5c 32 37 32 27 2c 20 | 27 5c 32 37 33 27 2c 20 |'\272', |'\273', |
|00005130| 27 5c 32 37 34 27 2c 20 | 27 5c 32 37 35 27 2c 20 |'\274', |'\275', |
|00005140| 27 5c 32 37 36 27 2c 20 | 27 5c 32 37 37 27 2c 0a |'\276', |'\277',.|
|00005150| 09 27 5c 33 30 30 27 2c | 20 27 5c 33 34 31 27 2c |.'\300',| '\341',|
|00005160| 20 27 5c 33 34 32 27 2c | 20 27 5c 33 34 33 27 2c | '\342',| '\343',|
|00005170| 20 27 5c 33 34 34 27 2c | 20 27 5c 33 34 35 27 2c | '\344',| '\345',|
|00005180| 20 27 5c 33 34 36 27 2c | 20 27 5c 33 34 37 27 2c | '\346',| '\347',|
|00005190| 0a 09 27 5c 33 35 30 27 | 2c 20 27 5c 33 35 31 27 |..'\350'|, '\351'|
|000051a0| 2c 20 27 5c 33 35 32 27 | 2c 20 27 5c 33 35 33 27 |, '\352'|, '\353'|
|000051b0| 2c 20 27 5c 33 35 34 27 | 2c 20 27 5c 33 35 35 27 |, '\354'|, '\355'|
|000051c0| 2c 20 27 5c 33 35 36 27 | 2c 20 27 5c 33 35 37 27 |, '\356'|, '\357'|
|000051d0| 2c 0a 09 27 5c 33 36 30 | 27 2c 20 27 5c 33 36 31 |,..'\360|', '\361|
|000051e0| 27 2c 20 27 5c 33 36 32 | 27 2c 20 27 5c 33 36 33 |', '\362|', '\363|
|000051f0| 27 2c 20 27 5c 33 36 34 | 27 2c 20 27 5c 33 36 35 |', '\364|', '\365|
|00005200| 27 2c 20 27 5c 33 36 36 | 27 2c 20 27 5c 33 36 37 |', '\366|', '\367|
|00005210| 27 2c 0a 09 27 5c 33 37 | 30 27 2c 20 27 5c 33 37 |',..'\37|0', '\37|
|00005220| 31 27 2c 20 27 5c 33 37 | 32 27 2c 20 27 5c 33 33 |1', '\37|2', '\33|
|00005230| 33 27 2c 20 27 5c 33 33 | 34 27 2c 20 27 5c 33 33 |3', '\33|4', '\33|
|00005240| 35 27 2c 20 27 5c 33 33 | 36 27 2c 20 27 5c 33 33 |5', '\33|6', '\33|
|00005250| 37 27 2c 0a 09 27 5c 33 | 34 30 27 2c 20 27 5c 33 |7',..'\3|40', '\3|
|00005260| 34 31 27 2c 20 27 5c 33 | 34 32 27 2c 20 27 5c 33 |41', '\3|42', '\3|
|00005270| 34 33 27 2c 20 27 5c 33 | 34 34 27 2c 20 27 5c 33 |43', '\3|44', '\3|
|00005280| 34 35 27 2c 20 27 5c 33 | 34 36 27 2c 20 27 5c 33 |45', '\3|46', '\3|
|00005290| 34 37 27 2c 0a 09 27 5c | 33 35 30 27 2c 20 27 5c |47',..'\|350', '\|
|000052a0| 33 35 31 27 2c 20 27 5c | 33 35 32 27 2c 20 27 5c |351', '\|352', '\|
|000052b0| 33 35 33 27 2c 20 27 5c | 33 35 34 27 2c 20 27 5c |353', '\|354', '\|
|000052c0| 33 35 35 27 2c 20 27 5c | 33 35 36 27 2c 20 27 5c |355', '\|356', '\|
|000052d0| 33 35 37 27 2c 0a 09 27 | 5c 33 36 30 27 2c 20 27 |357',..'|\360', '|
|000052e0| 5c 33 36 31 27 2c 20 27 | 5c 33 36 32 27 2c 20 27 |\361', '|\362', '|
|000052f0| 5c 33 36 33 27 2c 20 27 | 5c 33 36 34 27 2c 20 27 |\363', '|\364', '|
|00005300| 5c 33 36 35 27 2c 20 27 | 5c 33 36 36 27 2c 20 27 |\365', '|\366', '|
|00005310| 5c 33 36 37 27 2c 0a 09 | 27 5c 33 37 30 27 2c 20 |\367',..|'\370', |
|00005320| 27 5c 33 37 31 27 2c 20 | 27 5c 33 37 32 27 2c 20 |'\371', |'\372', |
|00005330| 27 5c 33 37 33 27 2c 20 | 27 5c 33 37 34 27 2c 20 |'\373', |'\374', |
|00005340| 27 5c 33 37 35 27 2c 20 | 27 5c 33 37 36 27 2c 20 |'\375', |'\376', |
|00005350| 27 5c 33 37 37 27 2c 0a | 7d 3b 0a 0a 4c 4f 43 41 |'\377',.|};..LOCA|
|00005360| 4c 0a 63 69 73 74 72 63 | 6d 70 28 73 31 2c 20 73 |L.cistrc|mp(s1, s|
|00005370| 32 29 0a 72 65 67 69 73 | 74 65 72 20 63 68 61 72 |2).regis|ter char|
|00005380| 20 2a 73 31 2c 20 2a 73 | 32 3b 0a 7b 0a 09 72 65 | *s1, *s|2;.{..re|
|00005390| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 63 6d 20 |gister c|har *cm |
|000053a0| 3d 20 63 68 61 72 6d 61 | 70 3b 0a 0a 09 77 68 69 |= charma|p;...whi|
|000053b0| 6c 65 20 28 63 6d 5b 2a | 73 31 5d 20 3d 3d 20 63 |le (cm[*|s1] == c|
|000053c0| 6d 5b 2a 73 32 2b 2b 5d | 29 0a 09 09 69 66 20 28 |m[*s2++]|)...if (|
|000053d0| 2a 73 31 2b 2b 3d 3d 27 | 5c 30 27 29 0a 09 09 09 |*s1++=='|\0')....|
|000053e0| 72 65 74 75 72 6e 28 30 | 29 3b 0a 09 72 65 74 75 |return(0|);..retu|
|000053f0| 72 6e 28 63 6d 5b 2a 73 | 31 5d 20 2d 20 63 6d 5b |rn(cm[*s|1] - cm[|
|00005400| 2a 2d 2d 73 32 5d 29 3b | 0a 7d 0a 0a 4c 4f 43 41 |*--s2]);|.}..LOCA|
|00005410| 4c 0a 63 69 73 74 72 6e | 63 6d 70 28 73 31 2c 20 |L.cistrn|cmp(s1, |
|00005420| 73 32 2c 20 6e 29 0a 72 | 65 67 69 73 74 65 72 20 |s2, n).r|egister |
|00005430| 63 68 61 72 20 2a 73 31 | 2c 20 2a 73 32 3b 0a 72 |char *s1|, *s2;.r|
|00005440| 65 67 69 73 74 65 72 20 | 6e 3b 0a 7b 0a 09 72 65 |egister |n;.{..re|
|00005450| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 63 6d 20 |gister c|har *cm |
|00005460| 3d 20 63 68 61 72 6d 61 | 70 3b 0a 0a 09 77 68 69 |= charma|p;...whi|
|00005470| 6c 65 20 28 2d 2d 6e 20 | 3e 3d 20 30 20 26 26 20 |le (--n |>= 0 && |
|00005480| 63 6d 5b 2a 73 31 5d 20 | 3d 3d 20 63 6d 5b 2a 73 |cm[*s1] |== cm[*s|
|00005490| 32 2b 2b 5d 29 0a 09 09 | 69 66 20 28 2a 73 31 2b |2++])...|if (*s1+|
|000054a0| 2b 20 3d 3d 20 27 5c 30 | 27 29 0a 09 09 09 72 65 |+ == '\0|')....re|
|000054b0| 74 75 72 6e 28 30 29 3b | 0a 09 72 65 74 75 72 6e |turn(0);|..return|
|000054c0| 28 6e 3c 30 20 3f 20 30 | 20 3a 20 63 6d 5b 2a 73 |(n<0 ? 0| : cm[*s|
|000054d0| 31 5d 20 2d 20 63 6d 5b | 2a 2d 2d 73 32 5d 29 3b |1] - cm[|*--s2]);|
|000054e0| 0a 7d 0a 0a 2f 2a 20 45 | 4e 44 20 2a 2f 0a 20 50 |.}../* E|ND */. P|
|000054f0| 5f 4c 29 29 09 72 65 74 | 75 72 6e 28 50 57 43 4b |_L)).ret|urn(PWCK|
|00005500| 5f 4f 4b 29 3b 09 2f 2a | 20 55 43 2b 6c 63 20 2a |_OK);./*| UC+lc *|
|00005510| 2f 0a 09 69 66 20 28 68 | 61 73 61 6e 79 28 50 5f |/..if (h|asany(P_|
|00005520| 44 29 29 09 72 65 74 75 | 72 6e 28 50 57 43 4b 5f |D)).retu|rn(PWCK_|
|00005530| 4f 4b 29 3b 09 2f 2a 20 | 4e 75 6d 62 65 72 73 20 |OK);./* |Numbers |
|00005540| 2a 2f 0a 09 69 66 20 28 | 68 61 73 61 6e 79 28 50 |*/..if (|hasany(P|
|00005550| 5f 50 29 29 09 72 65 74 | 75 72 6e 28 50 57 43 4b |_P)).ret|urn(PWCK|
|00005560| 5f 4f 4b 29 3b 09 2f 2a | 20 50 75 6e 63 74 75 74 |_OK);./*| Punctut|
|00005570| 61 74 69 6f 6e 20 63 68 | 61 72 73 20 2a 2f 0a 09 |ation ch|ars */..|
|00005580| 69 66 20 28 68 61 73 61 | 6e 79 28 50 5f 43 29 29 |if (hasa|ny(P_C))|
|00005590| 09 72 65 74 75 72 6e 28 | 50 57 43 4b 5f 4f 4b 29 |.return(|PWCK_OK)|
|000055a0| 3b 09 2f 2a 20 43 6f 6e | 74 72 6f 6c 20 63 68 61 |;./* Con|trol cha|
|000055b0| 72 73 20 2a 2f 0a 09 2f | 2a 0a 09 20 2a 09 43 68 |rs */../|*.. *.Ch|
|000055c0| 65 63 6b 20 66 6f 72 20 | 6d 6f 6e 6f 2d 63 61 73 |eck for |mono-cas|
|000055d0| 65 20 70 61 73 73 77 6f | 72 64 73 20 0a 09 20 2a |e passwo|rds .. *|
|000055e0| 2f 0a 09 69 66 20 28 21 | 68 61 73 61 6e 79 28 50 |/..if (!|hasany(P|
|000055f0| 5f 55 29 20 26 26 20 6d | 63 6f 6b 29 09 2f 2a 20 |_U) && m|cok)./* |
|00005600| 63 68 6b 70 77 64 2f 6d | 61 6b 65 64 69 63 74 2e |chkpwd/m|akedict.|
|00005610| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00005620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005660| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005670| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00005680| 20 20 20 31 32 31 35 20 | 20 34 34 32 36 31 30 36 | 1215 | 4426106|
|00005690| 36 32 34 20 20 20 37 33 | 31 32 00 20 00 00 00 00 |624 73|12. ....|
|000056a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000056f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000057f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005800| 2f 2a 0a 20 2a 09 6d 61 | 6b 65 64 69 63 74 20 2d |/*. *.ma|kedict -|
|00005810| 20 4d 61 6b 65 20 44 42 | 4d 20 76 65 72 73 69 6f | Make DB|M versio|
|00005820| 6e 20 6f 66 20 70 61 73 | 73 77 6f 72 64 20 64 69 |n of pas|sword di|
|00005830| 63 74 69 6f 6e 61 72 79 | 0a 20 2a 2f 0a 0a 23 69 |ctionary|. */..#i|
|00005840| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 66 69 6c 65 |nclude <|sys/file|
|00005850| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|00005860| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00005870| 3c 6e 64 62 6d 2e 68 3e | 0a 0a 65 78 74 65 72 6e |<ndbm.h>|..extern|
|00005880| 20 63 68 61 72 09 2a 69 | 6e 64 65 78 28 29 3b 0a | char.*i|ndex();.|
|00005890| 0a 63 68 61 72 09 6c 69 | 6e 65 5b 38 30 5d 3b 0a |.char.li|ne[80];.|
|000058a0| 0a 6d 61 69 6e 28 61 72 | 67 63 2c 20 61 72 67 76 |.main(ar|gc, argv|
|000058b0| 29 0a 63 68 61 72 09 2a | 61 72 67 76 5b 5d 3b 0a |).char.*|argv[];.|
|000058c0| 7b 0a 09 44 42 4d 09 2a | 64 70 3b 0a 09 69 6e 74 |{..DBM.*|dp;..int|
|000058d0| 09 72 65 63 73 20 3d 20 | 30 3b 0a 09 64 61 74 75 |.recs = |0;..datu|
|000058e0| 6d 09 64 2c 0a 09 09 6b | 3b 0a 0a 09 64 70 20 3d |m.d,...k|;...dp =|
|000058f0| 20 64 62 6d 5f 6f 70 65 | 6e 28 61 72 67 76 5b 31 | dbm_ope|n(argv[1|
|00005900| 5d 2c 20 4f 5f 52 44 57 | 52 2c 20 30 29 3b 0a 09 |], O_RDW|R, 0);..|
|00005910| 69 66 20 28 64 70 20 3d | 3d 20 30 29 20 7b 0a 09 |if (dp =|= 0) {..|
|00005920| 09 69 66 20 28 28 64 70 | 20 3d 20 64 62 6d 5f 6f |.if ((dp| = dbm_o|
|00005930| 70 65 6e 28 61 72 67 76 | 5b 31 5d 2c 20 4f 5f 52 |pen(argv|[1], O_R|
|00005940| 44 57 52 7c 4f 5f 43 52 | 45 41 54 2c 20 30 36 34 |DWR|O_CR|EAT, 064|
|00005950| 34 29 29 20 3d 3d 20 30 | 29 20 7b 0a 09 09 09 70 |4)) == 0|) {....p|
|00005960| 65 72 72 6f 72 28 22 6f | 70 65 6e 20 64 62 6d 22 |error("o|pen dbm"|
|00005970| 29 3b 0a 09 09 09 65 78 | 69 74 28 31 29 3b 0a 09 |);....ex|it(1);..|
|00005980| 09 7d 0a 09 7d 0a 09 77 | 68 69 6c 65 20 28 21 66 |.}..}..w|hile (!f|
|00005990| 65 6f 66 28 73 74 64 69 | 6e 29 29 20 7b 0a 09 09 |eof(stdi|n)) {...|
|000059a0| 63 68 61 72 09 2a 70 3b | 0a 0a 09 09 66 67 65 74 |char.*p;|....fget|
|000059b0| 73 28 6c 69 6e 65 2c 20 | 38 30 2c 20 73 74 64 69 |s(line, |80, stdi|
|000059c0| 6e 29 3b 0a 09 09 70 20 | 3d 20 69 6e 64 65 78 28 |n);...p |= index(|
|000059d0| 6c 69 6e 65 2c 20 27 5c | 6e 27 29 3b 0a 09 09 69 |line, '\|n');...i|
|000059e0| 66 20 28 70 29 20 2a 70 | 20 3d 20 30 3b 0a 09 09 |f (p) *p| = 0;...|
|000059f0| 64 2e 64 70 74 72 20 3d | 20 6c 69 6e 65 3b 0a 09 |d.dptr =| line;..|
|00005a00| 09 64 2e 64 73 69 7a 65 | 20 3d 20 73 74 72 6c 65 |.d.dsize| = strle|
|00005a10| 6e 28 6c 69 6e 65 29 3b | 0a 09 09 64 62 6d 5f 73 |n(line);|...dbm_s|
|00005a20| 74 6f 72 65 28 64 70 2c | 20 64 2c 20 64 2c 20 44 |tore(dp,| d, d, D|
|00005a30| 42 4d 5f 49 4e 53 45 52 | 54 29 3b 0a 09 09 72 65 |BM_INSER|T);...re|
|00005a40| 63 73 2b 2b 3b 0a 09 7d | 0a 09 64 62 6d 5f 63 6c |cs++;..}|..dbm_cl|
|00005a50| 6f 73 65 28 64 70 29 3b | 0a 09 70 72 69 6e 74 66 |ose(dp);|..printf|
|00005a60| 28 22 25 73 20 62 75 69 | 6c 74 2c 20 25 64 20 72 |("%s bui|lt, %d r|
|00005a70| 65 63 6f 72 64 73 5c 6e | 22 2c 20 61 72 67 76 5b |ecords\n|", argv[|
|00005a80| 31 5d 2c 20 72 65 63 73 | 29 3b 0a 7d 0a 67 61 69 |1], recs|);.}.gai|
|00005a90| 6e 73 74 20 74 68 65 20 | 75 73 65 72 73 27 20 70 |nst the |users' p|
|00005aa0| 61 73 73 77 6f 72 64 0a | 20 2a 09 09 66 69 6c 65 |assword.| *..file|
|00005ab0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 2c 20 6f 72 | informa|tion, or|
|00005ac0| 20 61 6e 79 20 6f 74 68 | 65 72 20 69 6e 66 6f 72 | any oth|er infor|
|00005ad0| 6d 61 74 69 6f 6e 20 74 | 68 61 74 20 69 73 20 70 |mation t|hat is p|
|00005ae0| 75 62 6c 69 63 6c 79 0a | 20 2a 09 09 61 76 61 69 |ublicly.| *..avai|
|00005af0| 6c 61 62 6c 65 20 61 62 | 6f 75 74 20 74 68 69 73 |lable ab|out this|
|00005b00| 20 75 73 65 72 20 74 68 | 61 74 20 61 20 62 61 6e | user th|at a ban|
|00005b10| 64 69 74 20 63 6f 75 6c | 64 20 75 73 65 20 61 73 |dit coul|d use as|
|00005b20| 0a 20 2a 09 09 70 61 73 | 73 77 6f 72 64 20 67 75 |. *..pas|sword gu|
|00005b30| 65 73 73 65 73 2e 0a 20 | 2a 0a 20 2a 09 48 65 72 |esses.. |*. *.Her|
|00005b40| 65 20 69 73 20 74 68 65 | 20 70 6c 61 63 65 20 74 |e is the| place t|
|00005b50| 6f 20 73 65 61 72 63 68 | 20 79 6f 75 72 20 27 66 |o search| your 'f|
|00005b60| 69 6e 67 65 72 27 20 64 | 61 74 61 62 61 73 65 2e |inger' d|atabase.|
|00005b70| 0a 20 2a 2f 0a 23 69 6e | 63 6c 75 64 65 09 3c 70 |. */.#in|clude.<p|
|00005b80| 77 64 2e 68 3e 0a 0a 73 | 74 61 74 69 63 20 69 6e |wd.h>..s|tatic in|
|00005b90| 74 0a 70 77 63 6b 5f 70 | 61 73 73 77 64 28 70 61 |t.pwck_p|asswd(pa|
|00005ba0| 73 73 77 6f 72 64 2c 20 | 75 73 65 72 69 64 29 0a |ssword, |userid).|
|00005bb0| 63 68 61 72 09 2a 70 61 | 73 73 77 6f 72 64 3b 0a |char.*pa|ssword;.|
|00005bc0| 69 6e 74 09 75 73 65 72 | 69 64 3b 0a 7b 0a 09 63 |int.user|id;.{..c|
|00005bd0| 68 61 72 09 74 65 6d 70 | 5b 31 32 38 5d 3b 09 09 |har.temp|[128];..|
|00005be0| 2f 2a 20 53 63 72 61 74 | 63 68 20 2a 2f 0a 09 73 |/* Scrat|ch */..s|
|00005bf0| 74 72 75 63 74 20 70 61 | 73 73 77 64 09 2a 70 77 |truct pa|sswd.*pw|
|00005c00| 63 68 6b 70 77 64 2f 76 | 69 65 77 64 69 63 74 2e |chkpwd/v|iewdict.|
|00005c10| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00005c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00005c70| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00005c80| 20 20 20 20 36 32 36 20 | 20 34 34 32 36 31 30 36 | 626 | 4426106|
|00005c90| 36 32 36 20 20 20 37 33 | 33 36 00 20 00 00 00 00 |626 73|36. ....|
|00005ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e00| 2f 2a 0a 20 2a 09 76 69 | 65 77 64 69 63 74 20 2d |/*. *.vi|ewdict -|
|00005e10| 20 56 69 65 77 20 44 42 | 4d 20 76 65 72 73 69 6f | View DB|M versio|
|00005e20| 6e 20 6f 66 20 61 20 70 | 61 73 73 77 6f 72 64 20 |n of a p|assword |
|00005e30| 64 69 63 74 69 6f 6e 61 | 72 79 0a 20 2a 2f 0a 0a |dictiona|ry. */..|
|00005e40| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 66 69 |#include| <sys/fi|
|00005e50| 6c 65 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |le.h>.#i|nclude <|
|00005e60| 6e 64 62 6d 2e 68 3e 0a | 0a 6d 61 69 6e 28 61 72 |ndbm.h>.|.main(ar|
|00005e70| 67 63 2c 20 61 72 67 76 | 29 0a 63 68 61 72 09 2a |gc, argv|).char.*|
|00005e80| 61 72 67 76 5b 5d 3b 0a | 7b 0a 09 44 42 4d 09 2a |argv[];.|{..DBM.*|
|00005e90| 64 70 3b 0a 09 64 61 74 | 75 6d 09 6b 3b 0a 09 63 |dp;..dat|um.k;..c|
|00005ea0| 68 61 72 09 74 5b 31 32 | 38 5d 3b 0a 0a 09 69 66 |har.t[12|8];...if|
|00005eb0| 20 28 28 64 70 20 3d 20 | 64 62 6d 5f 6f 70 65 6e | ((dp = |dbm_open|
|00005ec0| 28 61 72 67 76 5b 31 5d | 2c 20 4f 5f 52 44 4f 4e |(argv[1]|, O_RDON|
|00005ed0| 4c 59 2c 20 30 29 29 20 | 3d 3d 20 30 29 20 7b 0a |LY, 0)) |== 0) {.|
|00005ee0| 09 09 70 65 72 72 6f 72 | 28 61 72 67 76 5b 31 5d |..perror|(argv[1]|
|00005ef0| 29 3b 0a 09 09 65 78 69 | 74 28 31 29 3b 0a 09 7d |);...exi|t(1);..}|
|00005f00| 0a 09 66 6f 72 20 28 6b | 20 3d 20 64 62 6d 5f 66 |..for (k| = dbm_f|
|00005f10| 69 72 73 74 6b 65 79 28 | 64 70 29 3b 20 6b 2e 64 |irstkey(|dp); k.d|
|00005f20| 70 74 72 20 21 3d 20 30 | 3b 20 6b 20 3d 20 64 62 |ptr != 0|; k = db|
|00005f30| 6d 5f 6e 65 78 74 6b 65 | 79 28 64 70 29 29 20 7b |m_nextke|y(dp)) {|
|00005f40| 0a 09 09 73 74 72 6e 63 | 70 79 28 74 2c 20 6b 2e |...strnc|py(t, k.|
|00005f50| 64 70 74 72 2c 20 6b 2e | 64 73 69 7a 65 29 3b 0a |dptr, k.|dsize);.|
|00005f60| 09 09 74 5b 6b 2e 64 73 | 69 7a 65 5d 20 3d 20 30 |..t[k.ds|ize] = 0|
|00005f70| 3b 0a 09 09 70 72 69 6e | 74 66 28 22 25 73 5c 6e |;...prin|tf("%s\n|
|00005f80| 22 2c 20 74 29 3b 0a 09 | 7d 0a 09 65 78 69 74 28 |", t);..|}..exit(|
|00005f90| 30 29 3b 0a 7d 0a 64 69 | 6e 29 29 20 7b 0a 09 09 |0);.}.di|n)) {...|
|00005fa0| 63 68 61 72 09 2a 70 3b | 0a 0a 09 09 66 67 65 74 |char.*p;|....fget|
|00005fb0| 73 28 6c 69 6e 65 2c 20 | 38 30 2c 20 73 74 64 69 |s(line, |80, stdi|
|00005fc0| 6e 29 3b 0a 09 09 70 20 | 3d 20 69 6e 64 65 78 28 |n);...p |= index(|
|00005fd0| 6c 69 6e 65 2c 20 27 5c | 6e 27 29 3b 0a 09 09 69 |line, '\|n');...i|
|00005fe0| 66 20 28 70 29 20 2a 70 | 20 3d 20 30 3b 0a 09 09 |f (p) *p| = 0;...|
|00005ff0| 64 2e 64 70 74 72 20 3d | 20 6c 69 6e 65 3b 0a 09 |d.dptr =| line;..|
|00006000| 63 68 6b 70 77 64 2f 77 | 6f 72 6d 77 6f 72 64 73 |chkpwd/w|ormwords|
|00006010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006060| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 32 |.... 6|44 . 2|
|00006070| 34 33 20 00 20 20 20 20 | 31 33 20 00 20 20 20 20 |43 . |13 . |
|00006080| 20 20 20 36 33 31 36 20 | 20 34 34 32 36 31 30 36 | 6316 | 4426106|
|00006090| 36 32 37 20 20 20 37 33 | 36 35 00 20 00 00 00 00 |627 73|65. ....|
|000060a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006200| 61 61 61 0a 61 63 61 64 | 65 6d 69 61 0a 61 65 72 |aaa.acad|emia.aer|
|00006210| 6f 62 69 63 73 0a 61 69 | 72 70 6c 61 6e 65 0a 61 |obics.ai|rplane.a|
|00006220| 6c 62 61 6e 79 0a 61 6c | 62 61 74 72 6f 73 73 0a |lbany.al|batross.|
|00006230| 61 6c 62 65 72 74 0a 61 | 6c 65 78 0a 61 6c 65 78 |albert.a|lex.alex|
|00006240| 61 6e 64 65 72 0a 61 6c | 67 65 62 72 61 0a 61 6c |ander.al|gebra.al|
|00006250| 69 61 73 65 73 0a 61 6c | 70 68 61 62 65 74 0a 61 |iases.al|phabet.a|
|00006260| 6d 61 0a 61 6d 6f 72 70 | 68 6f 75 73 0a 61 6e 61 |ma.amorp|hous.ana|
|00006270| 6c 6f 67 0a 61 6e 63 68 | 6f 72 0a 61 6e 64 72 6f |log.anch|or.andro|
|00006280| 6d 61 63 68 65 0a 61 6e | 69 6d 61 6c 73 0a 61 6e |mache.an|imals.an|
|00006290| 73 77 65 72 0a 61 6e 74 | 68 72 6f 70 6f 67 65 6e |swer.ant|hropogen|
|000062a0| 69 63 0a 61 6e 76 69 6c | 73 0a 61 6e 79 74 68 69 |ic.anvil|s.anythi|
|000062b0| 6e 67 0a 61 72 69 61 0a | 61 72 69 61 64 6e 65 0a |ng.aria.|ariadne.|
|000062c0| 61 72 72 6f 77 0a 61 72 | 74 68 75 72 0a 61 74 68 |arrow.ar|thur.ath|
|000062d0| 65 6e 61 0a 61 74 6d 6f | 73 70 68 65 72 65 0a 61 |ena.atmo|sphere.a|
|000062e0| 7a 74 65 63 73 0a 61 7a | 75 72 65 0a 62 61 63 63 |ztecs.az|ure.bacc|
|000062f0| 68 75 73 0a 62 61 69 6c | 65 79 0a 62 61 6e 61 6e |hus.bail|ey.banan|
|00006300| 61 0a 62 61 6e 61 6e 61 | 73 0a 62 61 6e 64 69 74 |a.banana|s.bandit|
|00006310| 0a 62 61 6e 6b 73 0a 62 | 61 72 62 65 72 0a 62 61 |.banks.b|arber.ba|
|00006320| 72 69 74 6f 6e 65 0a 62 | 61 73 73 0a 62 61 73 73 |ritone.b|ass.bass|
|00006330| 6f 6f 6e 0a 62 61 74 6d | 61 6e 0a 62 65 61 74 65 |oon.batm|an.beate|
|00006340| 72 0a 62 65 61 75 74 79 | 0a 62 65 65 74 68 6f 76 |r.beauty|.beethov|
|00006350| 65 6e 0a 62 65 6c 6f 76 | 65 64 0a 62 65 6e 7a 0a |en.belov|ed.benz.|
|00006360| 62 65 6f 77 75 6c 66 0a | 62 65 72 6b 65 6c 65 79 |beowulf.|berkeley|
|00006370| 0a 62 65 72 6c 69 6e 65 | 72 0a 62 65 72 79 6c 0a |.berline|r.beryl.|
|00006380| 62 65 76 65 72 6c 79 0a | 62 69 63 61 6d 65 72 61 |beverly.|bicamera|
|00006390| 6c 0a 62 6f 62 0a 62 72 | 65 6e 64 61 0a 62 72 69 |l.bob.br|enda.bri|
|000063a0| 61 6e 0a 62 72 69 64 67 | 65 74 0a 62 72 6f 61 64 |an.bridg|et.broad|
|000063b0| 77 61 79 0a 62 75 6d 62 | 6c 69 6e 67 0a 62 75 72 |way.bumb|ling.bur|
|000063c0| 67 65 73 73 0a 63 61 6d | 70 61 6e 69 6c 65 0a 63 |gess.cam|panile.c|
|000063d0| 61 6e 74 6f 72 0a 63 61 | 72 64 69 6e 61 6c 0a 63 |antor.ca|rdinal.c|
|000063e0| 61 72 6d 65 6e 0a 63 61 | 72 6f 6c 69 6e 61 0a 63 |armen.ca|rolina.c|
|000063f0| 61 72 6f 6c 69 6e 65 0a | 63 61 73 63 61 64 65 73 |aroline.|cascades|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.