home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: pwdiff
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 77 75 | 67 61 74 65 21 77 75 63 |Path: wu|gate!wuc|
|00000010| 73 31 21 75 75 6e 65 74 | 21 62 62 6e 2e 63 6f 6d |s1!uunet|!bbn.com|
|00000020| 21 72 73 61 6c 7a 0a 46 | 72 6f 6d 3a 20 72 73 61 |!rsalz.F|rom: rsa|
|00000030| 6c 7a 40 75 75 6e 65 74 | 2e 75 75 2e 6e 65 74 20 |lz@uunet|.uu.net |
|00000040| 28 52 69 63 68 20 53 61 | 6c 7a 29 0a 4e 65 77 73 |(Rich Sa|lz).News|
|00000050| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 73 6f 75 |groups: |comp.sou|
|00000060| 72 63 65 73 2e 75 6e 69 | 78 0a 53 75 62 6a 65 63 |rces.uni|x.Subjec|
|00000070| 74 3a 20 76 31 38 69 30 | 36 38 3a 20 20 54 6f 6f |t: v18i0|68: Too|
|00000080| 6c 20 74 6f 20 61 69 64 | 65 20 69 6e 20 6d 65 72 |l to aid|e in mer|
|00000090| 67 69 6e 67 20 70 61 73 | 73 77 6f 72 64 20 66 69 |ging pas|sword fi|
|000000a0| 6c 65 73 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |les.Mess|age-ID: |
|000000b0| 3c 31 36 32 36 40 70 61 | 70 61 79 61 2e 62 62 6e |<1626@pa|paya.bbn|
|000000c0| 2e 63 6f 6d 3e 0a 44 61 | 74 65 3a 20 32 37 20 4d |.com>.Da|te: 27 M|
|000000d0| 61 72 20 38 39 20 31 38 | 3a 30 32 3a 30 38 20 47 |ar 89 18|:02:08 G|
|000000e0| 4d 54 0a 4c 69 6e 65 73 | 3a 20 32 37 37 0a 41 70 |MT.Lines|: 277.Ap|
|000000f0| 70 72 6f 76 65 64 3a 20 | 72 73 61 6c 7a 40 75 75 |proved: |rsalz@uu|
|00000100| 6e 65 74 2e 55 55 2e 4e | 45 54 0a 0a 53 75 62 6d |net.UU.N|ET..Subm|
|00000110| 69 74 74 65 64 2d 62 79 | 3a 20 44 6f 6e 20 4c 69 |itted-by|: Don Li|
|00000120| 62 65 73 20 3c 6c 69 62 | 65 73 40 63 6d 65 2d 64 |bes <lib|es@cme-d|
|00000130| 75 72 65 72 2e 61 72 70 | 61 3e 0a 50 6f 73 74 69 |urer.arp|a>.Posti|
|00000140| 6e 67 2d 6e 75 6d 62 65 | 72 3a 20 56 6f 6c 75 6d |ng-numbe|r: Volum|
|00000150| 65 20 31 38 2c 20 49 73 | 73 75 65 20 36 38 0a 41 |e 18, Is|sue 68.A|
|00000160| 72 63 68 69 76 65 2d 6e | 61 6d 65 3a 20 70 77 64 |rchive-n|ame: pwd|
|00000170| 69 66 66 0a 0a 70 77 64 | 69 66 66 20 74 61 6b 65 |iff..pwd|iff take|
|00000180| 73 20 6d 75 6c 74 69 70 | 6c 65 20 70 61 73 73 77 |s multip|le passw|
|00000190| 6f 72 64 20 66 69 6c 65 | 73 20 61 6e 64 20 63 6f |ord file|s and co|
|000001a0| 6d 70 61 72 65 73 20 74 | 68 65 6d 20 69 6e 20 61 |mpares t|hem in a|
|000001b0| 6e 0a 69 6e 74 65 6c 6c | 69 67 65 6e 74 20 77 61 |n.intell|igent wa|
|000001c0| 79 2e 20 20 46 6f 72 20 | 69 6e 73 74 61 6e 63 65 |y. For |instance|
|000001d0| 2c 20 69 74 20 77 69 6c | 6c 20 72 65 70 6f 72 74 |, it wil|l report|
|000001e0| 20 6f 6e 20 64 69 66 66 | 65 72 65 6e 74 20 6e 61 | on diff|erent na|
|000001f0| 6d 65 73 0a 77 69 74 68 | 20 74 68 65 20 73 61 6d |mes.with| the sam|
|00000200| 65 20 75 69 64 2c 20 62 | 75 74 20 6c 65 74 20 70 |e uid, b|ut let p|
|00000210| 61 73 73 20 74 68 65 20 | 73 61 6d 65 20 6e 61 6d |ass the |same nam|
|00000220| 65 20 77 69 74 68 20 74 | 68 65 20 73 61 6d 65 20 |e with t|he same |
|00000230| 75 69 64 2e 0a 0a 57 68 | 61 74 20 68 61 70 70 65 |uid...Wh|at happe|
|00000240| 6e 65 64 20 77 61 73 20 | 74 68 61 74 20 77 65 20 |ned was |that we |
|00000250| 73 74 61 72 74 65 64 20 | 6f 75 74 20 77 69 74 68 |started |out with|
|00000260| 20 6f 6e 65 20 73 68 61 | 72 65 64 20 70 61 73 73 | one sha|red pass|
|00000270| 77 6f 72 64 20 66 69 6c | 65 20 69 6e 0a 61 20 73 |word fil|e in.a s|
|00000280| 6d 61 6c 6c 20 4c 41 4e | 20 65 6e 76 69 72 6f 6e |mall LAN| environ|
|00000290| 6d 65 6e 74 2e 20 20 4f | 76 65 72 20 74 69 6d 65 |ment. O|ver time|
|000002a0| 2c 20 6d 6f 72 65 20 6d | 61 63 68 69 6e 65 73 20 |, more m|achines |
|000002b0| 63 61 6d 65 20 6f 6e 2d | 6c 69 6e 65 2e 0a 4e 65 |came on-|line..Ne|
|000002c0| 77 20 61 64 6d 69 6e 69 | 73 74 72 61 74 6f 72 73 |w admini|strators|
|000002d0| 20 73 6f 6d 65 74 69 6d | 65 73 20 73 68 61 72 65 | sometim|es share|
|000002e0| 64 20 74 68 65 20 6f 6c | 64 20 70 61 73 73 77 6f |d the ol|d passwo|
|000002f0| 72 64 20 66 69 6c 65 2c | 20 61 6e 64 0a 73 6f 6d |rd file,| and.som|
|00000300| 65 74 69 6d 65 73 20 6a | 75 73 74 20 63 6f 70 69 |etimes j|ust copi|
|00000310| 65 64 20 69 74 2e 20 20 | 47 72 61 64 75 61 6c 6c |ed it. |Graduall|
|00000320| 79 20 69 74 20 64 69 76 | 65 72 67 65 64 2c 20 73 |y it div|erged, s|
|00000330| 6f 20 74 68 61 74 20 73 | 6f 6d 65 20 6f 66 20 74 |o that s|ome of t|
|00000340| 68 65 0a 75 69 64 73 20 | 6d 61 70 70 65 64 20 74 |he.uids |mapped t|
|00000350| 6f 20 6d 75 6c 74 69 70 | 6c 65 20 75 73 65 72 73 |o multip|le users|
|00000360| 20 61 63 72 6f 73 73 20 | 74 68 65 20 4c 41 4e 2e | across |the LAN.|
|00000370| 0a 0a 45 76 65 6e 74 75 | 61 6c 6c 79 20 6f 75 72 |..Eventu|ally our|
|00000380| 20 4c 41 4e 20 67 6f 74 | 20 62 69 67 20 65 6e 6f | LAN got| big eno|
|00000390| 75 67 68 2c 20 73 6f 20 | 74 68 61 74 20 77 65 20 |ugh, so |that we |
|000003a0| 68 69 72 65 64 20 61 20 | 73 69 74 65 77 69 64 65 |hired a |sitewide|
|000003b0| 20 61 64 6d 69 6e 2c 0a | 61 6e 64 20 68 65 20 77 | admin,.|and he w|
|000003c0| 61 6e 74 65 64 20 74 6f | 20 75 73 65 20 6f 6e 65 |anted to| use one|
|000003d0| 20 63 6f 6d 6d 6f 6e 20 | 70 61 73 73 77 6f 72 64 | common |password|
|000003e0| 20 66 69 6c 65 2e 20 20 | 54 68 69 73 20 6d 61 6b | file. |This mak|
|000003f0| 65 73 20 4e 46 53 20 61 | 63 63 65 73 73 0a 6d 75 |es NFS a|ccess.mu|
|00000400| 63 68 20 65 61 73 69 65 | 72 2c 20 66 6f 72 20 65 |ch easie|r, for e|
|00000410| 78 61 6d 70 6c 65 2e 20 | 20 53 6f 20 49 20 77 72 |xample. | So I wr|
|00000420| 6f 74 65 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |ote this| program|
|00000430| 20 74 6f 20 73 6f 6c 76 | 65 20 68 69 73 0a 70 72 | to solv|e his.pr|
|00000440| 6f 62 6c 65 6d 2e 20 20 | 49 20 66 69 67 75 72 65 |oblem. |I figure|
|00000450| 20 74 68 69 73 20 76 65 | 72 79 20 73 61 6d 65 20 | this ve|ry same |
|00000460| 74 68 69 6e 67 20 6d 75 | 73 74 20 68 61 70 70 65 |thing mu|st happe|
|00000470| 6e 20 74 6f 20 6c 6f 74 | 73 20 6f 66 20 73 69 74 |n to lot|s of sit|
|00000480| 65 73 2c 0a 73 6f 20 74 | 6f 20 73 61 76 65 20 79 |es,.so t|o save y|
|00000490| 6f 75 20 73 6f 6d 65 20 | 67 72 69 65 66 2c 20 68 |ou some |grief, h|
|000004a0| 65 72 65 20 69 74 20 69 | 73 2e 0a 09 09 44 6f 6e |ere it i|s....Don|
|000004b0| 20 4c 69 62 65 73 0a 0a | 23 21 20 2f 62 69 6e 2f | Libes..|#! /bin/|
|000004c0| 73 68 0a 23 20 54 68 69 | 73 20 69 73 20 61 20 73 |sh.# Thi|s is a s|
|000004d0| 68 65 6c 6c 20 61 72 63 | 68 69 76 65 2e 20 20 52 |hell arc|hive. R|
|000004e0| 65 6d 6f 76 65 20 61 6e | 79 74 68 69 6e 67 20 62 |emove an|ything b|
|000004f0| 65 66 6f 72 65 20 74 68 | 69 73 20 6c 69 6e 65 2c |efore th|is line,|
|00000500| 20 74 68 65 6e 20 75 6e | 70 61 63 6b 0a 23 20 69 | then un|pack.# i|
|00000510| 74 20 62 79 20 73 61 76 | 69 6e 67 20 69 74 20 69 |t by sav|ing it i|
|00000520| 6e 74 6f 20 61 20 66 69 | 6c 65 20 61 6e 64 20 74 |nto a fi|le and t|
|00000530| 79 70 69 6e 67 20 22 73 | 68 20 66 69 6c 65 22 2e |yping "s|h file".|
|00000540| 20 20 54 6f 20 6f 76 65 | 72 77 72 69 74 65 20 65 | To ove|rwrite e|
|00000550| 78 69 73 74 69 6e 67 0a | 23 20 66 69 6c 65 73 2c |xisting.|# files,|
|00000560| 20 74 79 70 65 20 22 73 | 68 20 66 69 6c 65 20 2d | type "s|h file -|
|00000570| 63 22 2e 20 20 59 6f 75 | 20 63 61 6e 20 61 6c 73 |c". You| can als|
|00000580| 6f 20 66 65 65 64 20 74 | 68 69 73 20 61 73 20 73 |o feed t|his as s|
|00000590| 74 61 6e 64 61 72 64 20 | 69 6e 70 75 74 20 76 69 |tandard |input vi|
|000005a0| 61 0a 23 20 75 6e 73 68 | 61 72 2c 20 6f 72 20 62 |a.# unsh|ar, or b|
|000005b0| 79 20 74 79 70 69 6e 67 | 20 22 73 68 20 3c 66 69 |y typing| "sh <fi|
|000005c0| 6c 65 22 2c 20 65 2e 67 | 2e 2e 20 20 49 66 20 74 |le", e.g|.. If t|
|000005d0| 68 69 73 20 61 72 63 68 | 69 76 65 20 69 73 20 63 |his arch|ive is c|
|000005e0| 6f 6d 70 6c 65 74 65 2c | 20 79 6f 75 0a 23 20 77 |omplete,| you.# w|
|000005f0| 69 6c 6c 20 73 65 65 20 | 74 68 65 20 66 6f 6c 6c |ill see |the foll|
|00000600| 6f 77 69 6e 67 20 6d 65 | 73 73 61 67 65 20 61 74 |owing me|ssage at|
|00000610| 20 74 68 65 20 65 6e 64 | 3a 0a 23 09 09 22 45 6e | the end|:.#.."En|
|00000620| 64 20 6f 66 20 73 68 65 | 6c 6c 20 61 72 63 68 69 |d of she|ll archi|
|00000630| 76 65 2e 22 0a 23 20 43 | 6f 6e 74 65 6e 74 73 3a |ve.".# C|ontents:|
|00000640| 20 20 4d 61 6b 65 66 69 | 6c 65 20 52 45 41 44 4d | Makefi|le READM|
|00000650| 45 20 70 77 64 69 66 66 | 2e 38 20 70 77 64 69 66 |E pwdiff|.8 pwdif|
|00000660| 66 2e 63 0a 50 41 54 48 | 3d 2f 62 69 6e 3a 2f 75 |f.c.PATH|=/bin:/u|
|00000670| 73 72 2f 62 69 6e 3a 2f | 75 73 72 2f 75 63 62 20 |sr/bin:/|usr/ucb |
|00000680| 3b 20 65 78 70 6f 72 74 | 20 50 41 54 48 0a 65 63 |; export| PATH.ec|
|00000690| 68 6f 20 45 78 74 72 61 | 63 74 69 6e 67 20 4d 61 |ho Extra|cting Ma|
|000006a0| 6b 65 66 69 6c 65 20 5c | 28 65 6e 74 65 72 65 64 |kefile \|(entered|
|000006b0| 20 62 79 20 68 61 6e 64 | 2c 20 6e 6f 20 65 72 72 | by hand|, no err|
|000006c0| 6f 72 20 63 68 65 63 6b | 69 6e 67 5c 29 0a 73 65 |or check|ing\).se|
|000006d0| 64 20 22 73 2f 5e 58 2f | 2f 22 20 3e 4d 61 6b 65 |d "s/^X/|/" >Make|
|000006e0| 66 69 6c 65 20 3c 3c 27 | 45 4e 44 5f 4f 46 5f 46 |file <<'|END_OF_F|
|000006f0| 49 4c 45 27 0a 58 61 6c | 6c 3a 09 09 70 77 64 69 |ILE'.Xal|l:..pwdi|
|00000700| 66 66 20 70 77 64 69 66 | 66 2e 38 0a 58 0a 58 69 |ff pwdif|f.8.X.Xi|
|00000710| 6e 73 74 61 6c 6c 3a 09 | 61 6c 6c 0a 58 09 40 65 |nstall:.|all.X.@e|
|00000720| 63 68 6f 20 49 6e 73 74 | 61 6c 6c 69 6e 67 20 61 |cho Inst|alling a|
|00000730| 63 63 6f 72 64 69 6e 67 | 20 74 6f 20 6c 6f 63 61 |ccording| to loca|
|00000740| 6c 20 63 6f 6e 76 65 6e | 74 69 6f 6e 0a 58 0a 58 |l conven|tion.X.X|
|00000750| 70 77 64 69 66 66 3a 09 | 09 70 77 64 69 66 66 2e |pwdiff:.|.pwdiff.|
|00000760| 63 0a 58 09 24 28 43 43 | 29 20 2d 6f 20 70 77 64 |c.X.$(CC|) -o pwd|
|00000770| 69 66 66 20 24 28 43 46 | 4c 41 47 53 29 20 70 77 |iff $(CF|LAGS) pw|
|00000780| 64 69 66 66 2e 63 0a 45 | 4e 44 5f 4f 46 5f 46 49 |diff.c.E|ND_OF_FI|
|00000790| 4c 45 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 52 |LE.if te|st -f 'R|
|000007a0| 45 41 44 4d 45 27 20 2d | 61 20 22 24 7b 31 7d 22 |EADME' -|a "${1}"|
|000007b0| 20 21 3d 20 22 2d 63 22 | 20 3b 20 74 68 65 6e 20 | != "-c"| ; then |
|000007c0| 0a 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 57 69 |. echo |shar: Wi|
|000007d0| 6c 6c 20 6e 6f 74 20 63 | 6c 6f 62 62 65 72 20 65 |ll not c|lobber e|
|000007e0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 5c 22 27 |xisting |file \"'|
|000007f0| 52 45 41 44 4d 45 27 5c | 22 0a 65 6c 73 65 0a 65 |README'\|".else.e|
|00000800| 63 68 6f 20 73 68 61 72 | 3a 20 45 78 74 72 61 63 |cho shar|: Extrac|
|00000810| 74 69 6e 67 20 5c 22 27 | 52 45 41 44 4d 45 27 5c |ting \"'|README'\|
|00000820| 22 20 5c 28 31 30 38 39 | 20 63 68 61 72 61 63 74 |" \(1089| charact|
|00000830| 65 72 73 5c 29 0a 73 65 | 64 20 22 73 2f 5e 58 2f |ers\).se|d "s/^X/|
|00000840| 2f 22 20 3e 27 52 45 41 | 44 4d 45 27 20 3c 3c 27 |/" >'REA|DME' <<'|
|00000850| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 27 0a 58 70 77 |END_OF_F|ILE'.Xpw|
|00000860| 64 69 66 66 20 74 61 6b | 65 73 20 6d 75 6c 74 69 |diff tak|es multi|
|00000870| 70 6c 65 20 70 61 73 73 | 77 6f 72 64 20 66 69 6c |ple pass|word fil|
|00000880| 65 73 20 61 6e 64 20 63 | 6f 6d 70 61 72 65 73 20 |es and c|ompares |
|00000890| 74 68 65 6d 20 69 6e 20 | 61 6e 0a 58 69 6e 74 65 |them in |an.Xinte|
|000008a0| 6c 6c 69 67 65 6e 74 20 | 77 61 79 2e 20 20 46 6f |lligent |way. Fo|
|000008b0| 72 20 69 6e 73 74 61 6e | 63 65 2c 20 69 74 20 77 |r instan|ce, it w|
|000008c0| 69 6c 6c 20 72 65 70 6f | 72 74 20 6f 6e 20 64 69 |ill repo|rt on di|
|000008d0| 66 66 65 72 65 6e 74 20 | 6e 61 6d 65 73 0a 58 77 |fferent |names.Xw|
|000008e0| 69 74 68 20 74 68 65 20 | 73 61 6d 65 20 75 69 64 |ith the |same uid|
|000008f0| 2c 20 62 75 74 20 6c 65 | 74 20 70 61 73 73 20 74 |, but le|t pass t|
|00000900| 68 65 20 73 61 6d 65 20 | 6e 61 6d 65 20 77 69 74 |he same |name wit|
|00000910| 68 20 74 68 65 20 73 61 | 6d 65 20 75 69 64 2e 0a |h the sa|me uid..|
|00000920| 58 0a 58 49 20 77 72 6f | 74 65 20 69 74 20 6f 6e |X.XI wro|te it on|
|00000930| 65 20 64 61 79 20 77 68 | 65 6e 20 77 65 20 68 61 |e day wh|en we ha|
|00000940| 64 20 74 6f 20 6a 6f 69 | 6e 20 74 77 6f 20 70 61 |d to joi|n two pa|
|00000950| 73 73 77 6f 72 64 20 66 | 69 6c 65 73 20 66 72 6f |ssword f|iles fro|
|00000960| 6d 0a 58 64 69 66 66 65 | 72 65 6e 74 20 6d 61 63 |m.Xdiffe|rent mac|
|00000970| 68 69 6e 65 73 2e 0a 58 | 0a 58 57 68 61 74 20 68 |hines..X|.XWhat h|
|00000980| 61 70 70 65 6e 65 64 20 | 77 61 73 20 74 68 61 74 |appened |was that|
|00000990| 20 77 65 20 73 74 61 72 | 74 65 64 20 6f 75 74 20 | we star|ted out |
|000009a0| 77 69 74 68 20 6f 6e 65 | 20 73 68 61 72 65 64 20 |with one| shared |
|000009b0| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 20 69 6e |password| file in|
|000009c0| 0a 58 61 20 73 6d 61 6c | 6c 20 4c 41 4e 20 65 6e |.Xa smal|l LAN en|
|000009d0| 76 69 72 6f 6e 6d 65 6e | 74 2e 20 20 4f 76 65 72 |vironmen|t. Over|
|000009e0| 20 74 69 6d 65 2c 20 6d | 6f 72 65 20 6d 61 63 68 | time, m|ore mach|
|000009f0| 69 6e 65 73 20 63 61 6d | 65 20 6f 6e 2d 6c 69 6e |ines cam|e on-lin|
|00000a00| 65 2e 0a 58 4e 65 77 20 | 61 64 6d 69 6e 69 73 74 |e..XNew |administ|
|00000a10| 72 61 74 6f 72 73 20 73 | 6f 6d 65 74 69 6d 65 73 |rators s|ometimes|
|00000a20| 20 73 68 61 72 65 64 20 | 74 68 65 20 6f 6c 64 20 | shared |the old |
|00000a30| 70 61 73 73 77 6f 72 64 | 20 66 69 6c 65 2c 20 61 |password| file, a|
|00000a40| 6e 64 0a 58 73 6f 6d 65 | 74 69 6d 65 73 20 6a 75 |nd.Xsome|times ju|
|00000a50| 73 74 20 63 6f 70 69 65 | 64 20 69 74 2e 20 20 47 |st copie|d it. G|
|00000a60| 72 61 64 75 61 6c 6c 79 | 20 69 74 20 64 69 76 65 |radually| it dive|
|00000a70| 72 67 65 64 2c 20 73 6f | 20 74 68 61 74 20 73 6f |rged, so| that so|
|00000a80| 6d 65 20 6f 66 20 74 68 | 65 0a 58 75 69 64 73 20 |me of th|e.Xuids |
|00000a90| 6d 61 70 70 65 64 20 74 | 6f 20 6d 75 6c 74 69 70 |mapped t|o multip|
|00000aa0| 6c 65 20 75 73 65 72 73 | 20 61 63 72 6f 73 73 20 |le users| across |
|00000ab0| 74 68 65 20 4c 41 4e 2e | 0a 58 0a 58 45 76 65 6e |the LAN.|.X.XEven|
|00000ac0| 74 75 61 6c 6c 79 20 6f | 75 72 20 4c 41 4e 20 67 |tually o|ur LAN g|
|00000ad0| 6f 74 20 62 69 67 20 65 | 6e 6f 75 67 68 2c 20 73 |ot big e|nough, s|
|00000ae0| 6f 20 74 68 61 74 20 77 | 65 20 68 69 72 65 64 20 |o that w|e hired |
|00000af0| 61 20 73 69 74 65 77 69 | 64 65 20 61 64 6d 69 6e |a sitewi|de admin|
|00000b00| 2c 0a 58 61 6e 64 20 68 | 65 20 77 61 6e 74 65 64 |,.Xand h|e wanted|
|00000b10| 20 74 6f 20 75 73 65 20 | 6f 6e 65 20 63 6f 6d 6d | to use |one comm|
|00000b20| 6f 6e 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |on passw|ord file|
|00000b30| 2e 20 20 54 68 69 73 20 | 6d 61 6b 65 73 20 4e 46 |. This |makes NF|
|00000b40| 53 20 61 63 63 65 73 73 | 0a 58 6d 75 63 68 20 65 |S access|.Xmuch e|
|00000b50| 61 73 69 65 72 2c 20 66 | 6f 72 20 65 78 61 6d 70 |asier, f|or examp|
|00000b60| 6c 65 2e 20 20 53 6f 20 | 49 20 77 72 6f 74 65 20 |le. So |I wrote |
|00000b70| 74 68 69 73 20 70 72 6f | 67 72 61 6d 20 74 6f 20 |this pro|gram to |
|00000b80| 73 6f 6c 76 65 20 68 69 | 73 0a 58 70 72 6f 62 6c |solve hi|s.Xprobl|
|00000b90| 65 6d 2e 20 20 49 20 66 | 69 67 75 72 65 20 74 68 |em. I f|igure th|
|00000ba0| 69 73 20 76 65 72 79 20 | 73 61 6d 65 20 74 68 69 |is very |same thi|
|00000bb0| 6e 67 20 6d 75 73 74 20 | 68 61 70 70 65 6e 20 74 |ng must |happen t|
|00000bc0| 6f 20 6c 6f 74 73 20 6f | 66 20 73 69 74 65 73 2c |o lots o|f sites,|
|00000bd0| 0a 58 73 6f 20 74 6f 20 | 73 61 76 65 20 79 6f 75 |.Xso to |save you|
|00000be0| 20 73 6f 6d 65 20 67 72 | 69 65 66 2c 20 68 65 72 | some gr|ief, her|
|00000bf0| 65 20 69 74 20 69 73 2e | 20 20 53 65 6e 64 20 62 |e it is.| Send b|
|00000c00| 75 67 73 2c 20 69 6d 70 | 72 6f 76 65 6d 65 6e 74 |ugs, imp|rovement|
|00000c10| 73 2c 20 61 6e 64 0a 58 | 63 61 73 68 20 74 6f 20 |s, and.X|cash to |
|00000c20| 6d 65 2e 0a 58 0a 58 44 | 6f 6e 20 4c 69 62 65 73 |me..X.XD|on Libes|
|00000c30| 0a 58 4e 61 74 69 6f 6e | 61 6c 20 42 75 72 65 61 |.XNation|al Burea|
|00000c40| 75 20 6f 66 20 53 74 61 | 6e 64 61 72 64 73 0a 58 |u of Sta|ndards.X|
|00000c50| 42 6c 64 67 20 32 32 30 | 2c 20 52 6d 20 41 2d 31 |Bldg 220|, Rm A-1|
|00000c60| 32 37 0a 58 47 61 69 74 | 68 65 72 73 62 75 72 67 |27.XGait|hersburg|
|00000c70| 2c 20 4d 44 20 20 32 30 | 38 39 39 0a 58 28 33 30 |, MD 20|899.X(30|
|00000c80| 31 29 20 39 37 35 2d 33 | 35 33 35 0a 58 6c 69 62 |1) 975-3|535.Xlib|
|00000c90| 65 73 40 63 6d 65 2d 64 | 75 72 65 72 2e 61 72 70 |es@cme-d|urer.arp|
|00000ca0| 61 0a 58 75 75 6e 65 74 | 21 63 6d 65 2d 64 75 72 |a.Xuunet|!cme-dur|
|00000cb0| 65 72 21 6c 69 62 65 73 | 0a 45 4e 44 5f 4f 46 5f |er!libes|.END_OF_|
|00000cc0| 46 49 4c 45 0a 69 66 20 | 74 65 73 74 20 31 30 38 |FILE.if |test 108|
|00000cd0| 39 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 27 52 |9 -ne `w|c -c <'R|
|00000ce0| 45 41 44 4d 45 27 60 3b | 20 74 68 65 6e 0a 20 20 |EADME'`;| then. |
|00000cf0| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 5c 22 27 | echo s|har: \"'|
|00000d00| 52 45 41 44 4d 45 27 5c | 22 20 75 6e 70 61 63 6b |README'\|" unpack|
|00000d10| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00000d20| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|00000d30| 27 52 45 41 44 4d 45 27 | 0a 66 69 0a 69 66 20 74 |'README'|.fi.if t|
|00000d40| 65 73 74 20 2d 66 20 27 | 70 77 64 69 66 66 2e 38 |est -f '|pwdiff.8|
|00000d50| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|00000d60| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|00000d70| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|00000d80| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|00000d90| 6e 67 20 66 69 6c 65 20 | 5c 22 27 70 77 64 69 66 |ng file |\"'pwdif|
|00000da0| 66 2e 38 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |f.8'\".e|lse.echo|
|00000db0| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00000dc0| 67 20 5c 22 27 70 77 64 | 69 66 66 2e 38 27 5c 22 |g \"'pwd|iff.8'\"|
|00000dd0| 20 5c 28 37 32 34 20 63 | 68 61 72 61 63 74 65 72 | \(724 c|haracter|
|00000de0| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|00000df0| 20 3e 27 70 77 64 69 66 | 66 2e 38 27 20 3c 3c 27 | >'pwdif|f.8' <<'|
|00000e00| 45 4e 44 5f 4f 46 5f 46 | 49 4c 45 27 0a 58 2e 54 |END_OF_F|ILE'.X.T|
|00000e10| 48 20 50 57 44 49 46 46 | 20 38 20 22 32 35 20 4a |H PWDIFF| 8 "25 J|
|00000e20| 75 6e 65 20 31 39 38 38 | 22 0a 58 2e 53 48 20 4e |une 1988|".X.SH N|
|00000e30| 41 4d 45 0a 58 70 77 64 | 69 66 66 20 5c 2d 20 66 |AME.Xpwd|iff \- f|
|00000e40| 69 6e 64 20 64 69 66 66 | 65 72 65 6e 63 65 73 20 |ind diff|erences |
|00000e50| 69 6e 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |in passw|ord file|
|00000e60| 73 0a 58 2e 53 48 20 53 | 59 4e 4f 50 53 49 53 0a |s.X.SH S|YNOPSIS.|
|00000e70| 58 70 77 64 69 66 66 20 | 66 69 6c 65 31 20 66 69 |Xpwdiff |file1 fi|
|00000e80| 6c 65 32 20 66 69 6c 65 | 33 20 2e 2e 2e 0a 58 2e |le2 file|3 ....X.|
|00000e90| 53 48 20 44 45 53 43 52 | 49 50 54 49 4f 4e 0a 58 |SH DESCR|IPTION.X|
|00000ea0| 54 68 69 73 20 70 72 6f | 67 72 61 6d 20 63 6f 6d |This pro|gram com|
|00000eb0| 70 61 72 65 73 20 6d 75 | 6c 74 69 70 6c 65 20 70 |pares mu|ltiple p|
|00000ec0| 61 73 73 77 6f 72 64 20 | 66 69 6c 65 73 20 61 6e |assword |files an|
|00000ed0| 64 20 72 65 70 6f 72 74 | 73 20 6f 6e 20 75 69 64 |d report|s on uid|
|00000ee0| 20 6f 72 0a 58 6e 61 6d | 65 20 63 6f 6e 66 6c 69 | or.Xnam|e confli|
|00000ef0| 63 74 73 20 74 68 61 74 | 20 77 6f 75 6c 64 20 70 |cts that| would p|
|00000f00| 72 65 76 65 6e 74 20 74 | 68 65 20 66 69 6c 65 73 |revent t|he files|
|00000f10| 20 66 72 6f 6d 20 62 65 | 69 6e 67 20 6d 65 72 67 | from be|ing merg|
|00000f20| 65 64 2e 0a 58 2e 50 50 | 0a 58 46 6f 72 20 65 78 |ed..X.PP|.XFor ex|
|00000f30| 61 6d 70 6c 65 2c 20 69 | 66 20 75 69 64 20 32 37 |ample, i|f uid 27|
|00000f40| 20 69 73 20 64 6f 6e 20 | 69 6e 20 66 69 6c 65 31 | is don |in file1|
|00000f50| 20 61 6e 64 20 73 75 73 | 61 6e 20 69 6e 20 66 69 | and sus|an in fi|
|00000f60| 6c 65 32 2c 20 74 68 69 | 73 20 77 69 6c 6c 20 62 |le2, thi|s will b|
|00000f70| 65 0a 58 64 65 74 65 63 | 74 65 64 2e 0a 58 2e 50 |e.Xdetec|ted..X.P|
|00000f80| 50 0a 58 54 68 65 20 70 | 72 6f 67 72 61 6d 20 61 |P.XThe p|rogram a|
|00000f90| 6c 73 6f 20 6e 6f 74 65 | 73 20 73 79 6e 74 61 63 |lso note|s syntac|
|00000fa0| 74 69 63 61 6c 6c 79 20 | 69 6e 63 6f 72 72 65 63 |tically |incorrec|
|00000fb0| 74 20 6c 69 6e 65 73 20 | 61 6e 64 20 6e 69 63 6b |t lines |and nick|
|00000fc0| 6e 61 6d 65 73 0a 58 28 | 74 68 65 20 75 73 65 72 |names.X(|the user|
|00000fd0| 20 6e 61 6d 65 20 64 6f | 65 73 20 6e 6f 74 20 6d | name do|es not m|
|00000fe0| 61 74 63 68 20 74 68 65 | 20 68 6f 6d 65 20 64 69 |atch the| home di|
|00000ff0| 72 65 63 74 6f 72 79 29 | 2e 20 20 53 69 6e 63 65 |rectory)|. Since|
|00001000| 20 6d 61 6e 79 20 6c 6f | 77 0a 58 75 69 64 73 20 | many lo|w.Xuids |
|00001010| 61 72 65 20 6e 69 63 6b | 6e 61 6d 65 73 20 28 72 |are nick|names (r|
|00001020| 6f 6f 74 2c 20 75 75 63 | 70 2c 20 65 74 63 2e 29 |oot, uuc|p, etc.)|
|00001030| 20 61 20 63 6f 6d 70 69 | 6c 65 2d 74 69 6d 65 20 | a compi|le-time |
|00001040| 63 6f 6e 73 74 61 6e 74 | 20 63 6f 6e 74 72 6f 6c |constant| control|
|00001050| 73 0a 58 61 20 63 75 74 | 2d 6f 66 66 20 62 65 6c |s.Xa cut|-off bel|
|00001060| 6f 77 20 77 68 69 63 68 | 20 6e 69 63 6b 6e 61 6d |ow which| nicknam|
|00001070| 65 73 20 61 72 65 20 69 | 67 6e 6f 72 65 64 2e 20 |es are i|gnored. |
|00001080| 20 41 73 20 64 69 73 74 | 72 69 62 75 74 65 64 2c | As dist|ributed,|
|00001090| 20 75 69 64 73 0a 58 62 | 65 6c 6f 77 20 32 30 20 | uids.Xb|elow 20 |
|000010a0| 61 72 65 20 6e 6f 74 20 | 63 68 65 63 6b 65 64 20 |are not |checked |
|000010b0| 66 6f 72 20 6e 69 63 6b | 6e 61 6d 65 73 2e 0a 58 |for nick|names..X|
|000010c0| 2e 53 48 20 41 55 54 48 | 4f 52 0a 58 44 6f 6e 20 |.SH AUTH|OR.XDon |
|000010d0| 4c 69 62 65 73 2c 20 4e | 61 74 69 6f 6e 61 6c 20 |Libes, N|ational |
|000010e0| 42 75 72 65 61 75 20 6f | 66 20 53 74 61 6e 64 61 |Bureau o|f Standa|
|000010f0| 72 64 73 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |rds.END_|OF_FILE.|
|00001100| 69 66 20 74 65 73 74 20 | 37 32 34 20 2d 6e 65 20 |if test |724 -ne |
|00001110| 60 77 63 20 2d 63 20 3c | 27 70 77 64 69 66 66 2e |`wc -c <|'pwdiff.|
|00001120| 38 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |8'`; the|n. ec|
|00001130| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 70 77 64 69 |ho shar:| \"'pwdi|
|00001140| 66 66 2e 38 27 5c 22 20 | 75 6e 70 61 63 6b 65 64 |ff.8'\" |unpacked|
|00001150| 20 77 69 74 68 20 77 72 | 6f 6e 67 20 73 69 7a 65 | with wr|ong size|
|00001160| 21 0a 66 69 0a 23 20 65 | 6e 64 20 6f 66 20 27 70 |!.fi.# e|nd of 'p|
|00001170| 77 64 69 66 66 2e 38 27 | 0a 66 69 0a 69 66 20 74 |wdiff.8'|.fi.if t|
|00001180| 65 73 74 20 2d 66 20 27 | 70 77 64 69 66 66 2e 63 |est -f '|pwdiff.c|
|00001190| 27 20 2d 61 20 22 24 7b | 31 7d 22 20 21 3d 20 22 |' -a "${|1}" != "|
|000011a0| 2d 63 22 20 3b 20 74 68 | 65 6e 20 0a 20 20 65 63 |-c" ; th|en . ec|
|000011b0| 68 6f 20 73 68 61 72 3a | 20 57 69 6c 6c 20 6e 6f |ho shar:| Will no|
|000011c0| 74 20 63 6c 6f 62 62 65 | 72 20 65 78 69 73 74 69 |t clobbe|r existi|
|000011d0| 6e 67 20 66 69 6c 65 20 | 5c 22 27 70 77 64 69 66 |ng file |\"'pwdif|
|000011e0| 66 2e 63 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |f.c'\".e|lse.echo|
|000011f0| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00001200| 67 20 5c 22 27 70 77 64 | 69 66 66 2e 63 27 5c 22 |g \"'pwd|iff.c'\"|
|00001210| 20 5c 28 33 33 31 31 20 | 63 68 61 72 61 63 74 65 | \(3311 |characte|
|00001220| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00001230| 22 20 3e 27 70 77 64 69 | 66 66 2e 63 27 20 3c 3c |" >'pwdi|ff.c' <<|
|00001240| 27 45 4e 44 5f 4f 46 5f | 46 49 4c 45 27 0a 58 2f |'END_OF_|FILE'.X/|
|00001250| 2a 20 43 68 65 63 6b 20 | 6d 75 6c 74 69 70 6c 65 |* Check |multiple|
|00001260| 20 70 61 73 73 77 64 20 | 66 69 6c 65 73 20 66 6f | passwd |files fo|
|00001270| 72 20 75 69 64 2f 6e 61 | 6d 65 20 6f 76 65 72 6c |r uid/na|me overl|
|00001280| 61 70 20 2d 20 44 6f 6e | 20 4c 69 62 65 73 20 2a |ap - Don| Libes *|
|00001290| 2f 0a 58 0a 58 23 69 6e | 63 6c 75 64 65 20 3c 73 |/.X.X#in|clude <s|
|000012a0| 74 64 69 6f 2e 68 3e 0a | 58 23 69 6e 63 6c 75 64 |tdio.h>.|X#includ|
|000012b0| 65 20 3c 70 77 64 2e 68 | 3e 0a 58 0a 58 23 64 65 |e <pwd.h|>.X.X#de|
|000012c0| 66 69 6e 65 20 54 52 55 | 45 20 31 0a 58 23 64 65 |fine TRU|E 1.X#de|
|000012d0| 66 69 6e 65 20 46 41 4c | 53 45 20 30 0a 58 0a 58 |fine FAL|SE 0.X.X|
|000012e0| 73 74 72 75 63 74 20 74 | 69 6e 79 70 61 73 73 77 |struct t|inypassw|
|000012f0| 64 20 7b 09 2f 2a 20 6c | 69 6b 65 20 73 74 72 75 |d {./* l|ike stru|
|00001300| 63 74 20 70 77 64 20 62 | 75 74 20 6d 69 73 73 69 |ct pwd b|ut missi|
|00001310| 6e 67 20 73 6f 6d 65 20 | 65 6e 74 72 69 65 73 20 |ng some |entries |
|00001320| 2a 2f 0a 58 09 63 68 61 | 72 20 2a 6e 61 6d 65 3b |*/.X.cha|r *name;|
|00001330| 0a 58 09 63 68 61 72 20 | 2a 64 69 72 3b 0a 58 09 |.X.char |*dir;.X.|
|00001340| 73 74 72 75 63 74 20 74 | 69 6e 79 70 61 73 73 77 |struct t|inypassw|
|00001350| 64 20 2a 6e 65 78 74 3b | 20 20 2f 2a 20 6f 74 68 |d *next;| /* oth|
|00001360| 65 72 20 65 6e 74 72 69 | 65 73 20 6d 61 70 70 69 |er entri|es mappi|
|00001370| 6e 67 20 74 6f 20 73 61 | 6d 65 20 75 69 64 20 2a |ng to sa|me uid *|
|00001380| 2f 0a 58 09 63 68 61 72 | 20 2a 66 69 6c 65 3b 09 |/.X.char| *file;.|
|00001390| 09 20 20 2f 2a 20 66 69 | 6c 65 20 74 68 69 73 20 |. /* fi|le this |
|000013a0| 65 6e 74 72 79 20 77 61 | 73 20 66 6f 75 6e 64 20 |entry wa|s found |
|000013b0| 69 6e 20 2a 2f 0a 58 7d | 3b 0a 58 0a 58 23 64 65 |in */.X}|;.X.X#de|
|000013c0| 66 69 6e 65 20 4d 49 4e | 55 53 45 52 55 49 44 09 |fine MIN|USERUID.|
|000013d0| 32 30 09 2f 2a 20 64 6f | 6e 27 74 20 63 68 65 63 |20./* do|n't chec|
|000013e0| 6b 20 75 69 64 73 20 62 | 65 6c 6f 77 20 74 68 69 |k uids b|elow thi|
|000013f0| 73 20 66 6f 72 20 2a 2f | 0a 58 09 09 09 09 2f 2a |s for */|.X..../*|
|00001400| 20 6e 61 6d 65 73 20 74 | 6f 20 6d 61 74 63 68 20 | names t|o match |
|00001410| 64 69 72 65 63 74 6f 72 | 69 65 73 20 2a 2f 0a 58 |director|ies */.X|
|00001420| 23 64 65 66 69 6e 65 20 | 4d 41 58 4c 49 4e 45 4c |#define |MAXLINEL|
|00001430| 45 4e 09 31 33 32 0a 58 | 23 64 65 66 69 6e 65 20 |EN.132.X|#define |
|00001440| 4d 41 58 55 49 44 09 09 | 35 37 30 30 09 09 2f 2a |MAXUID..|5700../*|
|00001450| 20 6c 61 72 67 65 73 74 | 20 75 69 64 20 77 65 20 | largest| uid we |
|00001460| 6d 69 67 68 74 20 70 6f | 73 73 69 62 6c 79 20 73 |might po|ssibly s|
|00001470| 65 65 20 2a 2f 0a 58 23 | 64 65 66 69 6e 65 20 4e |ee */.X#|define N|
|00001480| 4f 42 4f 44 59 09 09 2d | 32 0a 58 23 64 65 66 69 |OBODY..-|2.X#defi|
|00001490| 6e 65 20 73 6b 69 70 75 | 69 64 28 78 29 09 28 78 |ne skipu|id(x).(x|
|000014a0| 20 3d 3d 20 4e 4f 42 4f | 44 59 29 09 2f 2a 20 61 | == NOBO|DY)./* a|
|000014b0| 6e 79 20 75 69 64 73 20 | 74 6f 20 73 6b 69 70 2e |ny uids |to skip.|
|000014c0| 20 20 49 66 20 6e 6f 6e | 65 20 2a 2f 0a 58 09 09 | If non|e */.X..|
|000014d0| 09 09 09 2f 2a 20 74 68 | 65 6e 20 6a 75 73 74 20 |.../* th|en just |
|000014e0| 64 65 66 69 6e 65 20 74 | 6f 20 62 65 20 30 20 2a |define t|o be 0 *|
|000014f0| 2f 0a 58 0a 58 73 74 72 | 75 63 74 20 74 69 6e 79 |/.X.Xstr|uct tiny|
|00001500| 70 61 73 73 77 64 20 2a | 70 77 64 73 5b 4d 41 58 |passwd *|pwds[MAX|
|00001510| 55 49 44 5d 3b 0a 58 63 | 68 61 72 20 6c 69 6e 65 |UID];.Xc|har line|
|00001520| 5b 4d 41 58 4c 49 4e 45 | 4c 45 4e 5d 3b 0a 58 73 |[MAXLINE|LEN];.Xs|
|00001530| 74 72 75 63 74 20 74 69 | 6e 79 70 61 73 73 77 64 |truct ti|nypasswd|
|00001540| 20 2a 70 77 64 3b 0a 58 | 0a 58 63 68 61 72 20 2a | *pwd;.X|.Xchar *|
|00001550| 6d 61 6c 6c 6f 63 28 29 | 3b 0a 58 63 68 61 72 20 |malloc()|;.Xchar |
|00001560| 2a 6e 65 77 73 74 72 28 | 29 3b 0a 58 63 68 61 72 |*newstr(|);.Xchar|
|00001570| 20 2a 72 69 6e 64 65 78 | 28 29 3b 0a 58 73 74 72 | *rindex|();.Xstr|
|00001580| 75 63 74 20 70 61 73 73 | 77 64 20 2a 66 67 65 74 |uct pass|wd *fget|
|00001590| 70 77 65 6e 74 28 29 3b | 0a 58 23 64 65 66 69 6e |pwent();|.X#defin|
|000015a0| 65 20 6e 65 77 28 74 79 | 70 65 29 09 28 74 79 70 |e new(ty|pe).(typ|
|000015b0| 65 20 2a 29 6d 61 6c 6c | 6f 63 28 73 69 7a 65 6f |e *)mall|oc(sizeo|
|000015c0| 66 28 74 79 70 65 29 29 | 0a 58 0a 58 6d 61 69 6e |f(type))|.X.Xmain|
|000015d0| 28 61 72 67 63 2c 61 72 | 67 76 29 0a 58 69 6e 74 |(argc,ar|gv).Xint|
|000015e0| 20 61 72 67 63 3b 0a 58 | 63 68 61 72 20 2a 2a 61 | argc;.X|char **a|
|000015f0| 72 67 76 3b 0a 58 7b 0a | 58 09 69 6e 74 20 66 69 |rgv;.X{.|X.int fi|
|00001600| 6c 65 3b 0a 58 09 69 6e | 74 20 75 69 64 3b 0a 58 |le;.X.in|t uid;.X|
|00001610| 09 46 49 4c 45 20 2a 70 | 66 70 3b 0a 58 09 73 74 |.FILE *p|fp;.X.st|
|00001620| 72 75 63 74 20 70 61 73 | 73 77 64 20 2a 73 74 61 |ruct pas|swd *sta|
|00001630| 74 69 63 70 77 64 3b 0a | 58 09 63 68 61 72 20 2a |ticpwd;.|X.char *|
|00001640| 6c 65 61 66 3b 0a 58 0a | 58 09 66 6f 72 20 28 75 |leaf;.X.|X.for (u|
|00001650| 69 64 3d 30 3b 75 69 64 | 3c 4d 41 58 55 49 44 3b |id=0;uid|<MAXUID;|
|00001660| 75 69 64 2b 2b 29 20 70 | 77 64 73 5b 75 69 64 5d |uid++) p|wds[uid]|
|00001670| 20 3d 20 4e 55 4c 4c 3b | 0a 58 0a 58 09 66 6f 72 | = NULL;|.X.X.for|
|00001680| 20 28 66 69 6c 65 3d 31 | 3b 66 69 6c 65 3c 61 72 | (file=1|;file<ar|
|00001690| 67 63 3b 66 69 6c 65 2b | 2b 29 20 7b 0a 58 09 09 |gc;file+|+) {.X..|
|000016a0| 69 66 20 28 4e 55 4c 4c | 20 3d 3d 20 28 70 66 70 |if (NULL| == (pfp|
|000016b0| 20 3d 20 66 6f 70 65 6e | 28 61 72 67 76 5b 66 69 | = fopen|(argv[fi|
|000016c0| 6c 65 5d 2c 22 72 22 29 | 29 29 20 7b 0a 58 09 09 |le],"r")|)) {.X..|
|000016d0| 09 70 65 72 72 6f 72 28 | 61 72 67 76 5b 66 69 6c |.perror(|argv[fil|
|000016e0| 65 5d 29 3b 0a 58 09 09 | 09 63 6f 6e 74 69 6e 75 |e]);.X..|.continu|
|000016f0| 65 3b 0a 58 09 09 7d 0a | 58 0a 58 09 09 77 68 69 |e;.X..}.|X.X..whi|
|00001700| 6c 65 20 28 4e 55 4c 4c | 20 21 3d 20 28 73 74 61 |le (NULL| != (sta|
|00001710| 74 69 63 70 77 64 20 3d | 20 66 67 65 74 70 77 65 |ticpwd =| fgetpwe|
|00001720| 6e 74 28 70 66 70 29 29 | 29 20 7b 0a 58 09 09 09 |nt(pfp))|) {.X...|
|00001730| 69 66 20 28 70 77 64 20 | 3d 3d 20 4e 55 4c 4c 29 |if (pwd |== NULL)|
|00001740| 20 7b 0a 58 09 09 09 09 | 69 66 20 28 4e 55 4c 4c | {.X....|if (NULL|
|00001750| 20 3d 3d 20 28 70 77 64 | 20 3d 20 6e 65 77 28 73 | == (pwd| = new(s|
|00001760| 74 72 75 63 74 20 74 69 | 6e 79 70 61 73 73 77 64 |truct ti|nypasswd|
|00001770| 29 29 29 20 7b 0a 58 09 | 09 09 09 09 70 72 69 6e |))) {.X.|....prin|
|00001780| 74 66 28 22 6d 61 6c 6c | 6f 63 3a 20 6f 75 74 20 |tf("mall|oc: out |
|00001790| 6f 66 20 73 70 61 63 65 | 5c 6e 22 29 3b 0a 58 09 |of space|\n");.X.|
|000017a0| 09 09 09 09 65 78 69 74 | 28 2d 31 29 3b 0a 58 09 |....exit|(-1);.X.|
|000017b0| 09 09 09 7d 0a 58 09 09 | 09 7d 0a 58 0a 58 09 09 |...}.X..|.}.X.X..|
|000017c0| 09 2f 2a 20 73 6b 69 70 | 20 53 75 6e 20 79 70 20 |./* skip| Sun yp |
|000017d0| 68 6f 6f 6b 20 2a 2f 0a | 58 09 09 09 69 66 20 28 |hook */.|X...if (|
|000017e0| 73 74 61 74 69 63 70 77 | 64 2d 3e 70 77 5f 6e 61 |staticpw|d->pw_na|
|000017f0| 6d 65 5b 30 5d 20 3d 3d | 20 27 2b 27 29 20 63 6f |me[0] ==| '+') co|
|00001800| 6e 74 69 6e 75 65 3b 0a | 58 0a 58 09 09 09 70 77 |ntinue;.|X.X...pw|
|00001810| 64 2d 3e 6e 61 6d 65 20 | 3d 20 6e 65 77 73 74 72 |d->name |= newstr|
|00001820| 28 73 74 61 74 69 63 70 | 77 64 2d 3e 70 77 5f 6e |(staticp|wd->pw_n|
|00001830| 61 6d 65 29 3b 0a 58 09 | 09 09 70 77 64 2d 3e 64 |ame);.X.|..pwd->d|
|00001840| 69 72 20 3d 20 6e 65 77 | 73 74 72 28 73 74 61 74 |ir = new|str(stat|
|00001850| 69 63 70 77 64 2d 3e 70 | 77 5f 64 69 72 29 3b 0a |icpwd->p|w_dir);.|
|00001860| 58 09 09 09 75 69 64 20 | 3d 20 73 74 61 74 69 63 |X...uid |= static|
|00001870| 70 77 64 2d 3e 70 77 5f | 75 69 64 3b 0a 58 0a 58 |pwd->pw_|uid;.X.X|
|00001880| 09 09 09 69 66 20 28 73 | 6b 69 70 75 69 64 28 75 |...if (s|kipuid(u|
|00001890| 69 64 29 29 20 63 6f 6e | 74 69 6e 75 65 3b 0a 58 |id)) con|tinue;.X|
|000018a0| 09 09 09 69 66 20 28 75 | 69 64 20 3c 20 30 20 7c |...if (u|id < 0 ||
|000018b0| 7c 20 75 69 64 20 3e 3d | 20 4d 41 58 55 49 44 29 || uid >=| MAXUID)|
|000018c0| 20 7b 0a 58 09 09 09 09 | 70 72 69 6e 74 66 28 22 | {.X....|printf("|
|000018d0| 25 73 3a 20 75 69 64 20 | 25 64 20 6f 75 74 20 6f |%s: uid |%d out o|
|000018e0| 66 20 72 61 6e 67 65 5c | 6e 22 2c 0a 58 09 09 09 |f range\|n",.X...|
|000018f0| 09 09 61 72 67 76 5b 66 | 69 6c 65 5d 2c 75 69 64 |..argv[f|ile],uid|
|00001900| 29 3b 0a 58 09 09 09 09 | 63 6f 6e 74 69 6e 75 65 |);.X....|continue|
|00001910| 3b 0a 58 09 09 09 7d 0a | 58 0a 58 09 09 09 2f 2a |;.X...}.|X.X.../*|
|00001920| 20 63 68 65 63 6b 20 66 | 6f 72 20 6d 61 74 63 68 | check f|or match|
|00001930| 69 6e 67 20 64 69 72 65 | 63 74 6f 72 69 65 73 20 |ing dire|ctories |
|00001940| 6f 6e 20 6c 61 72 67 65 | 20 75 69 64 73 20 2a 2f |on large| uids */|
|00001950| 0a 58 09 09 09 69 66 20 | 28 75 69 64 20 3e 20 4d |.X...if |(uid > M|
|00001960| 49 4e 55 53 45 52 55 49 | 44 29 20 7b 0a 58 09 09 |INUSERUI|D) {.X..|
|00001970| 09 09 69 66 20 28 30 20 | 3d 3d 20 28 6c 65 61 66 |..if (0 |== (leaf|
|00001980| 20 3d 20 72 69 6e 64 65 | 78 28 70 77 64 2d 3e 64 | = rinde|x(pwd->d|
|00001990| 69 72 2c 27 2f 27 29 29 | 29 20 7b 0a 58 09 09 09 |ir,'/'))|) {.X...|
|000019a0| 09 09 70 72 69 6e 74 66 | 28 22 25 73 3a 20 6e 6f |..printf|("%s: no|
|000019b0| 20 6c 65 61 66 20 69 6e | 20 64 69 72 65 63 74 6f | leaf in| directo|
|000019c0| 72 79 20 25 73 5c 6e 22 | 2c 0a 58 09 09 09 09 09 |ry %s\n"|,.X.....|
|000019d0| 09 61 72 67 76 5b 66 69 | 6c 65 5d 2c 6c 69 6e 65 |.argv[fi|le],line|
|000019e0| 29 3b 0a 58 09 09 09 09 | 7d 20 65 6c 73 65 20 69 |);.X....|} else i|
|000019f0| 66 20 28 30 20 21 3d 20 | 73 74 72 63 6d 70 28 70 |f (0 != |strcmp(p|
|00001a00| 77 64 2d 3e 6e 61 6d 65 | 2c 31 2b 6c 65 61 66 29 |wd->name|,1+leaf)|
|00001a10| 29 20 7b 0a 58 09 09 09 | 09 09 70 72 69 6e 74 66 |) {.X...|..printf|
|00001a20| 28 22 25 73 3a 20 6e 69 | 63 6b 6e 61 6d 65 20 25 |("%s: ni|ckname %|
|00001a30| 73 20 68 61 73 20 64 69 | 72 65 63 74 6f 72 79 20 |s has di|rectory |
|00001a40| 25 73 5c 6e 22 2c 0a 58 | 09 09 09 09 09 09 61 72 |%s\n",.X|......ar|
|00001a50| 67 76 5b 66 69 6c 65 5d | 2c 70 77 64 2d 3e 6e 61 |gv[file]|,pwd->na|
|00001a60| 6d 65 2c 70 77 64 2d 3e | 64 69 72 29 3b 0a 58 09 |me,pwd->|dir);.X.|
|00001a70| 09 09 09 7d 0a 58 09 09 | 09 7d 0a 58 0a 58 09 09 |...}.X..|.}.X.X..|
|00001a80| 09 70 77 64 2d 3e 66 69 | 6c 65 20 3d 20 61 72 67 |.pwd->fi|le = arg|
|00001a90| 76 5b 66 69 6c 65 5d 3b | 0a 58 09 09 09 70 77 64 |v[file];|.X...pwd|
|00001aa0| 2d 3e 6e 65 78 74 20 3d | 20 4e 55 4c 4c 3b 0a 58 |->next =| NULL;.X|
|00001ab0| 0a 58 09 09 09 69 66 20 | 28 21 68 61 73 68 5f 70 |.X...if |(!hash_p|
|00001ac0| 77 64 28 26 70 77 64 73 | 5b 75 69 64 5d 2c 70 77 |wd(&pwds|[uid],pw|
|00001ad0| 64 29 29 20 7b 0a 58 09 | 09 09 09 66 72 65 65 28 |d)) {.X.|...free(|
|00001ae0| 70 77 64 2d 3e 6e 61 6d | 65 29 3b 0a 58 09 09 09 |pwd->nam|e);.X...|
|00001af0| 09 66 72 65 65 28 70 77 | 64 2d 3e 64 69 72 29 3b |.free(pw|d->dir);|
|00001b00| 0a 58 09 09 09 7d 20 65 | 6c 73 65 20 70 77 64 20 |.X...} e|lse pwd |
|00001b10| 3d 20 4e 55 4c 4c 3b 0a | 58 09 09 7d 0a 58 09 09 |= NULL;.|X..}.X..|
|00001b20| 66 63 6c 6f 73 65 28 70 | 66 70 29 3b 0a 58 09 7d |fclose(p|fp);.X.}|
|00001b30| 0a 58 0a 58 09 2f 2a 20 | 73 63 61 6e 20 64 6f 77 |.X.X./* |scan dow|
|00001b40| 6e 20 6c 69 73 74 20 6c | 6f 6f 6b 69 6e 67 20 66 |n list l|ooking f|
|00001b50| 6f 72 20 64 75 70 73 20 | 2a 2f 0a 58 09 66 6f 72 |or dups |*/.X.for|
|00001b60| 20 28 75 69 64 3d 30 3b | 75 69 64 3c 4d 41 58 55 | (uid=0;|uid<MAXU|
|00001b70| 49 44 3b 75 69 64 2b 2b | 29 20 7b 0a 58 09 09 2f |ID;uid++|) {.X../|
|00001b80| 2a 20 6e 6f 20 70 77 64 | 20 77 69 74 68 20 74 68 |* no pwd| with th|
|00001b90| 69 73 20 75 69 64 20 2a | 2f 0a 58 09 09 69 66 20 |is uid *|/.X..if |
|00001ba0| 28 70 77 64 73 5b 75 69 | 64 5d 20 3d 3d 20 4e 55 |(pwds[ui|d] == NU|
|00001bb0| 4c 4c 29 20 63 6f 6e 74 | 69 6e 75 65 3b 0a 58 0a |LL) cont|inue;.X.|
|00001bc0| 58 09 09 2f 2a 20 6e 6f | 20 6f 74 68 65 72 20 70 |X../* no| other p|
|00001bd0| 77 64 20 77 69 74 68 20 | 74 68 69 73 20 75 69 64 |wd with |this uid|
|00001be0| 20 2a 2f 0a 58 09 09 69 | 66 20 28 70 77 64 73 5b | */.X..i|f (pwds[|
|00001bf0| 75 69 64 5d 2d 3e 6e 65 | 78 74 20 3d 3d 20 4e 55 |uid]->ne|xt == NU|
|00001c00| 4c 4c 29 20 63 6f 6e 74 | 69 6e 75 65 3b 0a 58 0a |LL) cont|inue;.X.|
|00001c10| 58 09 09 70 72 69 6e 74 | 5f 70 77 64 28 75 69 64 |X..print|_pwd(uid|
|00001c20| 29 3b 0a 58 09 7d 0a 58 | 7d 0a 58 0a 58 70 72 69 |);.X.}.X|}.X.Xpri|
|00001c30| 6e 74 5f 70 77 64 28 75 | 69 64 29 0a 58 69 6e 74 |nt_pwd(u|id).Xint|
|00001c40| 20 75 69 64 3b 0a 58 7b | 0a 58 09 73 74 72 75 63 | uid;.X{|.X.struc|
|00001c50| 74 20 74 69 6e 79 70 61 | 73 73 77 64 20 2a 70 3b |t tinypa|sswd *p;|
|00001c60| 0a 58 0a 58 09 66 6f 72 | 20 28 70 20 3d 20 70 77 |.X.X.for| (p = pw|
|00001c70| 64 73 5b 75 69 64 5d 3b | 70 3b 70 3d 70 2d 3e 6e |ds[uid];|p;p=p->n|
|00001c80| 65 78 74 29 20 7b 0a 58 | 09 09 70 72 69 6e 74 66 |ext) {.X|..printf|
|00001c90| 28 22 25 36 64 20 25 32 | 30 73 20 25 34 30 73 5c |("%6d %2|0s %40s\|
|00001ca0| 6e 22 2c 75 69 64 2c 70 | 2d 3e 6e 61 6d 65 2c 70 |n",uid,p|->name,p|
|00001cb0| 2d 3e 66 69 6c 65 29 3b | 0a 58 09 7d 0a 58 7d 0a |->file);|.X.}.X}.|
|00001cc0| 58 0a 58 2f 2a 20 72 65 | 74 75 72 6e 73 20 54 52 |X.X/* re|turns TR|
|00001cd0| 55 45 20 69 66 20 70 77 | 64 20 73 74 6f 72 65 64 |UE if pw|d stored|
|00001ce0| 2c 20 46 41 4c 53 45 20 | 69 66 20 6e 6f 74 20 73 |, FALSE |if not s|
|00001cf0| 74 6f 72 65 64 20 2a 2f | 0a 58 68 61 73 68 5f 70 |tored */|.Xhash_p|
|00001d00| 77 64 28 70 65 70 2c 70 | 29 0a 58 73 74 72 75 63 |wd(pep,p|).Xstruc|
|00001d10| 74 20 74 69 6e 79 70 61 | 73 73 77 64 20 2a 2a 70 |t tinypa|sswd **p|
|00001d20| 65 70 3b 09 2f 2a 20 70 | 77 64 73 20 65 6e 74 72 |ep;./* p|wds entr|
|00001d30| 79 20 70 6f 69 6e 74 65 | 72 20 2a 2f 0a 58 73 74 |y pointe|r */.Xst|
|00001d40| 72 75 63 74 20 74 69 6e | 79 70 61 73 73 77 64 20 |ruct tin|ypasswd |
|00001d50| 2a 70 3b 0a 58 7b 0a 58 | 09 69 6e 74 20 64 69 66 |*p;.X{.X|.int dif|
|00001d60| 66 65 72 65 6e 74 20 3d | 20 46 41 4c 53 45 3b 0a |ferent =| FALSE;.|
|00001d70| 58 09 73 74 72 75 63 74 | 20 74 69 6e 79 70 61 73 |X.struct| tinypas|
|00001d80| 73 77 64 20 2a 70 70 74 | 72 3b 20 20 2f 2a 20 70 |swd *ppt|r; /* p|
|00001d90| 6f 69 6e 74 65 72 20 74 | 6f 20 6f 70 65 6e 2d 68 |ointer t|o open-h|
|00001da0| 61 73 68 65 64 20 70 77 | 64 20 65 6e 74 72 69 65 |ashed pw|d entrie|
|00001db0| 73 20 2a 2f 0a 58 09 73 | 74 72 75 63 74 20 74 69 |s */.X.s|truct ti|
|00001dc0| 6e 79 70 61 73 73 77 64 | 20 2a 6c 61 73 74 70 3b |nypasswd| *lastp;|
|00001dd0| 20 2f 2a 20 77 68 65 72 | 65 20 74 6f 20 61 70 70 | /* wher|e to app|
|00001de0| 65 6e 64 20 6e 65 77 20 | 73 74 72 75 63 74 20 70 |end new |struct p|
|00001df0| 61 73 73 77 64 20 2a 2f | 0a 58 0a 58 09 69 66 20 |asswd */|.X.X.if |
|00001e00| 28 4e 55 4c 4c 20 3d 3d | 20 2a 70 65 70 29 20 7b |(NULL ==| *pep) {|
|00001e10| 0a 58 09 09 2a 70 65 70 | 20 3d 20 70 3b 0a 58 09 |.X..*pep| = p;.X.|
|00001e20| 09 72 65 74 75 72 6e 28 | 54 52 55 45 29 3b 0a 58 |.return(|TRUE);.X|
|00001e30| 09 7d 0a 58 0a 58 09 66 | 6f 72 20 28 70 70 74 72 |.}.X.X.f|or (pptr|
|00001e40| 20 3d 20 2a 70 65 70 3b | 70 70 74 72 3b 70 70 74 | = *pep;|pptr;ppt|
|00001e50| 72 3d 70 70 74 72 2d 3e | 6e 65 78 74 29 20 7b 0a |r=pptr->|next) {.|
|00001e60| 58 09 09 6c 61 73 74 70 | 20 3d 20 70 70 74 72 3b |X..lastp| = pptr;|
|00001e70| 0a 58 09 09 69 66 20 28 | 64 69 66 66 65 72 65 6e |.X..if (|differen|
|00001e80| 74 29 20 63 6f 6e 74 69 | 6e 75 65 3b 09 2f 2a 20 |t) conti|nue;./* |
|00001e90| 6a 75 73 74 20 67 65 74 | 20 74 6f 20 65 6e 64 20 |just get| to end |
|00001ea0| 6f 66 20 6c 69 73 74 20 | 2a 2f 0a 58 09 09 69 66 |of list |*/.X..if|
|00001eb0| 20 28 30 20 21 3d 20 73 | 74 72 63 6d 70 28 70 70 | (0 != s|trcmp(pp|
|00001ec0| 74 72 2d 3e 6e 61 6d 65 | 2c 70 2d 3e 6e 61 6d 65 |tr->name|,p->name|
|00001ed0| 29 29 20 64 69 66 66 65 | 72 65 6e 74 20 3d 20 54 |)) diffe|rent = T|
|00001ee0| 52 55 45 3b 0a 58 09 7d | 0a 58 09 69 66 20 28 64 |RUE;.X.}|.X.if (d|
|00001ef0| 69 66 66 65 72 65 6e 74 | 29 20 6c 61 73 74 70 2d |ifferent|) lastp-|
|00001f00| 3e 6e 65 78 74 20 3d 20 | 70 3b 0a 58 0a 58 09 72 |>next = |p;.X.X.r|
|00001f10| 65 74 75 72 6e 28 64 69 | 66 66 65 72 65 6e 74 29 |eturn(di|fferent)|
|00001f20| 3b 0a 58 7d 0a 58 0a 58 | 63 68 61 72 20 2a 6e 65 |;.X}.X.X|char *ne|
|00001f30| 77 73 74 72 28 73 29 0a | 58 63 68 61 72 20 2a 73 |wstr(s).|Xchar *s|
|00001f40| 3b 0a 58 7b 0a 58 09 63 | 68 61 72 20 2a 6e 65 77 |;.X{.X.c|har *new|
|00001f50| 73 3b 0a 58 0a 58 09 69 | 66 20 28 21 28 6e 65 77 |s;.X.X.i|f (!(new|
|00001f60| 73 20 3d 20 6d 61 6c 6c | 6f 63 28 31 2b 73 74 72 |s = mall|oc(1+str|
|00001f70| 6c 65 6e 28 73 29 29 29 | 29 20 7b 0a 58 09 09 70 |len(s)))|) {.X..p|
|00001f80| 72 69 6e 74 66 28 22 6e | 65 77 73 74 72 3a 20 6f |rintf("n|ewstr: o|
|00001f90| 75 74 20 6f 66 20 73 70 | 61 63 65 5c 6e 22 29 3b |ut of sp|ace\n");|
|00001fa0| 0a 58 09 09 65 78 69 74 | 28 30 29 3b 0a 58 09 7d |.X..exit|(0);.X.}|
|00001fb0| 0a 58 09 73 74 72 63 70 | 79 28 6e 65 77 73 2c 73 |.X.strcp|y(news,s|
|00001fc0| 29 3b 0a 58 09 72 65 74 | 75 72 6e 28 6e 65 77 73 |);.X.ret|urn(news|
|00001fd0| 29 3b 0a 58 7d 0a 45 4e | 44 5f 4f 46 5f 46 49 4c |);.X}.EN|D_OF_FIL|
|00001fe0| 45 0a 69 66 20 74 65 73 | 74 20 33 33 31 31 20 2d |E.if tes|t 3311 -|
|00001ff0| 6e 65 20 60 77 63 20 2d | 63 20 3c 27 70 77 64 69 |ne `wc -|c <'pwdi|
|00002000| 66 66 2e 63 27 60 3b 20 | 74 68 65 6e 0a 20 20 20 |ff.c'`; |then. |
|00002010| 20 65 63 68 6f 20 73 68 | 61 72 3a 20 5c 22 27 70 | echo sh|ar: \"'p|
|00002020| 77 64 69 66 66 2e 63 27 | 5c 22 20 75 6e 70 61 63 |wdiff.c'|\" unpac|
|00002030| 6b 65 64 20 77 69 74 68 | 20 77 72 6f 6e 67 20 73 |ked with| wrong s|
|00002040| 69 7a 65 21 0a 66 69 0a | 23 20 65 6e 64 20 6f 66 |ize!.fi.|# end of|
|00002050| 20 27 70 77 64 69 66 66 | 2e 63 27 0a 66 69 0a 65 | 'pwdiff|.c'.fi.e|
|00002060| 63 68 6f 20 73 68 61 72 | 3a 20 45 6e 64 20 6f 66 |cho shar|: End of|
|00002070| 20 73 68 65 6c 6c 20 61 | 72 63 68 69 76 65 2e 0a | shell a|rchive..|
|00002080| 65 78 69 74 20 30 0a 0a | 2d 2d 20 0a 50 6c 65 61 |exit 0..|-- .Plea|
|00002090| 73 65 20 73 65 6e 64 20 | 63 6f 6d 70 2e 73 6f 75 |se send |comp.sou|
|000020a0| 72 63 65 73 2e 75 6e 69 | 78 2d 72 65 6c 61 74 65 |rces.uni|x-relate|
|000020b0| 64 20 6d 61 69 6c 20 74 | 6f 20 72 73 61 6c 7a 40 |d mail t|o rsalz@|
|000020c0| 75 75 6e 65 74 2e 75 75 | 2e 6e 65 74 2e 0a |uunet.uu|.net.. |
+--------+-------------------------+-------------------------+--------+--------+