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

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: 1327

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



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 63 73 | 75 40 61 6c 65 6d 62 69 |From: cs|u@alembi|
|00000010| 63 2e 61 63 73 2e 63 6f | 6d 20 28 44 61 76 65 20 |c.acs.co|m (Dave |
|00000020| 4d 61 63 6b 29 0a 4e 65 | 77 73 67 72 6f 75 70 73 |Mack).Ne|wsgroups|
|00000030| 3a 20 63 6f 6d 70 2e 6c | 61 6e 67 2e 70 65 72 6c |: comp.l|ang.perl|
|00000040| 2c 61 6c 74 2e 73 6f 75 | 72 63 65 73 0a 53 75 62 |,alt.sou|rces.Sub|
|00000050| 6a 65 63 74 3a 20 63 68 | 66 6e 20 69 6e 20 50 65 |ject: ch|fn in Pe|
|00000060| 72 6c 20 2d 20 63 68 61 | 6e 67 65 20 66 75 6c 6c |rl - cha|nge full|
|00000070| 6e 61 6d 65 20 69 6e 20 | 2f 65 74 63 2f 70 61 73 |name in |/etc/pas|
|00000080| 73 77 64 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |swd.Mess|age-ID: |
|00000090| 3c 31 39 39 30 4d 61 79 | 31 33 2e 31 39 31 36 33 |<1990May|13.19163|
|000000a0| 32 2e 31 38 36 33 36 40 | 61 6c 65 6d 62 69 63 2e |2.18636@|alembic.|
|000000b0| 61 63 73 2e 63 6f 6d 3e | 0a 44 61 74 65 3a 20 31 |acs.com>|.Date: 1|
|000000c0| 33 20 4d 61 79 20 39 30 | 20 31 39 3a 31 36 3a 33 |3 May 90| 19:16:3|
|000000d0| 32 20 47 4d 54 0a 0a 45 | 6e 63 6c 6f 73 65 64 20 |2 GMT..E|nclosed |
|000000e0| 69 73 20 61 20 73 68 61 | 72 20 66 69 6c 65 20 63 |is a sha|r file c|
|000000f0| 6f 6e 74 61 69 6e 69 6e | 67 20 61 20 73 69 6d 70 |ontainin|g a simp|
|00000100| 6c 65 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 63 68 |le versi|on of ch|
|00000110| 66 6e 20 77 72 69 74 74 | 65 6e 0a 69 6e 20 70 65 |fn writt|en.in pe|
|00000120| 72 6c 2e 20 50 6c 65 61 | 73 65 20 6e 6f 74 65 20 |rl. Plea|se note |
|00000130| 74 68 61 74 20 69 74 20 | 69 6e 76 6f 6b 65 73 20 |that it |invokes |
|00000140| 22 73 75 69 64 70 65 72 | 6c 22 20 61 73 20 74 68 |"suidper|l" as th|
|00000150| 65 20 69 6e 74 65 72 70 | 72 65 74 65 72 2e 0a 49 |e interp|reter..I|
|00000160| 66 20 79 6f 75 72 20 73 | 79 73 74 65 6d 20 73 75 |f your s|ystem su|
|00000170| 70 70 6f 72 74 73 20 73 | 75 69 64 20 73 63 72 69 |pports s|uid scri|
|00000180| 70 74 73 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |pts, you| should |
|00000190| 70 72 6f 62 61 62 6c 79 | 20 63 68 61 6e 67 65 20 |probably| change |
|000001a0| 74 68 69 73 2e 0a 41 6c | 73 6f 20 6e 6f 74 65 20 |this..Al|so note |
|000001b0| 74 68 61 74 20 63 68 66 | 6e 20 68 61 73 20 74 6f |that chf|n has to|
|000001c0| 20 72 75 6e 20 73 75 69 | 64 20 72 6f 6f 74 2c 20 | run sui|d root, |
|000001d0| 61 73 20 69 74 20 6d 6f | 64 69 66 69 65 73 20 74 |as it mo|difies t|
|000001e0| 68 65 20 70 61 73 73 77 | 6f 72 64 0a 66 69 6c 65 |he passw|ord.file|
|000001f0| 2e 20 49 27 76 65 20 64 | 6f 6e 65 20 65 76 65 72 |. I've d|one ever|
|00000200| 79 74 68 69 6e 67 20 49 | 20 63 61 6e 20 74 68 69 |ything I| can thi|
|00000210| 6e 6b 20 6f 66 20 74 6f | 20 6d 61 6b 65 20 73 75 |nk of to| make su|
|00000220| 72 65 20 74 68 61 74 20 | 74 68 69 73 0a 64 6f 65 |re that |this.doe|
|00000230| 73 6e 27 74 20 6f 70 65 | 6e 20 61 6e 79 20 73 65 |sn't ope|n any se|
|00000240| 63 75 72 69 74 79 20 68 | 6f 6c 65 73 2c 20 62 75 |curity h|oles, bu|
|00000250| 74 20 49 20 6d 61 6b 65 | 20 6e 6f 20 67 75 61 72 |t I make| no guar|
|00000260| 61 6e 74 65 65 73 20 61 | 62 6f 75 74 20 69 74 2e |antees a|bout it.|
|00000270| 0a 0a 49 20 67 75 65 73 | 73 20 49 20 73 68 6f 75 |..I gues|s I shou|
|00000280| 6c 64 20 6d 65 6e 74 69 | 6f 6e 20 74 68 61 74 20 |ld menti|on that |
|00000290| 63 68 66 6e 20 63 68 61 | 6e 67 65 73 20 74 68 65 |chfn cha|nges the|
|000002a0| 20 66 75 6c 6c 20 6e 61 | 6d 65 20 28 6f 72 20 47 | full na|me (or G|
|000002b0| 45 43 4f 53 29 0a 66 69 | 65 6c 64 20 69 6e 20 74 |ECOS).fi|eld in t|
|000002c0| 68 65 20 70 61 73 73 77 | 6f 72 64 20 66 69 6c 65 |he passw|ord file|
|000002d0| 2e 0a 0a 49 66 20 79 6f | 75 20 6d 61 6b 65 20 61 |...If yo|u make a|
|000002e0| 6e 79 20 69 6d 70 72 6f | 76 65 6d 65 6e 74 73 20 |ny impro|vements |
|000002f0| 74 6f 20 74 68 69 73 20 | 73 63 72 69 70 74 2c 20 |to this |script, |
|00000300| 49 27 64 20 61 70 70 72 | 65 63 69 61 74 65 20 68 |I'd appr|eciate h|
|00000310| 65 61 72 69 6e 67 0a 61 | 62 6f 75 74 20 69 74 2e |earing.a|bout it.|
|00000320| 0a 0a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |..------|--------|
|00000330| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000340| 2d 2d 20 63 75 74 20 68 | 65 72 65 20 2d 2d 2d 2d |-- cut h|ere ----|
|00000350| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000360| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0a 23 21 20 |--------|----.#! |
|00000370| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|00000380| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000390| 65 2e 20 20 52 65 6d 6f | 76 65 20 61 6e 79 74 68 |e. Remo|ve anyth|
|000003a0| 69 6e 67 20 62 65 66 6f | 72 65 20 74 68 69 73 20 |ing befo|re this |
|000003b0| 6c 69 6e 65 2c 20 74 68 | 65 6e 20 75 6e 70 61 63 |line, th|en unpac|
|000003c0| 6b 0a 23 20 69 74 20 62 | 79 20 73 61 76 69 6e 67 |k.# it b|y saving|
|000003d0| 20 69 74 20 69 6e 74 6f | 20 61 20 66 69 6c 65 20 | it into| a file |
|000003e0| 61 6e 64 20 74 79 70 69 | 6e 67 20 22 73 68 20 66 |and typi|ng "sh f|
|000003f0| 69 6c 65 22 2e 20 20 54 | 6f 20 6f 76 65 72 77 72 |ile". T|o overwr|
|00000400| 69 74 65 20 65 78 69 73 | 74 69 6e 67 0a 23 20 66 |ite exis|ting.# f|
|00000410| 69 6c 65 73 2c 20 74 79 | 70 65 20 22 73 68 20 66 |iles, ty|pe "sh f|
|00000420| 69 6c 65 20 2d 63 22 2e | 20 20 59 6f 75 20 63 61 |ile -c".| You ca|
|00000430| 6e 20 61 6c 73 6f 20 66 | 65 65 64 20 74 68 69 73 |n also f|eed this|
|00000440| 20 61 73 20 73 74 61 6e | 64 61 72 64 20 69 6e 70 | as stan|dard inp|
|00000450| 75 74 20 76 69 61 0a 23 | 20 75 6e 73 68 61 72 2c |ut via.#| unshar,|
|00000460| 20 6f 72 20 62 79 20 74 | 79 70 69 6e 67 20 22 73 | or by t|yping "s|
|00000470| 68 20 3c 66 69 6c 65 22 | 2c 20 65 2e 67 2e 2e 20 |h <file"|, e.g.. |
|00000480| 20 49 66 20 74 68 69 73 | 20 61 72 63 68 69 76 65 | If this| archive|
|00000490| 20 69 73 20 63 6f 6d 70 | 6c 65 74 65 2c 20 79 6f | is comp|lete, yo|
|000004a0| 75 0a 23 20 77 69 6c 6c | 20 73 65 65 20 74 68 65 |u.# will| see the|
|000004b0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6d 65 73 73 61 | followi|ng messa|
|000004c0| 67 65 20 61 74 20 74 68 | 65 20 65 6e 64 3a 0a 23 |ge at th|e end:.#|
|000004d0| 09 09 22 45 6e 64 20 6f | 66 20 73 68 65 6c 6c 20 |.."End o|f shell |
|000004e0| 61 72 63 68 69 76 65 2e | 22 0a 23 20 43 6f 6e 74 |archive.|".# Cont|
|000004f0| 65 6e 74 73 3a 20 20 63 | 68 66 6e 0a 23 20 57 72 |ents: c|hfn.# Wr|
|00000500| 61 70 70 65 64 20 62 79 | 20 63 73 75 40 61 6c 65 |apped by| csu@ale|
|00000510| 6d 62 69 63 20 6f 6e 20 | 53 75 6e 20 4d 61 79 20 |mbic on |Sun May |
|00000520| 31 33 20 31 35 3a 30 33 | 3a 33 38 20 31 39 39 30 |13 15:03|:38 1990|
|00000530| 0a 50 41 54 48 3d 2f 62 | 69 6e 3a 2f 75 73 72 2f |.PATH=/b|in:/usr/|
|00000540| 62 69 6e 3a 2f 75 73 72 | 2f 75 63 62 20 3b 20 65 |bin:/usr|/ucb ; e|
|00000550| 78 70 6f 72 74 20 50 41 | 54 48 0a 69 66 20 74 65 |xport PA|TH.if te|
|00000560| 73 74 20 2d 66 20 63 68 | 66 6e 20 2d 61 20 22 24 |st -f ch|fn -a "$|
|00000570| 7b 31 7d 22 20 21 3d 20 | 22 2d 63 22 20 3b 20 74 |{1}" != |"-c" ; t|
|00000580| 68 65 6e 20 0a 20 20 65 | 63 68 6f 20 73 68 61 72 |hen . e|cho shar|
|00000590| 3a 20 57 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: Will n|ot over-|
|000005a0| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|000005b0| 69 6c 65 20 5c 22 63 68 | 66 6e 5c 22 0a 65 6c 73 |ile \"ch|fn\".els|
|000005c0| 65 0a 65 63 68 6f 20 73 | 68 61 72 3a 20 45 78 74 |e.echo s|har: Ext|
|000005d0| 72 61 63 74 69 6e 67 20 | 5c 22 63 68 66 6e 5c 22 |racting |\"chfn\"|
|000005e0| 20 5c 28 31 36 31 32 20 | 63 68 61 72 61 63 74 65 | \(1612 |characte|
|000005f0| 72 73 5c 29 0a 73 65 64 | 20 22 73 2f 5e 58 2f 2f |rs\).sed| "s/^X//|
|00000600| 22 20 3e 63 68 66 6e 20 | 3c 3c 27 45 4e 44 5f 4f |" >chfn |<<'END_O|
|00000610| 46 5f 63 68 66 6e 27 0a | 58 23 21 20 2f 75 73 72 |F_chfn'.|X#! /usr|
|00000620| 2f 6c 6f 63 61 6c 2f 62 | 69 6e 2f 73 75 69 64 70 |/local/b|in/suidp|
|00000630| 65 72 6c 20 0a 58 23 0a | 58 23 20 43 68 61 6e 67 |erl .X#.|X# Chang|
|00000640| 65 20 75 73 65 72 27 73 | 20 66 75 6c 6c 20 6e 61 |e user's| full na|
|00000650| 6d 65 20 69 6e 20 70 61 | 73 73 77 6f 72 64 20 66 |me in pa|ssword f|
|00000660| 69 6c 65 0a 58 23 20 4d | 75 73 74 20 62 65 20 73 |ile.X# M|ust be s|
|00000670| 75 69 64 20 72 6f 6f 74 | 0a 58 23 0a 58 23 20 55 |uid root|.X#.X# U|
|00000680| 73 61 67 65 3a 20 63 68 | 66 6e 20 6e 65 77 2d 66 |sage: ch|fn new-f|
|00000690| 75 6c 6c 2d 6e 61 6d 65 | 0a 58 23 20 41 75 74 68 |ull-name|.X# Auth|
|000006a0| 6f 72 3a 20 44 61 76 65 | 20 4d 61 63 6b 2c 20 63 |or: Dave| Mack, c|
|000006b0| 73 75 40 61 6c 65 6d 62 | 69 63 2e 41 43 53 2e 43 |su@alemb|ic.ACS.C|
|000006c0| 4f 4d 0a 58 23 20 4e 6f | 74 65 73 3a 0a 58 23 20 |OM.X# No|tes:.X# |
|000006d0| 43 68 61 6e 67 65 73 20 | 6f 6e 6c 79 20 74 68 65 |Changes |only the|
|000006e0| 20 66 69 72 73 74 20 6f | 63 63 75 72 65 6e 63 65 | first o|ccurence|
|000006f0| 20 6f 66 20 74 68 65 20 | 65 6e 74 72 79 20 69 6e | of the |entry in|
|00000700| 20 74 68 65 20 70 61 73 | 73 77 64 0a 58 23 20 66 | the pas|swd.X# f|
|00000710| 69 6c 65 20 77 69 74 68 | 20 74 68 65 20 73 61 6d |ile with| the sam|
|00000720| 65 20 75 69 64 20 61 73 | 20 74 68 65 20 69 6e 76 |e uid as| the inv|
|00000730| 6f 6b 69 6e 67 20 70 72 | 6f 63 65 73 73 2e 0a 58 |oking pr|ocess..X|
|00000740| 23 0a 58 23 20 54 68 69 | 73 20 63 6f 64 65 20 69 |#.X# Thi|s code i|
|00000750| 73 20 68 65 72 65 62 79 | 20 70 6c 61 63 65 64 20 |s hereby| placed |
|00000760| 69 6e 20 74 68 65 20 70 | 75 62 6c 69 63 20 64 6f |in the p|ublic do|
|00000770| 6d 61 69 6e 20 61 6e 64 | 20 6d 61 79 20 62 65 0a |main and| may be.|
|00000780| 58 23 20 75 73 65 64 20 | 66 6f 72 20 61 6e 79 20 |X# used |for any |
|00000790| 70 75 72 70 6f 73 65 20 | 77 68 61 74 73 6f 65 76 |purpose |whatsoev|
|000007a0| 65 72 2c 20 62 75 74 20 | 69 66 20 79 6f 75 20 75 |er, but |if you u|
|000007b0| 73 65 20 69 74 2c 20 79 | 6f 75 20 64 6f 0a 58 23 |se it, y|ou do.X#|
|000007c0| 20 73 6f 20 61 74 20 79 | 6f 75 72 20 6f 77 6e 20 | so at y|our own |
|000007d0| 72 69 73 6b 2e 0a 58 0a | 58 64 69 65 20 22 55 73 |risk..X.|Xdie "Us|
|000007e0| 61 67 65 3a 20 63 68 66 | 6e 20 6e 65 77 2d 66 75 |age: chf|n new-fu|
|000007f0| 6c 6c 2d 6e 61 6d 65 5c | 6e 22 20 69 66 20 28 20 |ll-name\|n" if ( |
|00000800| 24 23 41 52 47 56 20 21 | 3d 20 30 20 29 3b 0a 58 |$#ARGV !|= 0 );.X|
|00000810| 0a 58 75 6d 61 73 6b 28 | 30 36 30 30 29 3b 20 23 |.Xumask(|0600); #|
|00000820| 20 44 6f 6e 27 74 20 77 | 61 6e 74 20 66 6f 6c 6b | Don't w|ant folk|
|00000830| 73 20 6d 65 73 73 69 6e | 67 20 77 69 74 68 20 74 |s messin|g with t|
|00000840| 68 65 20 74 6d 70 20 66 | 69 6c 65 0a 58 0a 58 6f |he tmp f|ile.X.Xo|
|00000850| 70 65 6e 28 50 57 2c 22 | 3c 2f 65 74 63 2f 70 61 |pen(PW,"|</etc/pa|
|00000860| 73 73 77 64 22 29 20 7c | 7c 20 64 69 65 20 22 43 |sswd") ||| die "C|
|00000870| 61 6e 5c 27 74 20 6f 70 | 65 6e 20 2f 65 74 63 2f |an\'t op|en /etc/|
|00000880| 70 61 73 73 77 64 3a 20 | 24 21 5c 6e 22 3b 0a 58 |passwd: |$!\n";.X|
|00000890| 0a 58 23 20 55 73 69 6e | 67 20 61 20 77 6f 72 6c |.X# Usin|g a worl|
|000008a0| 64 2d 77 72 69 74 65 61 | 62 6c 65 20 64 69 72 65 |d-writea|ble dire|
|000008b0| 63 74 6f 72 79 20 66 6f | 72 20 74 68 65 20 74 65 |ctory fo|r the te|
|000008c0| 6d 70 20 66 69 6c 65 20 | 6f 70 65 6e 73 20 61 0a |mp file |opens a.|
|000008d0| 58 23 20 68 75 67 65 20 | 73 65 63 75 72 69 74 79 |X# huge |security|
|000008e0| 20 68 6f 6c 65 2e 20 55 | 73 65 20 2f 65 74 63 20 | hole. U|se /etc |
|000008f0| 69 6e 73 74 65 61 64 2e | 20 0a 58 6f 70 65 6e 28 |instead.| .Xopen(|
|00000900| 4e 45 57 50 57 2c 22 3e | 2f 65 74 63 2f 70 77 24 |NEWPW,">|/etc/pw$|
|00000910| 24 22 29 20 7c 7c 20 64 | 69 65 20 22 43 61 6e 5c |$") || d|ie "Can\|
|00000920| 27 74 20 6f 70 65 6e 20 | 74 65 6d 70 20 66 69 6c |'t open |temp fil|
|00000930| 65 3a 20 24 21 5c 6e 22 | 3b 0a 58 0a 58 23 20 70 |e: $!\n"|;.X.X# p|
|00000940| 75 6d 70 20 74 68 65 20 | 65 6e 74 69 72 65 20 70 |ump the |entire p|
|00000950| 61 73 73 77 64 20 66 69 | 6c 65 20 69 6e 74 6f 20 |asswd fi|le into |
|00000960| 61 6e 20 61 72 72 61 79 | 2e 20 4d 61 79 20 62 65 |an array|. May be|
|00000970| 20 62 61 64 20 69 64 65 | 61 20 6f 6e 20 73 79 73 | bad ide|a on sys|
|00000980| 74 65 6d 73 0a 58 23 20 | 77 69 74 68 20 6c 6f 74 |tems.X# |with lot|
|00000990| 73 20 6f 66 20 75 73 65 | 72 73 2e 0a 58 40 70 61 |s of use|rs..X@pa|
|000009a0| 73 73 6c 69 6e 65 73 20 | 3d 20 3c 50 57 3e 3b 0a |sslines |= <PW>;.|
|000009b0| 58 63 6c 6f 73 65 28 50 | 57 29 3b 0a 58 0a 58 24 |Xclose(P|W);.X.X$|
|000009c0| 63 68 61 6e 67 65 64 20 | 3d 20 30 3b 0a 58 66 6f |changed |= 0;.Xfo|
|000009d0| 72 20 28 20 24 69 20 3d | 20 30 3b 20 24 69 20 3c |r ( $i =| 0; $i <|
|000009e0| 3d 20 24 23 70 61 73 73 | 6c 69 6e 65 73 3b 20 24 |= $#pass|lines; $|
|000009f0| 69 2b 2b 20 29 20 7b 0a | 58 09 28 24 6c 6f 67 69 |i++ ) {.|X.($logi|
|00000a00| 6e 2c 24 70 61 73 73 77 | 6f 72 64 2c 24 75 69 64 |n,$passw|ord,$uid|
|00000a10| 2c 24 67 69 64 2c 24 66 | 75 6c 6c 6e 61 6d 65 2c |,$gid,$f|ullname,|
|00000a20| 24 68 6f 6d 65 64 69 72 | 2c 24 73 68 65 6c 6c 29 |$homedir|,$shell)|
|00000a30| 20 3d 20 73 70 6c 69 74 | 28 2f 3a 2f 2c 24 70 61 | = split|(/:/,$pa|
|00000a40| 73 73 6c 69 6e 65 73 5b | 24 69 5d 29 3b 0a 58 09 |sslines[|$i]);.X.|
|00000a50| 23 20 6f 6e 6c 79 20 63 | 68 61 6e 67 65 20 74 68 |# only c|hange th|
|00000a60| 65 20 66 69 72 73 74 20 | 69 6e 73 74 61 6e 63 65 |e first |instance|
|00000a70| 20 6f 66 20 65 6e 74 72 | 79 20 77 2f 20 73 61 6d | of entr|y w/ sam|
|00000a80| 65 20 75 69 64 0a 58 09 | 69 66 20 28 24 75 69 64 |e uid.X.|if ($uid|
|00000a90| 20 65 71 20 24 3c 20 26 | 26 20 21 20 24 63 68 61 | eq $< &|& ! $cha|
|00000aa0| 6e 67 65 64 29 20 7b 0a | 58 09 09 70 72 69 6e 74 |nged) {.|X..print|
|00000ab0| 20 22 43 68 61 6e 67 69 | 6e 67 20 66 75 6c 6c 6e | "Changi|ng fulln|
|00000ac0| 61 6d 65 20 66 6f 72 20 | 24 6c 6f 67 69 6e 20 66 |ame for |$login f|
|00000ad0| 72 6f 6d 20 24 66 75 6c | 6c 6e 61 6d 65 20 74 6f |rom $ful|lname to|
|00000ae0| 20 24 41 52 47 56 5b 30 | 5d 5c 6e 22 3b 0a 58 09 | $ARGV[0|]\n";.X.|
|00000af0| 09 24 66 75 6c 6c 6e 61 | 6d 65 20 3d 20 24 41 52 |.$fullna|me = $AR|
|00000b00| 47 56 5b 30 5d 3b 0a 58 | 09 09 24 63 68 61 6e 67 |GV[0];.X|..$chang|
|00000b10| 65 64 20 3d 20 31 3b 0a | 58 09 7d 0a 58 09 70 72 |ed = 1;.|X.}.X.pr|
|00000b20| 69 6e 74 20 4e 45 57 50 | 57 20 6a 6f 69 6e 28 27 |int NEWP|W join('|
|00000b30| 3a 27 2c 24 6c 6f 67 69 | 6e 2c 24 70 61 73 73 77 |:',$logi|n,$passw|
|00000b40| 6f 72 64 2c 24 75 69 64 | 2c 24 67 69 64 2c 24 66 |ord,$uid|,$gid,$f|
|00000b50| 75 6c 6c 6e 61 6d 65 2c | 24 68 6f 6d 65 64 69 72 |ullname,|$homedir|
|00000b60| 2c 24 73 68 65 6c 6c 29 | 3b 0a 58 7d 0a 58 23 20 |,$shell)|;.X}.X# |
|00000b70| 74 72 61 73 68 20 74 68 | 65 20 74 65 6d 70 20 66 |trash th|e temp f|
|00000b80| 69 6c 65 20 69 66 20 77 | 65 20 68 61 64 20 61 20 |ile if w|e had a |
|00000b90| 70 72 6f 62 6c 65 6d 0a | 58 69 66 20 28 20 21 20 |problem.|Xif ( ! |
|00000ba0| 24 63 68 61 6e 67 65 64 | 20 29 20 7b 0a 58 09 63 |$changed| ) {.X.c|
|00000bb0| 6c 6f 73 65 28 4e 45 57 | 50 57 29 3b 0a 58 09 75 |lose(NEW|PW);.X.u|
|00000bc0| 6e 6c 69 6e 6b 28 4e 45 | 57 50 57 29 3b 0a 58 09 |nlink(NE|WPW);.X.|
|00000bd0| 64 69 65 20 22 59 6f 75 | 20 64 6f 6e 27 74 20 73 |die "You| don't s|
|00000be0| 65 65 6d 20 74 6f 20 65 | 78 69 73 74 2e 20 53 6f |eem to e|xist. So|
|00000bf0| 72 72 79 2e 5c 6e 22 3b | 0a 58 7d 0a 58 0a 58 72 |rry.\n";|.X}.X.Xr|
|00000c00| 65 6e 61 6d 65 28 27 2f | 65 74 63 2f 70 61 73 73 |ename('/|etc/pass|
|00000c10| 77 64 27 2c 27 2f 65 74 | 63 2f 70 61 73 73 77 64 |wd','/et|c/passwd|
|00000c20| 2e 62 61 6b 27 29 3b 0a | 58 72 65 6e 61 6d 65 28 |.bak');.|Xrename(|
|00000c30| 22 2f 65 74 63 2f 70 77 | 24 24 22 2c 22 2f 65 74 |"/etc/pw|$$","/et|
|00000c40| 63 2f 70 61 73 73 77 64 | 22 29 3b 0a 58 23 20 6d |c/passwd|");.X# m|
|00000c50| 61 6b 65 20 73 75 72 65 | 20 2f 65 74 63 2f 70 61 |ake sure| /etc/pa|
|00000c60| 73 73 77 64 20 69 73 20 | 77 6f 72 6c 64 2d 72 65 |sswd is |world-re|
|00000c70| 61 64 61 62 6c 65 0a 58 | 63 68 6d 6f 64 20 30 36 |adable.X|chmod 06|
|00000c80| 34 34 2c 27 2f 65 74 63 | 2f 70 61 73 73 77 64 27 |44,'/etc|/passwd'|
|00000c90| 3b 0a 58 65 78 69 74 3b | 0a 45 4e 44 5f 4f 46 5f |;.Xexit;|.END_OF_|
|00000ca0| 63 68 66 6e 0a 69 66 20 | 74 65 73 74 20 31 36 31 |chfn.if |test 161|
|00000cb0| 32 20 2d 6e 65 20 60 77 | 63 20 2d 63 20 3c 63 68 |2 -ne `w|c -c <ch|
|00000cc0| 66 6e 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |fn`; the|n. ec|
|00000cd0| 68 6f 20 73 68 61 72 3a | 20 5c 22 63 68 66 6e 5c |ho shar:| \"chfn\|
|00000ce0| 22 20 75 6e 70 61 63 6b | 65 64 20 77 69 74 68 20 |" unpack|ed with |
|00000cf0| 77 72 6f 6e 67 20 73 69 | 7a 65 21 0a 66 69 0a 63 |wrong si|ze!.fi.c|
|00000d00| 68 6d 6f 64 20 2b 78 20 | 63 68 66 6e 0a 23 20 65 |hmod +x |chfn.# e|
|00000d10| 6e 64 20 6f 66 20 6f 76 | 65 72 77 72 69 74 69 6e |nd of ov|erwritin|
|00000d20| 67 20 63 68 65 63 6b 0a | 66 69 0a 65 63 68 6f 20 |g check.|fi.echo |
|00000d30| 73 68 61 72 3a 20 45 6e | 64 20 6f 66 20 73 68 65 |shar: En|d of she|
|00000d40| 6c 6c 20 61 72 63 68 69 | 76 65 2e 0a 65 78 69 74 |ll archi|ve..exit|
|00000d50| 20 30 0a | | 0. | |
+--------+-------------------------+-------------------------+--------+--------+