home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source textAlgol 68 source text
| default
| |
98%
| file
| Pascal source text
| default
| |
97%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 58 2d |.sources|.misc.X-|
|00000020| 55 4e 49 58 2d 46 72 6f | 6d 3a 20 6e 73 61 79 65 |UNIX-Fro|m: nsaye|
|00000030| 72 40 75 6f 70 2e 75 6f | 70 2e 65 64 75 0a 6f 72 |r@uop.uo|p.edu.or|
|00000040| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 55 6e 69 76 |ganizati|on: Univ|
|00000050| 65 72 73 69 74 79 20 6f | 66 20 74 68 65 20 50 61 |ersity o|f the Pa|
|00000060| 63 69 66 69 63 2c 20 53 | 74 6f 63 6b 74 6f 6e 2c |cific, S|tockton,|
|00000070| 20 43 41 20 5b 31 33 38 | 2e 39 2e 32 30 30 2e 31 | CA [138|.9.200.1|
|00000080| 5d 0a 73 75 62 6a 65 63 | 74 3a 20 76 31 35 69 30 |].subjec|t: v15i0|
|00000090| 34 38 3a 20 52 6f 6f 74 | 2d 73 68 65 6c 6c 20 67 |48: Root|-shell g|
|000000a0| 69 76 65 72 20 2d 2d 20 | 6e 65 77 20 61 6e 64 20 |iver -- |new and |
|000000b0| 69 6d 70 72 6f 76 65 64 | 20 22 73 75 22 0a 66 72 |improved| "su".fr|
|000000c0| 6f 6d 3a 20 6d 72 61 70 | 70 6c 65 40 71 75 61 63 |om: mrap|ple@quac|
|000000d0| 6b 2e 73 61 63 2e 63 61 | 2e 75 73 20 28 4e 69 63 |k.sac.ca|.us (Nic|
|000000e0| 6b 20 53 61 79 65 72 29 | 0a 53 65 6e 64 65 72 3a |k Sayer)|.Sender:|
|000000f0| 20 61 6c 6c 62 65 72 79 | 40 75 75 6e 65 74 2e 55 | allbery|@uunet.U|
|00000100| 55 2e 4e 45 54 20 28 42 | 72 61 6e 64 6f 6e 20 53 |U.NET (B|randon S|
|00000110| 2e 20 41 6c 6c 62 65 72 | 79 20 2d 20 63 6f 6d 70 |. Allber|y - comp|
|00000120| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 29 0a 0a |.sources|.misc)..|
|00000130| 50 6f 73 74 69 6e 67 2d | 6e 75 6d 62 65 72 3a 20 |Posting-|number: |
|00000140| 56 6f 6c 75 6d 65 20 31 | 35 2c 20 49 73 73 75 65 |Volume 1|5, Issue|
|00000150| 20 34 38 0a 53 75 62 6d | 69 74 74 65 64 2d 62 79 | 48.Subm|itted-by|
|00000160| 3a 20 6d 72 61 70 70 6c | 65 40 71 75 61 63 6b 2e |: mrappl|e@quack.|
|00000170| 73 61 63 2e 63 61 2e 75 | 73 20 28 4e 69 63 6b 20 |sac.ca.u|s (Nick |
|00000180| 53 61 79 65 72 29 0a 41 | 72 63 68 69 76 65 2d 6e |Sayer).A|rchive-n|
|00000190| 61 6d 65 3a 20 73 65 63 | 2f 70 61 72 74 30 31 0a |ame: sec|/part01.|
|000001a0| 0a 5b 55 73 65 73 20 73 | 79 73 6c 6f 67 20 61 6e |.[Uses s|yslog an|
|000001b0| 64 20 69 73 20 6f 74 68 | 65 72 77 69 73 65 20 42 |d is oth|erwise B|
|000001c0| 53 44 2d 73 70 65 63 69 | 66 69 63 3b 20 68 6f 77 |SD-speci|fic; how|
|000001d0| 65 76 65 72 2c 20 69 74 | 20 73 68 6f 75 6c 64 20 |ever, it| should |
|000001e0| 6e 6f 74 20 62 65 20 74 | 6f 6f 0a 64 69 66 66 69 |not be t|oo.diffi|
|000001f0| 63 75 6c 74 20 74 6f 20 | 63 6f 6e 76 65 72 74 20 |cult to |convert |
|00000200| 74 6f 20 53 79 73 74 65 | 6d 20 56 2e 0a 0a 49 20 |to Syste|m V...I |
|00000210| 6d 75 73 74 20 61 64 6d | 69 74 20 74 68 61 74 20 |must adm|it that |
|00000220| 67 69 76 69 6e 67 20 65 | 61 63 68 20 75 73 65 72 |giving e|ach user|
|00000230| 20 77 68 6f 20 69 73 20 | 70 65 72 6d 69 74 74 65 | who is |permitte|
|00000240| 64 20 74 6f 20 75 73 65 | 20 72 6f 6f 74 20 61 20 |d to use| root a |
|00000250| 70 61 73 73 77 6f 72 64 | 0a 74 68 61 74 20 6f 6e |password|.that on|
|00000260| 6c 79 20 77 6f 72 6b 73 | 20 66 6f 72 20 74 68 61 |ly works| for tha|
|00000270| 74 20 75 73 65 72 20 69 | 73 20 61 6e 20 69 6d 70 |t user i|s an imp|
|00000280| 72 6f 76 65 6d 65 6e 74 | 20 6f 76 65 72 20 74 68 |rovement| over th|
|00000290| 65 20 73 74 61 6e 64 61 | 72 64 20 22 73 75 22 20 |e standa|rd "su" |
|000002a0| 6d 6f 64 65 6c 2c 0a 61 | 6e 64 20 63 65 72 74 61 |model,.a|nd certa|
|000002b0| 69 6e 6c 79 20 6f 76 65 | 72 20 61 20 70 72 6f 67 |inly ove|r a prog|
|000002c0| 72 61 6d 20 74 68 61 74 | 20 77 61 73 20 69 6e 20 |ram that| was in |
|000002d0| 75 73 65 20 6f 6e 20 6e | 63 6f 61 73 74 20 73 6f |use on n|coast so|
|000002e0| 6d 65 20 79 65 61 72 73 | 20 61 67 6f 2e 20 20 42 |me years| ago. B|
|000002f0| 75 74 0a 72 65 6d 65 6d | 62 65 72 20 74 68 61 74 |ut.remem|ber that|
|00000300| 20 67 69 76 69 6e 67 20 | 2a 61 6e 79 6f 6e 65 2a | giving |*anyone*|
|00000310| 20 6f 74 68 65 72 20 74 | 68 61 6e 20 74 68 65 20 | other t|han the |
|00000320| 73 79 73 74 65 6d 20 61 | 64 6d 69 6e 69 73 74 72 |system a|dministr|
|00000330| 61 74 6f 72 20 74 68 65 | 20 61 62 69 6c 69 74 79 |ator the| ability|
|00000340| 0a 74 6f 20 61 63 63 65 | 73 73 20 72 6f 6f 74 20 |.to acce|ss root |
|00000350| 69 73 20 61 20 70 6f 74 | 65 6e 74 69 61 6c 20 73 |is a pot|ential s|
|00000360| 65 63 75 72 69 74 79 20 | 68 6f 6c 65 3b 20 61 73 |ecurity |hole; as|
|00000370| 20 61 6c 77 61 79 73 2c | 20 63 6f 6e 73 69 64 65 | always,| conside|
|00000380| 72 20 63 61 72 65 66 75 | 6c 6c 79 0a 62 65 66 6f |r carefu|lly.befo|
|00000390| 72 65 20 61 6c 6c 6f 77 | 69 6e 67 20 73 6f 6d 65 |re allow|ing some|
|000003a0| 6f 6e 65 20 72 6f 6f 74 | 20 61 63 63 65 73 73 2e |one root| access.|
|000003b0| 20 20 2b 2b 62 73 61 5d | 0a 0a 49 27 6d 20 6e 6f | ++bsa]|..I'm no|
|000003c0| 74 20 71 75 69 74 65 20 | 73 75 72 65 20 77 68 61 |t quite |sure wha|
|000003d0| 74 20 74 6f 20 63 61 6c | 6c 20 74 68 69 73 2c 20 |t to cal|l this, |
|000003e0| 62 75 74 20 49 20 63 61 | 6c 6c 20 69 74 20 22 73 |but I ca|ll it "s|
|000003f0| 65 63 2e 22 20 41 6e 79 | 77 61 79 2c 0a 49 27 76 |ec." Any|way,.I'v|
|00000400| 65 20 68 61 64 20 61 20 | 63 6f 75 70 6c 65 20 72 |e had a |couple r|
|00000410| 65 71 75 65 73 74 73 20 | 66 6f 72 20 69 74 2c 20 |equests |for it, |
|00000420| 73 6f 20 49 20 74 68 6f | 75 67 68 74 20 49 27 64 |so I tho|ught I'd|
|00000430| 20 70 61 73 73 20 69 74 | 20 61 6c 6f 6e 67 2e 0a | pass it| along..|
|00000440| 0a 23 21 2f 62 69 6e 2f | 73 68 0a 23 20 54 68 69 |.#!/bin/|sh.# Thi|
|00000450| 73 20 69 73 20 61 20 73 | 68 65 6c 6c 20 61 72 63 |s is a s|hell arc|
|00000460| 68 69 76 65 20 28 70 72 | 6f 64 75 63 65 64 20 62 |hive (pr|oduced b|
|00000470| 79 20 73 68 61 72 20 33 | 2e 34 39 29 0a 23 20 54 |y shar 3|.49).# T|
|00000480| 6f 20 65 78 74 72 61 63 | 74 20 74 68 65 20 66 69 |o extrac|t the fi|
|00000490| 6c 65 73 20 66 72 6f 6d | 20 74 68 69 73 20 61 72 |les from| this ar|
|000004a0| 63 68 69 76 65 2c 20 73 | 61 76 65 20 69 74 20 74 |chive, s|ave it t|
|000004b0| 6f 20 61 20 66 69 6c 65 | 2c 20 72 65 6d 6f 76 65 |o a file|, remove|
|000004c0| 0a 23 20 65 76 65 72 79 | 74 68 69 6e 67 20 61 62 |.# every|thing ab|
|000004d0| 6f 76 65 20 74 68 65 20 | 22 21 2f 62 69 6e 2f 73 |ove the |"!/bin/s|
|000004e0| 68 22 20 6c 69 6e 65 20 | 61 62 6f 76 65 2c 20 61 |h" line |above, a|
|000004f0| 6e 64 20 74 79 70 65 20 | 22 73 68 20 66 69 6c 65 |nd type |"sh file|
|00000500| 5f 6e 61 6d 65 22 2e 0a | 23 0a 23 20 6d 61 64 65 |_name"..|#.# made|
|00000510| 20 31 30 2f 30 38 2f 31 | 39 39 30 20 31 39 3a 33 | 10/08/1|990 19:3|
|00000520| 39 20 55 54 43 20 62 79 | 20 6e 73 61 79 65 72 40 |9 UTC by| nsayer@|
|00000530| 75 6f 70 0a 23 20 53 6f | 75 72 63 65 20 64 69 72 |uop.# So|urce dir|
|00000540| 65 63 74 6f 72 79 20 2f | 66 69 6c 65 73 2f 75 73 |ectory /|files/us|
|00000550| 65 72 73 2f 73 74 61 66 | 66 2d 75 6f 70 2f 6e 73 |ers/staf|f-uop/ns|
|00000560| 61 79 65 72 2f 73 65 63 | 0a 23 0a 23 20 65 78 69 |ayer/sec|.#.# exi|
|00000570| 73 74 69 6e 67 20 66 69 | 6c 65 73 20 77 69 6c 6c |sting fi|les will|
|00000580| 20 4e 4f 54 20 62 65 20 | 6f 76 65 72 77 72 69 74 | NOT be |overwrit|
|00000590| 74 65 6e 20 75 6e 6c 65 | 73 73 20 2d 63 20 69 73 |ten unle|ss -c is|
|000005a0| 20 73 70 65 63 69 66 69 | 65 64 0a 23 0a 23 20 20 | specifi|ed.#.# |
|000005b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005f0| 20 20 20 20 20 20 20 20 | 0a 23 20 20 20 20 20 20 | |.# |
|00000600| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000610| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000620| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000630| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000640| 20 20 20 20 0a 23 0a 23 | 20 54 68 69 73 20 73 68 | .#.#| This sh|
|00000650| 61 72 20 63 6f 6e 74 61 | 69 6e 73 3a 0a 23 20 6c |ar conta|ins:.# l|
|00000660| 65 6e 67 74 68 20 20 6d | 6f 64 65 20 20 20 20 20 |ength m|ode |
|00000670| 20 20 6e 61 6d 65 0a 23 | 20 2d 2d 2d 2d 2d 2d 20 | name.#| ------ |
|00000680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 2d 2d 2d 2d 2d |--------|-- -----|
|00000690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006b0| 2d 2d 2d 2d 2d 0a 23 20 | 20 20 31 33 31 35 20 2d |-----.# | 1315 -|
|000006c0| 72 77 2d 72 2d 2d 72 2d | 2d 20 73 65 63 2e 63 0a |rw-r--r-|- sec.c.|
|000006d0| 23 20 20 20 31 36 37 32 | 20 2d 72 77 2d 72 2d 2d |# 1672| -rw-r--|
|000006e0| 72 2d 2d 20 73 65 63 70 | 77 2e 63 0a 23 20 20 20 |r-- secp|w.c.# |
|000006f0| 20 37 33 37 20 2d 72 77 | 2d 72 2d 2d 72 2d 2d 20 | 737 -rw|-r--r-- |
|00000700| 4d 61 6b 65 66 69 6c 65 | 0a 23 20 20 20 31 38 30 |Makefile|.# 180|
|00000710| 33 20 2d 72 77 2d 72 2d | 2d 72 2d 2d 20 52 45 41 |3 -rw-r-|-r-- REA|
|00000720| 44 4d 45 0a 23 20 20 20 | 20 37 39 36 20 2d 72 77 |DME.# | 796 -rw|
|00000730| 2d 72 2d 2d 72 2d 2d 20 | 63 6f 6e 66 69 67 2e 68 |-r--r-- |config.h|
|00000740| 0a 23 0a 69 66 20 74 65 | 73 74 20 2d 72 20 5f 73 |.#.if te|st -r _s|
|00000750| 68 61 72 5f 73 65 71 5f | 2e 74 6d 70 3b 20 74 68 |har_seq_|.tmp; th|
|00000760| 65 6e 0a 09 65 63 68 6f | 20 27 4d 75 73 74 20 75 |en..echo| 'Must u|
|00000770| 6e 70 61 63 6b 20 61 72 | 63 68 69 76 65 73 20 69 |npack ar|chives i|
|00000780| 6e 20 73 65 71 75 65 6e | 63 65 21 27 0a 09 65 63 |n sequen|ce!'..ec|
|00000790| 68 6f 20 50 6c 65 61 73 | 65 20 75 6e 70 61 63 6b |ho Pleas|e unpack|
|000007a0| 20 70 61 72 74 20 60 63 | 61 74 20 5f 73 68 61 72 | part `c|at _shar|
|000007b0| 5f 73 65 71 5f 2e 74 6d | 70 60 20 6e 65 78 74 0a |_seq_.tm|p` next.|
|000007c0| 09 65 78 69 74 20 31 0a | 66 69 0a 23 20 3d 3d 3d |.exit 1.|fi.# ===|
|000007d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 20 73 65 63 2e 63 |========|== sec.c|
|000007e0| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0a | =======|=======.|
|000007f0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 73 65 63 2e |if test |-f 'sec.|
|00000800| 63 27 20 2d 61 20 58 22 | 24 31 22 20 21 3d 20 58 |c' -a X"|$1" != X|
|00000810| 22 2d 63 22 3b 20 74 68 | 65 6e 0a 09 65 63 68 6f |"-c"; th|en..echo|
|00000820| 20 27 78 20 2d 20 73 6b | 69 70 70 69 6e 67 20 73 | 'x - sk|ipping s|
|00000830| 65 63 2e 63 20 28 46 69 | 6c 65 20 61 6c 72 65 61 |ec.c (Fi|le alrea|
|00000840| 64 79 20 65 78 69 73 74 | 73 29 27 0a 09 72 6d 20 |dy exist|s)'..rm |
|00000850| 2d 66 20 5f 73 68 61 72 | 5f 77 6e 74 5f 2e 74 6d |-f _shar|_wnt_.tm|
|00000860| 70 0a 65 6c 73 65 0a 3e | 20 5f 73 68 61 72 5f 77 |p.else.>| _shar_w|
|00000870| 6e 74 5f 2e 74 6d 70 0a | 65 63 68 6f 20 27 78 20 |nt_.tmp.|echo 'x |
|00000880| 2d 20 65 78 74 72 61 63 | 74 69 6e 67 20 73 65 63 |- extrac|ting sec|
|00000890| 2e 63 20 28 54 65 78 74 | 29 27 0a 73 65 64 20 27 |.c (Text|)'.sed '|
|000008a0| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 27 53 48 41 52 |s/^X//' |<< 'SHAR|
|000008b0| 5f 45 4f 46 27 20 3e 20 | 27 73 65 63 2e 63 27 20 |_EOF' > |'sec.c' |
|000008c0| 26 26 0a 2f 2a 0a 58 20 | 2a 0a 58 20 2a 20 73 65 |&&./*.X |*.X * se|
|000008d0| 63 2e 63 0a 58 20 2a 0a | 58 20 2a 20 47 72 75 64 |c.c.X *.|X * Grud|
|000008e0| 67 69 6e 67 6c 79 20 67 | 69 76 65 20 6f 75 74 20 |gingly g|ive out |
|000008f0| 72 6f 6f 74 20 73 68 65 | 6c 6c 73 20 74 6f 20 61 |root she|lls to a|
|00000900| 75 74 68 6f 72 69 7a 65 | 64 20 75 73 65 72 73 2e |uthorize|d users.|
|00000910| 0a 58 20 2a 0a 58 20 2a | 20 55 73 61 67 65 3a 20 |.X *.X *| Usage: |
|00000920| 73 65 63 0a 58 20 2a 0a | 58 20 2a 2f 0a 58 0a 23 |sec.X *.|X */.X.#|
|00000930| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|00000940| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 6c |>.#inclu|de <sysl|
|00000950| 6f 67 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |og.h>.#i|nclude <|
|00000960| 73 74 72 69 6e 67 73 2e | 68 3e 0a 23 69 6e 63 6c |strings.|h>.#incl|
|00000970| 75 64 65 20 22 63 6f 6e | 66 69 67 2e 68 22 0a 58 |ude "con|fig.h".X|
|00000980| 0a 69 6e 74 20 67 65 74 | 6c 69 6e 65 28 66 69 6c |.int get|line(fil|
|00000990| 65 2c 73 29 0a 46 49 4c | 45 20 2a 66 69 6c 65 3b |e,s).FIL|E *file;|
|000009a0| 0a 63 68 61 72 20 2a 73 | 3b 0a 7b 0a 58 20 20 77 |.char *s|;.{.X w|
|000009b0| 68 69 6c 65 20 28 28 28 | 2a 73 3d 67 65 74 63 28 |hile (((|*s=getc(|
|000009c0| 66 69 6c 65 29 29 21 3d | 45 4f 46 29 20 26 26 20 |file))!=|EOF) && |
|000009d0| 28 2a 73 21 3d 27 5c 6e | 27 29 29 20 73 2b 2b 3b |(*s!='\n|')) s++;|
|000009e0| 0a 58 20 20 69 66 20 28 | 28 2a 73 29 3d 3d 45 4f |.X if (|(*s)==EO|
|000009f0| 46 29 20 72 65 74 75 72 | 6e 20 30 3b 0a 58 20 20 |F) retur|n 0;.X |
|00000a00| 2a 73 3d 30 3b 0a 58 20 | 20 72 65 74 75 72 6e 20 |*s=0;.X | return |
|00000a10| 31 3b 0a 7d 0a 58 0a 65 | 78 74 65 72 6e 20 63 68 |1;.}.X.e|xtern ch|
|00000a20| 61 72 20 2a 63 72 79 70 | 74 28 29 3b 0a 58 0a 63 |ar *cryp|t();.X.c|
|00000a30| 68 61 72 20 63 6b 70 77 | 28 62 29 0a 63 68 61 72 |har ckpw|(b).char|
|00000a40| 20 2a 62 3b 0a 7b 0a 58 | 20 20 63 68 61 72 20 2a | *b;.{.X| char *|
|00000a50| 61 2c 2a 65 6e 63 72 2c | 69 6e 70 75 74 5b 31 30 |a,*encr,|input[10|
|00000a60| 5d 3b 0a 58 20 20 69 6e | 74 20 66 3b 0a 58 0a 58 |];.X in|t f;.X.X|
|00000a70| 20 20 69 66 20 28 21 73 | 74 72 6c 65 6e 28 62 29 | if (!s|trlen(b)|
|00000a80| 29 0a 58 20 20 7b 0a 58 | 20 20 20 20 70 72 69 6e |).X {.X| prin|
|00000a90| 74 66 28 22 4e 75 6c 6c | 20 50 57 2e 20 50 6c 65 |tf("Null| PW. Ple|
|00000aa0| 61 73 65 20 75 73 65 20 | 27 73 65 63 70 77 27 20 |ase use |'secpw' |
|00000ab0| 61 6e 64 20 61 64 64 20 | 6f 6e 65 2e 5c 6e 22 29 |and add |one.\n")|
|00000ac0| 3b 0a 58 20 20 20 20 72 | 65 74 75 72 6e 20 31 3b |;.X r|eturn 1;|
|00000ad0| 0a 58 20 20 7d 0a 58 20 | 20 73 74 72 63 70 79 28 |.X }.X | strcpy(|
|00000ae0| 69 6e 70 75 74 2c 67 65 | 74 70 61 73 73 28 22 50 |input,ge|tpass("P|
|00000af0| 61 73 73 77 6f 72 64 3a | 22 29 29 3b 0a 58 20 20 |assword:|"));.X |
|00000b00| 65 6e 63 72 3d 63 72 79 | 70 74 28 69 6e 70 75 74 |encr=cry|pt(input|
|00000b10| 2c 62 29 3b 0a 58 20 20 | 72 65 74 75 72 6e 28 21 |,b);.X |return(!|
|00000b20| 73 74 72 63 6d 70 28 65 | 6e 63 72 2c 62 29 29 3b |strcmp(e|ncr,b));|
|00000b30| 0a 7d 0a 58 0a 6d 61 69 | 6e 28 29 0a 7b 0a 58 20 |.}.X.mai|n().{.X |
|00000b40| 20 46 49 4c 45 2a 20 66 | 3b 0a 58 20 20 63 68 61 | FILE* f|;.X cha|
|00000b50| 72 20 73 74 72 5b 38 30 | 5d 2c 6f 6b 3d 30 3b 0a |r str[80|],ok=0;.|
|00000b60| 58 0a 58 20 20 66 3d 66 | 6f 70 65 6e 28 46 49 4c |X.X f=f|open(FIL|
|00000b70| 45 4e 41 4d 45 2c 22 72 | 22 29 3b 0a 58 20 20 69 |ENAME,"r|");.X i|
|00000b80| 66 20 28 66 21 3d 4e 55 | 4c 4c 29 0a 58 20 20 7b |f (f!=NU|LL).X {|
|00000b90| 0a 58 20 20 20 20 77 68 | 69 6c 65 28 67 65 74 6c |.X wh|ile(getl|
|00000ba0| 69 6e 65 28 66 2c 73 74 | 72 29 29 0a 58 20 20 20 |ine(f,st|r)).X |
|00000bb0| 20 7b 0a 58 20 20 20 20 | 20 20 63 68 61 72 20 62 | {.X | char b|
|00000bc0| 5b 31 36 5d 2c 2a 63 3b | 0a 58 20 20 20 20 20 20 |[16],*c;|.X |
|00000bd0| 63 3d 69 6e 64 65 78 28 | 73 74 72 2c 27 3a 27 29 |c=index(|str,':')|
|00000be0| 3b 0a 58 20 20 20 20 20 | 20 69 66 20 28 63 3d 3d |;.X | if (c==|
|00000bf0| 4e 55 4c 4c 29 20 63 6f | 6e 74 69 6e 75 65 3b 0a |NULL) co|ntinue;.|
|00000c00| 58 20 20 20 20 20 20 73 | 74 72 63 70 79 28 62 2c |X s|trcpy(b,|
|00000c10| 63 2b 31 29 3b 0a 58 20 | 20 20 20 20 20 2a 63 3d |c+1);.X | *c=|
|00000c20| 27 5c 30 27 3b 0a 58 20 | 20 20 20 20 20 69 66 20 |'\0';.X | if |
|00000c30| 28 21 73 74 72 63 6d 70 | 28 73 74 72 2c 67 65 74 |(!strcmp|(str,get|
|00000c40| 6c 6f 67 69 6e 28 29 29 | 29 0a 58 20 20 20 20 20 |login())|).X |
|00000c50| 20 20 20 69 66 20 28 63 | 6b 70 77 28 62 29 29 0a | if (c|kpw(b)).|
|00000c60| 58 20 20 20 20 20 20 20 | 20 20 20 6f 6b 3d 31 3b |X | ok=1;|
|00000c70| 0a 58 20 20 20 20 7d 0a | 58 20 20 20 20 66 63 6c |.X }.|X fcl|
|00000c80| 6f 73 65 28 66 29 3b 0a | 58 20 20 7d 0a 58 20 20 |ose(f);.|X }.X |
|00000c90| 65 6c 73 65 0a 58 20 20 | 7b 0a 58 20 20 20 20 70 |else.X |{.X p|
|00000ca0| 72 69 6e 74 66 28 22 45 | 72 72 6f 72 20 72 65 61 |rintf("E|rror rea|
|00000cb0| 64 69 6e 67 20 66 69 6c | 65 2e 5c 6e 22 29 3b 0a |ding fil|e.\n");.|
|00000cc0| 58 20 20 20 20 65 78 69 | 74 28 31 29 3b 0a 58 20 |X exi|t(1);.X |
|00000cd0| 20 7d 0a 58 0a 58 20 20 | 6f 70 65 6e 6c 6f 67 28 | }.X.X |openlog(|
|00000ce0| 22 73 65 63 22 2c 30 2c | 4c 4f 47 5f 46 41 43 49 |"sec",0,|LOG_FACI|
|00000cf0| 4c 49 54 59 29 3b 0a 58 | 0a 58 20 20 69 66 20 28 |LITY);.X|.X if (|
|00000d00| 6f 6b 29 0a 58 20 20 7b | 0a 58 20 20 20 20 73 79 |ok).X {|.X sy|
|00000d10| 73 6c 6f 67 28 4c 4f 47 | 5f 4f 4b 5f 50 52 49 2c |slog(LOG|_OK_PRI,|
|00000d20| 22 73 65 63 75 72 69 74 | 79 20 61 63 63 65 73 73 |"securit|y access|
|00000d30| 3a 20 25 73 22 2c 67 65 | 74 6c 6f 67 69 6e 28 29 |: %s",ge|tlogin()|
|00000d40| 29 3b 0a 58 20 20 20 20 | 73 65 74 65 75 69 64 28 |);.X |seteuid(|
|00000d50| 30 29 3b 0a 58 20 20 20 | 20 73 65 74 65 67 69 64 |0);.X | setegid|
|00000d60| 28 30 29 3b 0a 58 20 20 | 20 20 73 65 74 75 69 64 |(0);.X | setuid|
|00000d70| 28 30 29 3b 0a 58 20 20 | 20 20 73 65 74 67 69 64 |(0);.X | setgid|
|00000d80| 28 30 29 3b 0a 58 20 20 | 20 20 65 78 65 63 6c 28 |(0);.X | execl(|
|00000d90| 22 2f 62 69 6e 2f 63 73 | 68 22 2c 22 20 53 45 43 |"/bin/cs|h"," SEC|
|00000da0| 22 2c 28 63 68 61 72 2a | 29 30 29 3b 0a 58 20 20 |",(char*|)0);.X |
|00000db0| 7d 0a 58 20 20 65 6c 73 | 65 0a 58 20 20 7b 0a 58 |}.X els|e.X {.X|
|00000dc0| 20 20 20 20 73 79 73 6c | 6f 67 28 4c 4f 47 5f 46 | sysl|og(LOG_F|
|00000dd0| 41 49 4c 5f 50 52 49 2c | 22 73 65 63 75 72 69 74 |AIL_PRI,|"securit|
|00000de0| 79 20 61 63 63 65 73 73 | 20 44 45 4e 49 45 44 3a |y access| DENIED:|
|00000df0| 20 25 73 22 2c 67 65 74 | 6c 6f 67 69 6e 28 29 29 | %s",get|login())|
|00000e00| 3b 0a 58 20 20 20 20 70 | 72 69 6e 74 66 28 22 4e |;.X p|rintf("N|
|00000e10| 6f 74 20 41 75 74 68 6f | 72 69 7a 65 64 2e 5c 6e |ot Autho|rized.\n|
|00000e20| 22 29 3b 0a 58 20 20 7d | 0a 7d 0a 53 48 41 52 5f |");.X }|.}.SHAR_|
|00000e30| 45 4f 46 0a 63 68 6d 6f | 64 20 30 36 34 34 20 73 |EOF.chmo|d 0644 s|
|00000e40| 65 63 2e 63 20 7c 7c 0a | 65 63 68 6f 20 27 72 65 |ec.c ||.|echo 're|
|00000e50| 73 74 6f 72 65 20 6f 66 | 20 73 65 63 2e 63 20 66 |store of| sec.c f|
|00000e60| 61 69 6c 65 64 27 0a 57 | 63 5f 63 3d 22 60 77 63 |ailed'.W|c_c="`wc|
|00000e70| 20 2d 63 20 3c 20 27 73 | 65 63 2e 63 27 60 22 0a | -c < 's|ec.c'`".|
|00000e80| 74 65 73 74 20 31 33 31 | 35 20 2d 65 71 20 22 24 |test 131|5 -eq "$|
|00000e90| 57 63 5f 63 22 20 7c 7c | 0a 09 65 63 68 6f 20 27 |Wc_c" |||..echo '|
|00000ea0| 73 65 63 2e 63 3a 20 6f | 72 69 67 69 6e 61 6c 20 |sec.c: o|riginal |
|00000eb0| 73 69 7a 65 20 31 33 31 | 35 2c 20 63 75 72 72 65 |size 131|5, curre|
|00000ec0| 6e 74 20 73 69 7a 65 27 | 20 22 24 57 63 5f 63 22 |nt size'| "$Wc_c"|
|00000ed0| 0a 72 6d 20 2d 66 20 5f | 73 68 61 72 5f 77 6e 74 |.rm -f _|shar_wnt|
|00000ee0| 5f 2e 74 6d 70 0a 66 69 | 0a 23 20 3d 3d 3d 3d 3d |_.tmp.fi|.# =====|
|00000ef0| 3d 3d 3d 3d 3d 3d 3d 3d | 20 73 65 63 70 77 2e 63 |========| secpw.c|
|00000f00| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0a | =======|=======.|
|00000f10| 69 66 20 74 65 73 74 20 | 2d 66 20 27 73 65 63 70 |if test |-f 'secp|
|00000f20| 77 2e 63 27 20 2d 61 20 | 58 22 24 31 22 20 21 3d |w.c' -a |X"$1" !=|
|00000f30| 20 58 22 2d 63 22 3b 20 | 74 68 65 6e 0a 09 65 63 | X"-c"; |then..ec|
|00000f40| 68 6f 20 27 78 20 2d 20 | 73 6b 69 70 70 69 6e 67 |ho 'x - |skipping|
|00000f50| 20 73 65 63 70 77 2e 63 | 20 28 46 69 6c 65 20 61 | secpw.c| (File a|
|00000f60| 6c 72 65 61 64 79 20 65 | 78 69 73 74 73 29 27 0a |lready e|xists)'.|
|00000f70| 09 72 6d 20 2d 66 20 5f | 73 68 61 72 5f 77 6e 74 |.rm -f _|shar_wnt|
|00000f80| 5f 2e 74 6d 70 0a 65 6c | 73 65 0a 3e 20 5f 73 68 |_.tmp.el|se.> _sh|
|00000f90| 61 72 5f 77 6e 74 5f 2e | 74 6d 70 0a 65 63 68 6f |ar_wnt_.|tmp.echo|
|00000fa0| 20 27 78 20 2d 20 65 78 | 74 72 61 63 74 69 6e 67 | 'x - ex|tracting|
|00000fb0| 20 73 65 63 70 77 2e 63 | 20 28 54 65 78 74 29 27 | secpw.c| (Text)'|
|00000fc0| 0a 73 65 64 20 27 73 2f | 5e 58 2f 2f 27 20 3c 3c |.sed 's/|^X//' <<|
|00000fd0| 20 27 53 48 41 52 5f 45 | 4f 46 27 20 3e 20 27 73 | 'SHAR_E|OF' > 's|
|00000fe0| 65 63 70 77 2e 63 27 20 | 26 26 0a 2f 2a 0a 58 20 |ecpw.c' |&&./*.X |
|00000ff0| 2a 0a 58 20 2a 20 73 65 | 63 70 77 2e 63 0a 58 20 |*.X * se|cpw.c.X |
|00001000| 2a 0a 58 20 2a 20 43 68 | 61 6e 67 65 20 70 61 73 |*.X * Ch|ange pas|
|00001010| 73 77 6f 72 64 73 20 66 | 6f 72 20 74 68 65 20 73 |swords f|or the s|
|00001020| 65 63 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |ec passw|ord file|
|00001030| 0a 58 20 2a 0a 58 20 2a | 20 55 73 61 67 65 3a 20 |.X *.X *| Usage: |
|00001040| 73 65 63 70 77 20 5b 75 | 73 65 72 6e 61 6d 65 5d |secpw [u|sername]|
|00001050| 0a 58 20 2a 0a 58 20 2a | 20 49 74 20 6d 61 79 20 |.X *.X *| It may |
|00001060| 73 65 65 6d 20 6f 64 64 | 20 74 68 61 74 20 75 73 |seem odd| that us|
|00001070| 65 72 73 20 61 72 65 20 | 61 6c 6c 6f 77 65 64 20 |ers are |allowed |
|00001080| 74 6f 20 63 68 61 6e 67 | 65 20 6f 74 68 65 72 20 |to chang|e other |
|00001090| 70 65 6f 70 6c 65 27 73 | 0a 58 20 2a 20 70 61 73 |people's|.X * pas|
|000010a0| 73 77 6f 72 64 73 2c 20 | 61 6e 64 20 63 68 61 6e |swords, |and chan|
|000010b0| 67 65 20 74 68 65 69 72 | 20 6f 77 6e 20 77 69 74 |ge their| own wit|
|000010c0| 68 6f 75 74 20 73 75 70 | 70 6c 79 69 6e 67 20 74 |hout sup|plying t|
|000010d0| 68 65 20 6f 6c 64 20 70 | 61 73 73 77 6f 72 64 2c |he old p|assword,|
|000010e0| 0a 58 20 2a 20 62 75 74 | 20 77 68 6f 65 76 65 72 |.X * but| whoever|
|000010f0| 20 72 75 6e 73 20 74 68 | 69 73 20 6d 75 73 74 20 | runs th|is must |
|00001100| 61 6c 72 65 61 64 79 20 | 68 61 76 65 20 61 20 75 |already |have a u|
|00001110| 69 64 20 6f 66 20 72 6f | 6f 74 2c 20 73 6f 20 69 |id of ro|ot, so i|
|00001120| 74 0a 58 20 2a 20 72 65 | 61 6c 6c 79 20 64 6f 65 |t.X * re|ally doe|
|00001130| 73 6e 27 74 20 6d 61 74 | 74 65 72 2e 0a 58 20 2a |sn't mat|ter..X *|
|00001140| 0a 58 20 2a 2f 0a 58 0a | 23 69 6e 63 6c 75 64 65 |.X */.X.|#include|
|00001150| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 23 69 6e 63 6c | <stdio.|h>.#incl|
|00001160| 75 64 65 20 3c 73 74 72 | 69 6e 67 73 2e 68 3e 0a |ude <str|ings.h>.|
|00001170| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 66 69 |#include| <sys/fi|
|00001180| 6c 65 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 22 |le.h>.#i|nclude "|
|00001190| 63 6f 6e 66 69 67 2e 68 | 22 0a 58 0a 65 78 74 65 |config.h|".X.exte|
|000011a0| 72 6e 20 6c 6f 6e 67 20 | 72 61 6e 64 6f 6d 28 29 |rn long |random()|
|000011b0| 3b 0a 65 78 74 65 72 6e | 20 63 68 61 72 20 2a 67 |;.extern| char *g|
|000011c0| 65 74 6c 6f 67 69 6e 28 | 29 3b 0a 65 78 74 65 72 |etlogin(|);.exter|
|000011d0| 6e 20 6c 6f 6e 67 20 74 | 69 6d 65 28 29 3b 0a 58 |n long t|ime();.X|
|000011e0| 0a 63 68 61 72 20 63 68 | 61 72 73 65 74 5b 5d 3d |.char ch|arset[]=|
|000011f0| 22 41 42 43 44 45 46 47 | 48 49 4a 4b 4c 4d 4e 4f |"ABCDEFG|HIJKLMNO|
|00001200| 50 51 52 53 54 55 56 57 | 58 59 5a 61 62 63 64 65 |PQRSTUVW|XYZabcde|
|00001210| 66 67 68 69 6a 6b 6c 6d | 6e 6f 70 71 72 73 74 75 |fghijklm|nopqrstu|
|00001220| 76 77 78 79 7a 30 31 32 | 33 34 35 36 37 38 39 2e |vwxyz012|3456789.|
|00001230| 2f 22 3b 0a 58 0a 63 68 | 61 72 20 67 65 74 6c 69 |/";.X.ch|ar getli|
|00001240| 6e 65 28 66 69 6c 65 2c | 73 29 0a 46 49 4c 45 20 |ne(file,|s).FILE |
|00001250| 2a 66 69 6c 65 3b 0a 63 | 68 61 72 20 2a 73 3b 0a |*file;.c|har *s;.|
|00001260| 7b 0a 58 20 20 77 68 69 | 6c 65 28 28 28 2a 73 3d |{.X whi|le(((*s=|
|00001270| 67 65 74 63 28 66 69 6c | 65 29 29 21 3d 45 4f 46 |getc(fil|e))!=EOF|
|00001280| 29 20 26 26 20 28 2a 73 | 21 3d 27 5c 6e 27 29 29 |) && (*s|!='\n'))|
|00001290| 20 73 2b 2b 3b 0a 58 20 | 20 69 66 20 28 28 2a 73 | s++;.X | if ((*s|
|000012a0| 29 3d 3d 45 4f 46 29 20 | 72 65 74 75 72 6e 20 31 |)==EOF) |return 1|
|000012b0| 3b 0a 58 20 20 2a 73 3d | 30 3b 0a 58 20 20 72 65 |;.X *s=|0;.X re|
|000012c0| 74 75 72 6e 20 30 3b 0a | 7d 0a 58 0a 6d 61 69 6e |turn 0;.|}.X.main|
|000012d0| 28 61 72 67 63 2c 61 72 | 67 76 29 0a 69 6e 74 20 |(argc,ar|gv).int |
|000012e0| 61 72 67 63 3b 0a 63 68 | 61 72 20 2a 2a 61 72 67 |argc;.ch|ar **arg|
|000012f0| 76 3b 0a 7b 0a 58 0a 58 | 20 20 63 68 61 72 20 6b |v;.{.X.X| char k|
|00001300| 65 79 5b 39 5d 2c 73 61 | 6c 74 5b 33 5d 2c 6c 69 |ey[9],sa|lt[3],li|
|00001310| 6e 65 5b 38 30 5d 2c 6c | 69 6e 65 32 5b 38 30 5d |ne[80],l|ine2[80]|
|00001320| 2c 2a 77 68 6f 2c 6f 6b | 3d 30 3b 0a 58 20 20 46 |,*who,ok|=0;.X F|
|00001330| 49 4c 45 20 2a 66 31 2c | 2a 66 32 3b 0a 58 0a 58 |ILE *f1,|*f2;.X.X|
|00001340| 20 20 69 66 20 28 73 65 | 74 75 69 64 28 30 29 29 | if (se|tuid(0))|
|00001350| 0a 58 20 20 7b 0a 58 20 | 20 20 20 70 72 69 6e 74 |.X {.X | print|
|00001360| 66 28 22 4d 75 73 74 20 | 62 65 20 72 6f 6f 74 2e |f("Must |be root.|
|00001370| 5c 6e 22 29 3b 0a 58 20 | 20 20 20 65 78 69 74 28 |\n");.X | exit(|
|00001380| 31 29 3b 0a 58 20 20 7d | 0a 58 0a 58 20 20 77 68 |1);.X }|.X.X wh|
|00001390| 6f 3d 67 65 74 6c 6f 67 | 69 6e 28 29 3b 0a 58 20 |o=getlog|in();.X |
|000013a0| 20 69 66 20 28 61 72 67 | 63 3e 31 29 0a 58 20 20 | if (arg|c>1).X |
|000013b0| 20 20 77 68 6f 3d 2a 28 | 61 72 67 76 2b 31 29 3b | who=*(|argv+1);|
|000013c0| 0a 58 0a 58 20 20 73 74 | 72 63 70 79 28 6b 65 79 |.X.X st|rcpy(key|
|000013d0| 2c 67 65 74 70 61 73 73 | 28 22 4e 65 77 20 50 61 |,getpass|("New Pa|
|000013e0| 73 73 77 6f 72 64 3a 22 | 29 29 3b 0a 58 20 20 69 |ssword:"|));.X i|
|000013f0| 66 20 28 73 74 72 63 6d | 70 28 6b 65 79 2c 67 65 |f (strcm|p(key,ge|
|00001400| 74 70 61 73 73 28 22 41 | 67 61 69 6e 3a 22 29 29 |tpass("A|gain:"))|
|00001410| 29 0a 58 20 20 7b 0a 58 | 20 20 20 20 70 72 69 6e |).X {.X| prin|
|00001420| 74 66 28 22 4e 6f 20 4d | 61 74 63 68 2e 5c 6e 22 |tf("No M|atch.\n"|
|00001430| 29 3b 0a 58 20 20 20 20 | 65 78 69 74 28 31 29 3b |);.X |exit(1);|
|00001440| 0a 58 20 20 7d 0a 58 0a | 58 20 20 73 72 61 6e 64 |.X }.X.|X srand|
|00001450| 6f 6d 28 28 69 6e 74 29 | 20 74 69 6d 65 28 30 4c |om((int)| time(0L|
|00001460| 29 29 3b 0a 58 20 20 73 | 61 6c 74 5b 30 5d 3d 63 |));.X s|alt[0]=c|
|00001470| 68 61 72 73 65 74 5b 72 | 61 6e 64 6f 6d 28 29 25 |harset[r|andom()%|
|00001480| 73 74 72 6c 65 6e 28 63 | 68 61 72 73 65 74 29 5d |strlen(c|harset)]|
|00001490| 3b 0a 58 20 20 73 61 6c | 74 5b 31 5d 3d 63 68 61 |;.X sal|t[1]=cha|
|000014a0| 72 73 65 74 5b 72 61 6e | 64 6f 6d 28 29 25 73 74 |rset[ran|dom()%st|
|000014b0| 72 6c 65 6e 28 63 68 61 | 72 73 65 74 29 5d 3b 0a |rlen(cha|rset)];.|
|000014c0| 58 20 20 73 74 72 63 70 | 79 28 6c 69 6e 65 2c 77 |X strcp|y(line,w|
|000014d0| 68 6f 29 3b 0a 58 20 20 | 73 74 72 63 61 74 28 6c |ho);.X |strcat(l|
|000014e0| 69 6e 65 2c 22 3a 22 29 | 3b 0a 58 20 20 73 74 72 |ine,":")|;.X str|
|000014f0| 63 61 74 28 6c 69 6e 65 | 2c 63 72 79 70 74 28 6b |cat(line|,crypt(k|
|00001500| 65 79 2c 73 61 6c 74 29 | 29 3b 0a 58 0a 58 20 20 |ey,salt)|);.X.X |
|00001510| 75 6d 61 73 6b 28 30 33 | 37 37 29 3b 0a 58 20 20 |umask(03|77);.X |
|00001520| 66 31 3d 66 6f 70 65 6e | 28 46 49 4c 45 4e 41 4d |f1=fopen|(FILENAM|
|00001530| 45 2c 22 72 22 29 3b 0a | 58 20 20 66 32 3d 66 6f |E,"r");.|X f2=fo|
|00001540| 70 65 6e 28 54 45 4d 50 | 4e 41 4d 45 2c 22 77 22 |pen(TEMP|NAME,"w"|
|00001550| 29 3b 0a 58 20 20 66 6c | 6f 63 6b 28 66 69 6c 65 |);.X fl|ock(file|
|00001560| 6e 6f 28 66 32 29 2c 4c | 4f 43 4b 5f 45 58 29 3b |no(f2),L|OCK_EX);|
|00001570| 0a 58 20 20 77 68 69 6c | 65 28 21 67 65 74 6c 69 |.X whil|e(!getli|
|00001580| 6e 65 28 66 31 2c 6c 69 | 6e 65 32 29 29 0a 58 20 |ne(f1,li|ne2)).X |
|00001590| 20 20 20 69 66 20 28 73 | 74 72 6e 63 6d 70 28 6c | if (s|trncmp(l|
|000015a0| 69 6e 65 32 2c 77 68 6f | 2c 73 74 72 6c 65 6e 28 |ine2,who|,strlen(|
|000015b0| 77 68 6f 29 29 29 0a 58 | 20 20 20 20 20 20 66 70 |who))).X| fp|
|000015c0| 72 69 6e 74 66 28 66 32 | 2c 22 25 73 5c 6e 22 2c |rintf(f2|,"%s\n",|
|000015d0| 6c 69 6e 65 32 29 3b 0a | 58 20 20 20 20 65 6c 73 |line2);.|X els|
|000015e0| 65 0a 58 20 20 20 20 7b | 0a 58 20 20 20 20 20 20 |e.X {|.X |
|000015f0| 66 70 72 69 6e 74 66 28 | 66 32 2c 22 25 73 5c 6e |fprintf(|f2,"%s\n|
|00001600| 22 2c 6c 69 6e 65 29 3b | 0a 58 20 20 20 20 20 20 |",line);|.X |
|00001610| 6f 6b 2b 2b 3b 0a 58 20 | 20 20 20 7d 0a 58 20 20 |ok++;.X | }.X |
|00001620| 66 63 6c 6f 73 65 28 66 | 31 29 3b 0a 58 20 20 66 |fclose(f|1);.X f|
|00001630| 63 6c 6f 73 65 28 66 32 | 29 3b 0a 58 20 20 72 65 |close(f2|);.X re|
|00001640| 6e 61 6d 65 28 54 45 4d | 50 4e 41 4d 45 2c 46 49 |name(TEM|PNAME,FI|
|00001650| 4c 45 4e 41 4d 45 29 3b | 0a 58 0a 58 20 20 69 66 |LENAME);|.X.X if|
|00001660| 20 28 21 6f 6b 29 0a 58 | 20 20 7b 0a 58 20 20 20 | (!ok).X| {.X |
|00001670| 20 70 72 69 6e 74 66 28 | 22 43 61 6e 6e 6f 74 20 | printf(|"Cannot |
|00001680| 63 68 61 6e 67 65 3a 20 | 55 73 65 72 20 6e 6f 74 |change: |User not|
|00001690| 20 61 75 74 68 6f 72 69 | 7a 65 64 2e 5c 6e 22 29 | authori|zed.\n")|
|000016a0| 3b 0a 58 20 20 20 20 65 | 78 69 74 28 31 29 3b 0a |;.X e|xit(1);.|
|000016b0| 58 20 20 7d 0a 58 20 20 | 0a 7d 0a 53 48 41 52 5f |X }.X |.}.SHAR_|
|000016c0| 45 4f 46 0a 63 68 6d 6f | 64 20 30 36 34 34 20 73 |EOF.chmo|d 0644 s|
|000016d0| 65 63 70 77 2e 63 20 7c | 7c 0a 65 63 68 6f 20 27 |ecpw.c |||.echo '|
|000016e0| 72 65 73 74 6f 72 65 20 | 6f 66 20 73 65 63 70 77 |restore |of secpw|
|000016f0| 2e 63 20 66 61 69 6c 65 | 64 27 0a 57 63 5f 63 3d |.c faile|d'.Wc_c=|
|00001700| 22 60 77 63 20 2d 63 20 | 3c 20 27 73 65 63 70 77 |"`wc -c |< 'secpw|
|00001710| 2e 63 27 60 22 0a 74 65 | 73 74 20 31 36 37 32 20 |.c'`".te|st 1672 |
|00001720| 2d 65 71 20 22 24 57 63 | 5f 63 22 20 7c 7c 0a 09 |-eq "$Wc|_c" ||..|
|00001730| 65 63 68 6f 20 27 73 65 | 63 70 77 2e 63 3a 20 6f |echo 'se|cpw.c: o|
|00001740| 72 69 67 69 6e 61 6c 20 | 73 69 7a 65 20 31 36 37 |riginal |size 167|
|00001750| 32 2c 20 63 75 72 72 65 | 6e 74 20 73 69 7a 65 27 |2, curre|nt size'|
|00001760| 20 22 24 57 63 5f 63 22 | 0a 72 6d 20 2d 66 20 5f | "$Wc_c"|.rm -f _|
|00001770| 73 68 61 72 5f 77 6e 74 | 5f 2e 74 6d 70 0a 66 69 |shar_wnt|_.tmp.fi|
|00001780| 0a 23 20 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.# =====|========|
|00001790| 20 4d 61 6b 65 66 69 6c | 65 20 3d 3d 3d 3d 3d 3d | Makefil|e ======|
|000017a0| 3d 3d 3d 3d 3d 3d 3d 3d | 0a 69 66 20 74 65 73 74 |========|.if test|
|000017b0| 20 2d 66 20 27 4d 61 6b | 65 66 69 6c 65 27 20 2d | -f 'Mak|efile' -|
|000017c0| 61 20 58 22 24 31 22 20 | 21 3d 20 58 22 2d 63 22 |a X"$1" |!= X"-c"|
|000017d0| 3b 20 74 68 65 6e 0a 09 | 65 63 68 6f 20 27 78 20 |; then..|echo 'x |
|000017e0| 2d 20 73 6b 69 70 70 69 | 6e 67 20 4d 61 6b 65 66 |- skippi|ng Makef|
|000017f0| 69 6c 65 20 28 46 69 6c | 65 20 61 6c 72 65 61 64 |ile (Fil|e alread|
|00001800| 79 20 65 78 69 73 74 73 | 29 27 0a 09 72 6d 20 2d |y exists|)'..rm -|
|00001810| 66 20 5f 73 68 61 72 5f | 77 6e 74 5f 2e 74 6d 70 |f _shar_|wnt_.tmp|
|00001820| 0a 65 6c 73 65 0a 3e 20 | 5f 73 68 61 72 5f 77 6e |.else.> |_shar_wn|
|00001830| 74 5f 2e 74 6d 70 0a 65 | 63 68 6f 20 27 78 20 2d |t_.tmp.e|cho 'x -|
|00001840| 20 65 78 74 72 61 63 74 | 69 6e 67 20 4d 61 6b 65 | extract|ing Make|
|00001850| 66 69 6c 65 20 28 54 65 | 78 74 29 27 0a 73 65 64 |file (Te|xt)'.sed|
|00001860| 20 27 73 2f 5e 58 2f 2f | 27 20 3c 3c 20 27 53 48 | 's/^X//|' << 'SH|
|00001870| 41 52 5f 45 4f 46 27 20 | 3e 20 27 4d 61 6b 65 66 |AR_EOF' |> 'Makef|
|00001880| 69 6c 65 27 20 26 26 0a | 23 0a 23 20 4d 61 6b 65 |ile' &&.|#.# Make|
|00001890| 66 69 6c 65 20 66 6f 72 | 20 73 65 63 0a 23 0a 23 |file for| sec.#.#|
|000018a0| 20 54 6f 20 69 6e 73 74 | 61 6c 6c 3a 20 50 61 74 | To inst|all: Pat|
|000018b0| 63 68 20 63 6f 6e 66 69 | 67 2e 68 20 74 6f 20 63 |ch confi|g.h to c|
|000018c0| 68 61 6e 67 65 20 74 68 | 65 20 6c 6f 63 61 74 69 |hange th|e locati|
|000018d0| 6f 6e 20 6f 66 20 74 68 | 65 20 73 65 63 75 72 69 |on of th|e securi|
|000018e0| 74 79 20 66 69 6c 65 6e | 61 6d 65 2e 0a 23 20 54 |ty filen|ame..# T|
|000018f0| 68 65 6e 20 6d 61 6b 65 | 2c 20 73 75 2c 20 61 6e |hen make|, su, an|
|00001900| 64 20 6d 61 6b 65 20 69 | 6e 73 74 61 6c 6c 2e 0a |d make i|nstall..|
|00001910| 23 20 54 68 65 6e 20 63 | 72 65 61 74 65 20 74 68 |# Then c|reate th|
|00001920| 65 20 73 65 63 75 72 69 | 74 79 20 66 69 6c 65 2e |e securi|ty file.|
|00001930| 20 53 65 65 20 52 45 41 | 44 4d 45 0a 23 0a 58 0a | See REA|DME.#.X.|
|00001940| 23 43 43 3d 2f 62 69 6e | 2f 63 63 0a 58 0a 23 20 |#CC=/bin|/cc.X.# |
|00001950| 66 6f 72 20 53 75 6e 4f | 53 20 34 2e 30 20 61 6e |for SunO|S 4.0 an|
|00001960| 64 20 61 62 6f 76 65 2c | 20 73 74 61 74 69 63 20 |d above,| static |
|00001970| 62 69 6e 64 69 6e 67 20 | 69 73 20 72 65 63 6f 6d |binding |is recom|
|00001980| 6d 65 6e 64 65 64 2e 20 | 49 66 20 73 68 61 72 69 |mended. |If shari|
|00001990| 6e 67 0a 23 20 61 20 6c | 69 62 72 61 72 79 20 62 |ng.# a l|ibrary b|
|000019a0| 79 20 4e 46 53 2c 20 69 | 74 20 6d 61 79 20 62 65 |y NFS, i|t may be|
|000019b0| 63 6f 6d 65 20 64 69 73 | 63 6f 6e 6e 65 63 74 65 |come dis|connecte|
|000019c0| 64 2c 20 72 65 6e 64 65 | 72 69 6e 67 20 73 65 63 |d, rende|ring sec|
|000019d0| 20 75 6e 61 76 61 69 6c | 61 62 6c 65 2e 0a 58 0a | unavail|able..X.|
|000019e0| 43 46 4c 41 47 53 3d 20 | 2d 4f 20 2d 42 73 74 61 |CFLAGS= |-O -Bsta|
|000019f0| 74 69 63 0a 58 0a 47 52 | 4f 55 50 3d 73 74 61 66 |tic.X.GR|OUP=staf|
|00001a00| 66 0a 49 4e 53 54 41 4c | 4c 44 49 52 3d 2f 65 74 |f.INSTAL|LDIR=/et|
|00001a10| 63 0a 58 0a 61 6c 6c 3a | 73 65 63 20 73 65 63 70 |c.X.all:|sec secp|
|00001a20| 77 0a 58 0a 73 65 63 3a | 73 65 63 2e 6f 0a 58 09 |w.X.sec:|sec.o.X.|
|00001a30| 24 28 43 43 29 20 24 28 | 43 46 4c 41 47 53 29 20 |$(CC) $(|CFLAGS) |
|00001a40| 2d 6f 20 73 65 63 20 73 | 65 63 2e 6f 0a 58 09 73 |-o sec s|ec.o.X.s|
|00001a50| 74 72 69 70 20 73 65 63 | 0a 58 0a 73 65 63 70 77 |trip sec|.X.secpw|
|00001a60| 3a 73 65 63 70 77 2e 6f | 0a 58 09 24 28 43 43 29 |:secpw.o|.X.$(CC)|
|00001a70| 20 24 28 43 46 4c 41 47 | 53 29 20 2d 6f 20 73 65 | $(CFLAG|S) -o se|
|00001a80| 63 70 77 20 73 65 63 70 | 77 2e 6f 0a 58 09 73 74 |cpw secp|w.o.X.st|
|00001a90| 72 69 70 20 73 65 63 70 | 77 0a 58 0a 73 65 63 2e |rip secp|w.X.sec.|
|00001aa0| 6f 3a 73 65 63 2e 63 20 | 63 6f 6e 66 69 67 2e 68 |o:sec.c |config.h|
|00001ab0| 0a 58 0a 73 65 63 70 77 | 2e 6f 3a 73 65 63 70 77 |.X.secpw|.o:secpw|
|00001ac0| 2e 63 20 63 6f 6e 66 69 | 67 2e 68 0a 58 0a 69 6e |.c confi|g.h.X.in|
|00001ad0| 73 74 61 6c 6c 3a 73 65 | 63 20 73 65 63 70 77 0a |stall:se|c secpw.|
|00001ae0| 58 09 6d 76 20 73 65 63 | 20 73 65 63 70 77 20 24 |X.mv sec| secpw $|
|00001af0| 28 49 4e 53 54 41 4c 4c | 44 49 52 29 0a 58 09 63 |(INSTALL|DIR).X.c|
|00001b00| 64 20 24 28 49 4e 53 54 | 41 4c 4c 44 49 52 29 0a |d $(INST|ALLDIR).|
|00001b10| 58 09 63 68 6d 6f 64 20 | 34 37 31 30 20 73 65 63 |X.chmod |4710 sec|
|00001b20| 0a 58 09 63 68 6d 6f 64 | 20 37 31 30 20 73 65 63 |.X.chmod| 710 sec|
|00001b30| 70 77 0a 58 09 63 68 6f | 77 6e 20 72 6f 6f 74 20 |pw.X.cho|wn root |
|00001b40| 73 65 63 20 73 65 63 70 | 77 0a 58 09 63 68 67 72 |sec secp|w.X.chgr|
|00001b50| 70 20 24 28 47 52 4f 55 | 50 29 20 73 65 63 20 73 |p $(GROU|P) sec s|
|00001b60| 65 63 70 77 0a 58 0a 63 | 6c 65 61 6e 3a 0a 58 09 |ecpw.X.c|lean:.X.|
|00001b70| 72 6d 20 2d 66 20 2a 2e | 6f 20 63 6f 72 65 0a 53 |rm -f *.|o core.S|
|00001b80| 48 41 52 5f 45 4f 46 0a | 63 68 6d 6f 64 20 30 36 |HAR_EOF.|chmod 06|
|00001b90| 34 34 20 4d 61 6b 65 66 | 69 6c 65 20 7c 7c 0a 65 |44 Makef|ile ||.e|
|00001ba0| 63 68 6f 20 27 72 65 73 | 74 6f 72 65 20 6f 66 20 |cho 'res|tore of |
|00001bb0| 4d 61 6b 65 66 69 6c 65 | 20 66 61 69 6c 65 64 27 |Makefile| failed'|
|00001bc0| 0a 57 63 5f 63 3d 22 60 | 77 63 20 2d 63 20 3c 20 |.Wc_c="`|wc -c < |
|00001bd0| 27 4d 61 6b 65 66 69 6c | 65 27 60 22 0a 74 65 73 |'Makefil|e'`".tes|
|00001be0| 74 20 37 33 37 20 2d 65 | 71 20 22 24 57 63 5f 63 |t 737 -e|q "$Wc_c|
|00001bf0| 22 20 7c 7c 0a 09 65 63 | 68 6f 20 27 4d 61 6b 65 |" ||..ec|ho 'Make|
|00001c00| 66 69 6c 65 3a 20 6f 72 | 69 67 69 6e 61 6c 20 73 |file: or|iginal s|
|00001c10| 69 7a 65 20 37 33 37 2c | 20 63 75 72 72 65 6e 74 |ize 737,| current|
|00001c20| 20 73 69 7a 65 27 20 22 | 24 57 63 5f 63 22 0a 72 | size' "|$Wc_c".r|
|00001c30| 6d 20 2d 66 20 5f 73 68 | 61 72 5f 77 6e 74 5f 2e |m -f _sh|ar_wnt_.|
|00001c40| 74 6d 70 0a 66 69 0a 23 | 20 3d 3d 3d 3d 3d 3d 3d |tmp.fi.#| =======|
|00001c50| 3d 3d 3d 3d 3d 3d 20 52 | 45 41 44 4d 45 20 3d 3d |====== R|EADME ==|
|00001c60| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 0a 69 66 20 |========|====.if |
|00001c70| 74 65 73 74 20 2d 66 20 | 27 52 45 41 44 4d 45 27 |test -f |'README'|
|00001c80| 20 2d 61 20 58 22 24 31 | 22 20 21 3d 20 58 22 2d | -a X"$1|" != X"-|
|00001c90| 63 22 3b 20 74 68 65 6e | 0a 09 65 63 68 6f 20 27 |c"; then|..echo '|
|00001ca0| 78 20 2d 20 73 6b 69 70 | 70 69 6e 67 20 52 45 41 |x - skip|ping REA|
|00001cb0| 44 4d 45 20 28 46 69 6c | 65 20 61 6c 72 65 61 64 |DME (Fil|e alread|
|00001cc0| 79 20 65 78 69 73 74 73 | 29 27 0a 09 72 6d 20 2d |y exists|)'..rm -|
|00001cd0| 66 20 5f 73 68 61 72 5f | 77 6e 74 5f 2e 74 6d 70 |f _shar_|wnt_.tmp|
|00001ce0| 0a 65 6c 73 65 0a 3e 20 | 5f 73 68 61 72 5f 77 6e |.else.> |_shar_wn|
|00001cf0| 74 5f 2e 74 6d 70 0a 65 | 63 68 6f 20 27 78 20 2d |t_.tmp.e|cho 'x -|
|00001d00| 20 65 78 74 72 61 63 74 | 69 6e 67 20 52 45 41 44 | extract|ing READ|
|00001d10| 4d 45 20 28 54 65 78 74 | 29 27 0a 73 65 64 20 27 |ME (Text|)'.sed '|
|00001d20| 73 2f 5e 58 2f 2f 27 20 | 3c 3c 20 27 53 48 41 52 |s/^X//' |<< 'SHAR|
|00001d30| 5f 45 4f 46 27 20 3e 20 | 27 52 45 41 44 4d 45 27 |_EOF' > |'README'|
|00001d40| 20 26 26 0a 73 65 63 20 | 69 73 20 61 20 70 61 73 | &&.sec |is a pas|
|00001d50| 73 77 6f 72 64 20 70 72 | 6f 74 65 63 74 65 64 20 |sword pr|otected |
|00001d60| 6d 65 61 6e 73 20 6f 66 | 20 61 6c 6c 6f 77 69 6e |means of| allowin|
|00001d70| 67 20 73 70 65 63 69 66 | 69 65 64 20 75 73 65 72 |g specif|ied user|
|00001d80| 73 20 74 6f 0a 6f 62 74 | 61 69 6e 20 61 20 72 6f |s to.obt|ain a ro|
|00001d90| 6f 74 20 73 68 65 6c 6c | 20 77 69 74 68 6f 75 74 |ot shell| without|
|00001da0| 20 67 69 76 69 6e 67 20 | 74 68 65 6d 20 74 68 65 | giving |them the|
|00001db0| 20 73 79 73 74 65 6d 27 | 73 20 72 6f 6f 74 20 70 | system'|s root p|
|00001dc0| 61 73 73 77 6f 72 64 2e | 0a 49 74 20 69 73 20 73 |assword.|.It is s|
|00001dd0| 69 6d 69 6c 61 72 20 69 | 6e 20 74 68 69 73 20 72 |imilar i|n this r|
|00001de0| 65 67 61 72 64 20 74 6f | 20 73 75 2c 20 65 78 63 |egard to| su, exc|
|00001df0| 65 70 74 20 74 68 61 74 | 20 65 61 63 68 20 75 73 |ept that| each us|
|00001e00| 65 72 20 68 61 73 20 68 | 69 73 0a 6f 77 6e 20 70 |er has h|is.own p|
|00001e10| 61 73 73 77 6f 72 64 2c | 20 77 68 69 63 68 20 63 |assword,| which c|
|00001e20| 61 6e 20 62 65 20 63 68 | 61 6e 67 65 64 20 61 74 |an be ch|anged at|
|00001e30| 20 61 6e 79 20 74 69 6d | 65 2e 20 54 68 65 73 65 | any tim|e. These|
|00001e40| 20 70 61 73 73 77 6f 72 | 64 73 20 61 6e 64 0a 61 | passwor|ds and.a|
|00001e50| 75 74 68 6f 72 69 7a 65 | 64 20 75 73 65 72 73 20 |uthorize|d users |
|00001e60| 61 72 65 20 73 74 6f 72 | 65 64 20 69 6e 20 61 20 |are stor|ed in a |
|00001e70| 73 65 63 75 72 69 74 79 | 20 66 69 6c 65 20 68 69 |security| file hi|
|00001e80| 64 64 65 6e 20 63 6c 65 | 76 65 72 6c 79 0a 73 6f |dden cle|verly.so|
|00001e90| 6d 65 77 68 65 72 65 20 | 6f 6e 20 61 20 6d 6f 75 |mewhere |on a mou|
|00001ea0| 6e 74 65 64 20 66 69 6c | 65 20 73 79 73 74 65 6d |nted fil|e system|
|00001eb0| 20 28 61 74 20 79 6f 75 | 72 20 64 65 73 63 72 65 | (at you|r descre|
|00001ec0| 74 69 6f 6e 29 2e 0a 58 | 0a 54 68 69 73 20 69 73 |tion)..X|.This is|
|00001ed0| 20 4d 41 52 47 49 4e 41 | 4c 4c 59 20 73 61 66 65 | MARGINA|LLY safe|
|00001ee0| 72 20 74 68 61 6e 20 72 | 65 6c 65 61 73 69 6e 67 |r than r|eleasing|
|00001ef0| 20 74 68 65 20 72 6f 6f | 74 20 70 61 73 73 77 6f | the roo|t passwo|
|00001f00| 72 64 2c 20 62 75 74 0a | 4e 4f 54 20 4d 55 43 48 |rd, but.|NOT MUCH|
|00001f10| 2e 20 52 45 4d 45 4d 42 | 45 52 3a 20 57 68 65 6e |. REMEMB|ER: When|
|00001f20| 20 73 6f 6d 65 6f 6e 65 | 20 49 53 20 72 6f 6f 74 | someone| IS root|
|00001f30| 20 74 68 65 79 20 63 61 | 6e 20 64 6f 20 61 6e 79 | they ca|n do any|
|00001f40| 74 68 69 6e 67 2e 0a 54 | 68 69 73 20 70 72 6f 67 |thing..T|his prog|
|00001f50| 72 61 6d 2c 20 75 73 65 | 64 20 69 6d 70 72 6f 70 |ram, use|d improp|
|00001f60| 65 72 6c 79 20 63 61 6e | 20 62 65 20 44 41 4e 47 |erly can| be DANG|
|00001f70| 45 52 4f 55 53 21 20 42 | 79 20 69 74 73 65 6c 66 |EROUS! B|y itself|
|00001f80| 2c 20 74 68 69 73 0a 73 | 6f 75 72 63 65 20 69 73 |, this.s|ource is|
|00001f90| 20 6e 6f 74 2c 20 73 69 | 6e 63 65 20 69 74 20 6d | not, si|nce it m|
|00001fa0| 75 73 74 20 62 65 20 72 | 75 6e 20 73 75 69 64 20 |ust be r|un suid |
|00001fb0| 66 6f 72 20 69 74 20 74 | 6f 20 77 6f 72 6b 2e 0a |for it t|o work..|
|00001fc0| 58 0a 73 65 63 20 77 69 | 6c 6c 20 6c 6f 67 20 74 |X.sec wi|ll log t|
|00001fd0| 6f 20 73 79 73 6c 6f 67 | 20 73 75 63 63 65 73 73 |o syslog| success|
|00001fe0| 66 75 6c 20 61 6e 64 20 | 75 6e 73 75 63 63 65 73 |ful and |unsucces|
|00001ff0| 73 66 75 6c 20 61 74 74 | 65 6d 70 74 73 20 74 6f |sful att|empts to|
|00002000| 0a 67 65 74 20 61 20 72 | 6f 6f 74 20 73 68 65 6c |.get a r|oot shel|
|00002010| 6c 2e 20 49 66 20 79 6f | 75 20 64 6f 6e 27 74 20 |l. If yo|u don't |
|00002020| 68 61 76 65 20 73 79 73 | 6c 6f 67 2c 20 61 20 70 |have sys|log, a p|
|00002030| 68 6f 6e 65 79 20 73 79 | 73 6c 6f 67 0a 72 6f 75 |honey sy|slog.rou|
|00002040| 74 69 6e 65 20 69 73 20 | 70 72 6f 76 69 64 65 64 |tine is |provided|
|00002050| 20 74 6f 20 6c 6f 67 20 | 74 6f 20 61 20 66 69 6c | to log |to a fil|
|00002060| 65 2e 0a 58 0a 54 68 65 | 20 73 65 63 75 72 69 74 |e..X.The| securit|
|00002070| 79 20 66 69 6c 65 20 69 | 74 73 65 6c 66 20 69 73 |y file i|tself is|
|00002080| 20 6f 77 6e 65 64 20 62 | 79 20 72 6f 6f 74 20 61 | owned b|y root a|
|00002090| 6e 64 20 63 68 6d 6f 64 | 27 64 20 74 6f 20 75 2b |nd chmod|'d to u+|
|000020a0| 72 20 28 30 34 30 30 29 | 2e 0a 54 68 65 20 66 6f |r (0400)|..The fo|
|000020b0| 72 6d 61 74 20 69 73 20 | 6f 6e 65 20 75 73 65 72 |rmat is |one user|
|000020c0| 20 70 65 72 20 6c 69 6e | 65 2c 20 74 68 65 20 75 | per lin|e, the u|
|000020d0| 73 65 72 6e 61 6d 65 2c | 20 66 6f 6c 6c 6f 77 65 |sername,| followe|
|000020e0| 64 20 62 79 20 61 20 63 | 6f 6c 6f 6e 2c 0a 66 6f |d by a c|olon,.fo|
|000020f0| 6c 6c 6f 77 65 64 20 62 | 79 20 61 6e 20 6f 70 74 |llowed b|y an opt|
|00002100| 69 6f 6e 61 6c 20 63 72 | 79 70 74 65 64 20 70 61 |ional cr|ypted pa|
|00002110| 73 73 77 6f 72 64 2e 20 | 54 6f 20 61 64 64 20 61 |ssword. |To add a|
|00002120| 20 75 73 65 72 2c 20 73 | 69 6d 70 6c 79 20 61 64 | user, s|imply ad|
|00002130| 64 0a 74 68 65 20 75 73 | 65 72 20 74 6f 20 74 68 |d.the us|er to th|
|00002140| 65 20 66 69 6c 65 2c 20 | 77 69 74 68 20 74 68 65 |e file, |with the|
|00002150| 20 22 3a 22 20 61 73 20 | 74 68 65 20 6c 61 73 74 | ":" as |the last|
|00002160| 20 63 68 61 72 61 63 74 | 65 72 20 6f 6e 20 74 68 | charact|er on th|
|00002170| 65 20 6c 69 6e 65 2e 0a | 54 68 65 6e 20 65 69 74 |e line..|Then eit|
|00002180| 68 65 72 20 75 73 65 20 | 73 65 63 70 77 20 74 6f |her use |secpw to|
|00002190| 20 73 65 74 20 74 68 65 | 20 70 61 73 73 77 6f 72 | set the| passwor|
|000021a0| 64 2c 20 6f 72 20 72 65 | 6d 69 6e 64 20 74 68 65 |d, or re|mind the|
|000021b0| 20 75 73 65 72 20 74 6f | 20 64 6f 0a 74 68 69 73 | user to| do.this|
|000021c0| 20 74 68 65 20 66 69 72 | 73 74 20 74 69 6d 65 20 | the fir|st time |
|000021d0| 68 65 20 75 73 65 73 20 | 73 65 63 20 28 73 65 63 |he uses |sec (sec|
|000021e0| 20 77 69 6c 6c 20 77 61 | 72 6e 20 77 68 65 6e 20 | will wa|rn when |
|000021f0| 61 20 75 73 65 72 20 68 | 61 73 20 61 20 6e 75 6c |a user h|as a nul|
|00002200| 6c 0a 50 57 2c 20 62 75 | 74 20 77 69 6c 6c 20 61 |l.PW, bu|t will a|
|00002210| 6c 6c 6f 77 20 72 6f 6f | 74 20 61 63 63 65 73 73 |llow roo|t access|
|00002220| 20 61 6e 79 77 61 79 29 | 2e 0a 58 0a 73 65 63 70 | anyway)|..X.secp|
|00002230| 77 20 6d 61 79 20 62 65 | 20 75 73 65 64 20 74 6f |w may be| used to|
|00002240| 20 63 68 61 6e 67 65 20 | 73 6f 6d 65 6f 6e 65 20 | change |someone |
|00002250| 65 6c 73 65 27 73 20 73 | 65 63 75 72 69 74 79 20 |else's s|ecurity |
|00002260| 70 61 73 73 77 6f 72 64 | 2c 20 69 6e 20 63 61 73 |password|, in cas|
|00002270| 65 0a 74 68 61 74 20 75 | 73 65 72 20 69 73 20 63 |e.that u|ser is c|
|00002280| 6f 6d 70 72 6f 6d 69 73 | 65 64 2e 20 73 65 63 70 |ompromis|ed. secp|
|00002290| 77 20 74 72 69 65 73 20 | 74 6f 20 73 65 74 75 69 |w tries |to setui|
|000022a0| 64 20 69 74 73 65 6c 66 | 20 74 6f 20 72 6f 6f 74 |d itself| to root|
|000022b0| 20 61 73 20 61 0a 74 65 | 73 74 20 74 6f 20 73 65 | as a.te|st to se|
|000022c0| 65 20 69 66 20 69 74 20 | 69 73 20 62 65 69 6e 67 |e if it |is being|
|000022d0| 20 72 75 6e 20 62 79 20 | 72 6f 6f 74 2e 20 54 68 | run by |root. Th|
|000022e0| 65 72 65 66 6f 72 65 20 | 79 6f 75 20 6d 75 73 74 |erefore |you must|
|000022f0| 20 4e 4f 54 20 73 75 69 | 64 0a 73 65 63 70 77 2e | NOT sui|d.secpw.|
|00002300| 20 73 65 63 70 77 20 77 | 69 6c 6c 20 6e 6f 74 20 | secpw w|ill not |
|00002310| 72 75 6e 20 69 66 20 69 | 74 20 63 61 6e 27 74 20 |run if i|t can't |
|00002320| 73 65 74 75 69 64 28 30 | 29 2c 20 73 6f 20 74 6f |setuid(0|), so to|
|00002330| 20 63 68 61 6e 67 65 20 | 79 6f 75 72 20 73 65 63 | change |your sec|
|00002340| 0a 70 61 73 73 77 6f 72 | 64 2c 20 79 6f 75 20 66 |.passwor|d, you f|
|00002350| 69 72 73 74 20 68 61 76 | 65 20 74 6f 20 67 65 74 |irst hav|e to get|
|00002360| 20 69 6e 74 6f 20 73 65 | 63 20 28 6f 72 20 72 6f | into se|c (or ro|
|00002370| 6f 74 29 2c 20 70 72 65 | 73 75 6d 61 62 6c 79 20 |ot), pre|sumably |
|00002380| 75 73 69 6e 67 0a 79 6f | 75 72 20 6f 6c 64 20 70 |using.yo|ur old p|
|00002390| 61 73 73 77 6f 72 64 2e | 0a 58 0a 41 73 20 66 75 |assword.|.X.As fu|
|000023a0| 72 74 68 65 72 20 70 72 | 6f 74 65 63 74 69 6f 6e |rther pr|otection|
|000023b0| 2c 20 69 74 20 69 73 20 | 73 75 67 67 65 73 74 65 |, it is |suggeste|
|000023c0| 64 20 74 68 61 74 20 73 | 65 63 20 61 75 74 68 6f |d that s|ec autho|
|000023d0| 72 69 7a 65 64 20 75 73 | 65 72 73 20 62 65 20 70 |rized us|ers be p|
|000023e0| 6c 61 63 65 64 0a 69 6e | 74 6f 20 61 20 73 65 70 |laced.in|to a sep|
|000023f0| 61 72 61 74 65 20 22 6f | 70 65 72 61 74 6f 72 22 |arate "o|perator"|
|00002400| 20 6f 72 20 22 73 65 63 | 22 20 67 72 6f 75 70 2c | or "sec|" group,|
|00002410| 20 61 6e 64 20 74 68 61 | 74 20 6f 6e 6c 79 20 74 | and tha|t only t|
|00002420| 68 69 73 20 67 72 6f 75 | 70 20 62 65 0a 61 6c 6c |his grou|p be.all|
|00002430| 6f 77 65 64 20 74 6f 20 | 65 76 65 6e 20 72 75 6e |owed to |even run|
|00002440| 20 73 65 63 20 28 63 68 | 6d 6f 64 20 6f 2d 72 77 | sec (ch|mod o-rw|
|00002450| 78 29 2e 0a 53 48 41 52 | 5f 45 4f 46 0a 63 68 6d |x)..SHAR|_EOF.chm|
|00002460| 6f 64 20 30 36 34 34 20 | 52 45 41 44 4d 45 20 7c |od 0644 |README ||
|00002470| 7c 0a 65 63 68 6f 20 27 | 72 65 73 74 6f 72 65 20 ||.echo '|restore |
|00002480| 6f 66 20 52 45 41 44 4d | 45 20 66 61 69 6c 65 64 |of READM|E failed|
|00002490| 27 0a 57 63 5f 63 3d 22 | 60 77 63 20 2d 63 20 3c |'.Wc_c="|`wc -c <|
|000024a0| 20 27 52 45 41 44 4d 45 | 27 60 22 0a 74 65 73 74 | 'README|'`".test|
|000024b0| 20 31 38 30 33 20 2d 65 | 71 20 22 24 57 63 5f 63 | 1803 -e|q "$Wc_c|
|000024c0| 22 20 7c 7c 0a 09 65 63 | 68 6f 20 27 52 45 41 44 |" ||..ec|ho 'READ|
|000024d0| 4d 45 3a 20 6f 72 69 67 | 69 6e 61 6c 20 73 69 7a |ME: orig|inal siz|
|000024e0| 65 20 31 38 30 33 2c 20 | 63 75 72 72 65 6e 74 20 |e 1803, |current |
|000024f0| 73 69 7a 65 27 20 22 24 | 57 63 5f 63 22 0a 72 6d |size' "$|Wc_c".rm|
|00002500| 20 2d 66 20 5f 73 68 61 | 72 5f 77 6e 74 5f 2e 74 | -f _sha|r_wnt_.t|
|00002510| 6d 70 0a 66 69 0a 23 20 | 3d 3d 3d 3d 3d 3d 3d 3d |mp.fi.# |========|
|00002520| 3d 3d 3d 3d 3d 20 63 6f | 6e 66 69 67 2e 68 20 3d |===== co|nfig.h =|
|00002530| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0a 69 66 |========|=====.if|
|00002540| 20 74 65 73 74 20 2d 66 | 20 27 63 6f 6e 66 69 67 | test -f| 'config|
|00002550| 2e 68 27 20 2d 61 20 58 | 22 24 31 22 20 21 3d 20 |.h' -a X|"$1" != |
|00002560| 58 22 2d 63 22 3b 20 74 | 68 65 6e 0a 09 65 63 68 |X"-c"; t|hen..ech|
|00002570| 6f 20 27 78 20 2d 20 73 | 6b 69 70 70 69 6e 67 20 |o 'x - s|kipping |
|00002580| 63 6f 6e 66 69 67 2e 68 | 20 28 46 69 6c 65 20 61 |config.h| (File a|
|00002590| 6c 72 65 61 64 79 20 65 | 78 69 73 74 73 29 27 0a |lready e|xists)'.|
|000025a0| 09 72 6d 20 2d 66 20 5f | 73 68 61 72 5f 77 6e 74 |.rm -f _|shar_wnt|
|000025b0| 5f 2e 74 6d 70 0a 65 6c | 73 65 0a 3e 20 5f 73 68 |_.tmp.el|se.> _sh|
|000025c0| 61 72 5f 77 6e 74 5f 2e | 74 6d 70 0a 65 63 68 6f |ar_wnt_.|tmp.echo|
|000025d0| 20 27 78 20 2d 20 65 78 | 74 72 61 63 74 69 6e 67 | 'x - ex|tracting|
|000025e0| 20 63 6f 6e 66 69 67 2e | 68 20 28 54 65 78 74 29 | config.|h (Text)|
|000025f0| 27 0a 73 65 64 20 27 73 | 2f 5e 58 2f 2f 27 20 3c |'.sed 's|/^X//' <|
|00002600| 3c 20 27 53 48 41 52 5f | 45 4f 46 27 20 3e 20 27 |< 'SHAR_|EOF' > '|
|00002610| 63 6f 6e 66 69 67 2e 68 | 27 20 26 26 0a 2f 2a 0a |config.h|' &&./*.|
|00002620| 58 20 2a 0a 58 20 2a 20 | 63 6f 6e 66 69 67 2e 68 |X *.X * |config.h|
|00002630| 20 66 6f 72 20 73 65 63 | 2f 73 65 63 70 77 0a 58 | for sec|/secpw.X|
|00002640| 20 2a 0a 58 20 2a 2f 0a | 58 0a 2f 2a 0a 58 0a 54 | *.X */.|X./*.X.T|
|00002650| 68 65 20 66 69 72 73 74 | 20 74 68 72 65 65 20 64 |he first| three d|
|00002660| 65 66 69 6e 69 74 69 6f | 6e 73 20 61 72 65 20 66 |efinitio|ns are f|
|00002670| 6f 72 20 73 79 73 6c 6f | 67 2e 20 54 68 65 20 66 |or syslo|g. The f|
|00002680| 69 72 73 74 20 69 73 20 | 74 68 65 20 6c 6f 67 67 |irst is |the logg|
|00002690| 69 6e 67 0a 66 61 63 69 | 6c 69 74 79 20 63 6f 64 |ing.faci|lity cod|
|000026a0| 65 20 74 6f 20 75 73 65 | 2e 20 4c 4f 47 5f 46 41 |e to use|. LOG_FA|
|000026b0| 49 4c 5f 50 52 49 20 69 | 73 20 74 68 65 20 70 72 |IL_PRI i|s the pr|
|000026c0| 69 6f 72 69 74 79 20 74 | 6f 20 75 73 65 20 77 68 |iority t|o use wh|
|000026d0| 65 6e 20 6c 6f 67 67 69 | 6e 67 0a 61 20 66 61 69 |en loggi|ng.a fai|
|000026e0| 6c 75 72 65 20 69 6e 20 | 61 75 74 68 6f 72 69 7a |lure in |authoriz|
|000026f0| 61 74 69 6f 6e 20 6d 65 | 73 73 61 67 65 2e 20 49 |ation me|ssage. I|
|00002700| 2e 65 2e 20 6d 69 73 74 | 79 70 65 64 20 70 61 73 |.e. mist|yped pas|
|00002710| 73 77 6f 72 64 2c 20 75 | 6e 61 75 74 68 6f 72 69 |sword, u|nauthori|
|00002720| 7a 65 64 0a 75 73 65 72 | 2c 20 65 74 63 2e 20 4c |zed.user|, etc. L|
|00002730| 4f 47 5f 4f 4b 5f 50 52 | 49 20 69 73 20 74 68 65 |OG_OK_PR|I is the|
|00002740| 20 70 72 69 6f 72 69 74 | 79 20 74 6f 20 75 73 65 | priorit|y to use|
|00002750| 20 77 68 65 6e 20 6c 6f | 67 67 69 6e 67 20 61 20 | when lo|gging a |
|00002760| 73 75 63 63 65 73 73 66 | 75 6c 0a 61 74 74 65 6d |successf|ul.attem|
|00002770| 70 74 2e 0a 58 0a 2a 2f | 0a 58 0a 23 64 65 66 69 |pt..X.*/|.X.#defi|
|00002780| 6e 65 20 4c 4f 47 5f 46 | 41 43 49 4c 49 54 59 20 |ne LOG_F|ACILITY |
|00002790| 4c 4f 47 5f 41 55 54 48 | 0a 23 64 65 66 69 6e 65 |LOG_AUTH|.#define|
|000027a0| 20 4c 4f 47 5f 46 41 49 | 4c 5f 50 52 49 20 4c 4f | LOG_FAI|L_PRI LO|
|000027b0| 47 5f 57 41 52 4e 49 4e | 47 0a 23 64 65 66 69 6e |G_WARNIN|G.#defin|
|000027c0| 65 20 4c 4f 47 5f 4f 4b | 5f 50 52 49 20 4c 4f 47 |e LOG_OK|_PRI LOG|
|000027d0| 5f 4e 4f 54 49 43 45 0a | 58 0a 2f 2a 0a 58 0a 54 |_NOTICE.|X./*.X.T|
|000027e0| 68 65 20 6e 65 78 74 20 | 64 65 66 69 6e 69 74 69 |he next |definiti|
|000027f0| 6f 6e 20 69 73 20 74 68 | 65 20 6c 6f 63 61 74 69 |on is th|e locati|
|00002800| 6f 6e 20 6f 66 20 74 68 | 65 20 73 65 63 75 72 69 |on of th|e securi|
|00002810| 74 79 20 66 69 6c 65 2c | 20 61 6e 64 20 74 68 65 |ty file,| and the|
|00002820| 20 74 65 6d 70 6f 72 61 | 72 79 0a 66 69 6c 65 20 | tempora|ry.file |
|00002830| 66 6f 72 20 73 65 63 70 | 77 20 74 6f 20 75 73 65 |for secp|w to use|
|00002840| 2e 20 74 68 65 20 74 65 | 6d 70 20 66 69 6c 65 20 |. the te|mp file |
|00002850| 4d 55 53 54 20 62 65 20 | 6f 6e 20 74 68 65 20 73 |MUST be |on the s|
|00002860| 61 6d 65 20 66 69 6c 65 | 20 73 79 73 74 65 6d 20 |ame file| system |
|00002870| 61 73 0a 74 68 65 20 72 | 65 61 6c 20 66 69 6c 65 |as.the r|eal file|
|00002880| 2e 20 72 65 6e 61 6d 65 | 28 29 20 69 73 20 75 73 |. rename|() is us|
|00002890| 65 64 20 74 6f 20 6d 6f | 76 65 20 74 68 65 20 74 |ed to mo|ve the t|
|000028a0| 65 6d 70 20 74 6f 20 74 | 68 65 20 72 65 61 6c 20 |emp to t|he real |
|000028b0| 6f 6e 65 20 77 68 65 6e | 0a 74 68 65 20 63 68 61 |one when|.the cha|
|000028c0| 6e 67 65 20 69 73 20 64 | 6f 6e 65 2e 20 4a 75 73 |nge is d|one. Jus|
|000028d0| 74 20 6c 69 6b 65 20 76 | 69 70 77 2e 0a 58 0a 2a |t like v|ipw..X.*|
|000028e0| 2f 0a 58 0a 23 64 65 66 | 69 6e 65 20 46 49 4c 45 |/.X.#def|ine FILE|
|000028f0| 4e 41 4d 45 20 22 2f 75 | 73 72 2f 61 64 6d 2f 73 |NAME "/u|sr/adm/s|
|00002900| 65 63 75 72 69 74 79 22 | 0a 23 64 65 66 69 6e 65 |ecurity"|.#define|
|00002910| 20 54 45 4d 50 4e 41 4d | 45 20 22 2f 75 73 72 2f | TEMPNAM|E "/usr/|
|00002920| 61 64 6d 2f 73 65 63 75 | 72 69 74 79 2e 74 6d 70 |adm/secu|rity.tmp|
|00002930| 22 0a 23 69 6e 63 6c 75 | 64 65 20 3c 73 74 64 69 |".#inclu|de <stdi|
|00002940| 6f 2e 68 3e 0a 53 48 41 | 52 5f 45 4f 46 0a 63 68 |o.h>.SHA|R_EOF.ch|
|00002950| 6d 6f 64 20 30 36 34 34 | 20 63 6f 6e 66 69 67 2e |mod 0644| config.|
|00002960| 68 20 7c 7c 0a 65 63 68 | 6f 20 27 72 65 73 74 6f |h ||.ech|o 'resto|
|00002970| 72 65 20 6f 66 20 63 6f | 6e 66 69 67 2e 68 20 66 |re of co|nfig.h f|
|00002980| 61 69 6c 65 64 27 0a 57 | 63 5f 63 3d 22 60 77 63 |ailed'.W|c_c="`wc|
|00002990| 20 2d 63 20 3c 20 27 63 | 6f 6e 66 69 67 2e 68 27 | -c < 'c|onfig.h'|
|000029a0| 60 22 0a 74 65 73 74 20 | 37 39 36 20 2d 65 71 20 |`".test |796 -eq |
|000029b0| 22 24 57 63 5f 63 22 20 | 7c 7c 0a 09 65 63 68 6f |"$Wc_c" |||..echo|
|000029c0| 20 27 63 6f 6e 66 69 67 | 2e 68 3a 20 6f 72 69 67 | 'config|.h: orig|
|000029d0| 69 6e 61 6c 20 73 69 7a | 65 20 37 39 36 2c 20 63 |inal siz|e 796, c|
|000029e0| 75 72 72 65 6e 74 20 73 | 69 7a 65 27 20 22 24 57 |urrent s|ize' "$W|
|000029f0| 63 5f 63 22 0a 72 6d 20 | 2d 66 20 5f 73 68 61 72 |c_c".rm |-f _shar|
|00002a00| 5f 77 6e 74 5f 2e 74 6d | 70 0a 66 69 0a 65 78 69 |_wnt_.tm|p.fi.exi|
|00002a10| 74 20 30 0a 2d 2d 20 0a | 4e 69 63 6b 20 53 61 79 |t 0.-- .|Nick Say|
|00002a20| 65 72 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |er | |
|00002a30| 20 7c 20 20 44 69 73 63 | 6c 61 69 6d 65 72 3a 0a | | Disc|laimer:.|
|00002a40| 4e 36 51 51 51 20 20 20 | 20 20 20 20 20 20 20 20 |N6QQQ | |
|00002a50| 20 20 20 20 20 20 20 20 | 20 7c 20 20 20 20 22 4a | | | "J|
|00002a60| 75 73 74 20 62 65 63 61 | 75 73 65 20 79 6f 75 27 |ust beca|use you'|
|00002a70| 72 65 20 72 65 61 64 69 | 6e 67 20 6d 79 20 70 6f |re readi|ng my po|
|00002a80| 73 74 20 64 6f 65 73 6e | 27 74 0a 6d 72 61 70 70 |st doesn|'t.mrapp|
|00002a90| 6c 65 40 71 75 61 63 6b | 2e 73 61 63 2e 63 61 2e |le@quack|.sac.ca.|
|00002aa0| 75 73 20 20 7c 20 20 20 | 20 20 6d 65 61 6e 20 77 |us | | mean w|
|00002ab0| 65 27 72 65 20 67 6f 6e | 6e 61 20 74 61 6b 65 20 |e're gon|na take |
|00002ac0| 6c 6f 6e 67 20 73 68 6f | 77 65 72 73 20 74 6f 67 |long sho|wers tog|
|00002ad0| 65 74 68 65 72 2e 22 0a | 32 30 39 2d 39 35 32 2d |ether.".|209-952-|
|00002ae0| 35 33 34 37 20 28 54 65 | 6c 65 62 69 74 29 20 20 |5347 (Te|lebit) |
|00002af0| 20 7c 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |
|00002b00| 20 20 20 20 20 20 20 20 | 2d 2d 20 47 75 6e 6e 65 | |-- Gunne|
|00002b10| 72 79 20 53 67 74 2e 20 | 54 68 6f 6d 61 73 20 48 |ry Sgt. |Thomas H|
|00002b20| 69 67 68 77 61 79 0a 0a | |ighway..| |
+--------+-------------------------+-------------------------+--------+--------+