%!PS-Adobe-1.0 %%Creator: devps (Pipeline Associates, Inc.) %%CreationDate: Fri Sep 13 13:06:47 1996 %%Pages: (atend) %%DocumentFonts: (atend) /devps 180 dict def devps begin /res 10.000000 def /y_offset 843 def /X{exch}bind def /mm {transform round X round X itransform} bind def /r{rmoveto}bind def /m{moveto}bind def /l{lineto}bind def /rl{rlineto}bind def /st{stroke}bind def /gs{gsave}bind def /gr{grestore}bind def /cp{currentpoint}bind def /np{newpath}bind def /ct{curveto}bind def systemdict /setpacking known { /savepacking currentpacking def true setpacking } if /m0{0 0 moveto}bind def /xc{//res div}bind def /yc{//res neg div //y_offset add}bind def /lc{yc X xc X l st}bind def /mc{yc X xc X m}bind def /el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def /ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def /sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def /V{//res neg div //y_offset add currentpoint pop X m}bind def /H{//res div 0 transform X round X itransform pop currentpoint X pop moveto}bind def /h{//res div 0 r}bind def /v{//res neg div 0 X r}bind def /S{X H show}bind def /A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def /psize 10 def /height 0 def /cheight { height 0 ne { height } { psize } ifelse } bind def /slant 0 def /FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def /shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fill gr}bind def 1 setlinecap /resolution res 72 mul def /startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def }bind def /clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto }bind def /doclip { llx lly urx ury clipFig } def /endFig { end SavedState restore }bind def /globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def /globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def }bind def /fontnum 1 def systemdict /setpacking known { savepacking setpacking} if end /BP{ save mark devps begin m0 /DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap currentlinejoin currentdash currentgray currentmiterlimit ] cvx def }bind def /EP{ end cleartomark restore showpage}def /Encoding-1 256 array def 0 1 255 {Encoding-1 exch /.notdef put} for Encoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-B Encoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-b Encoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accents Encoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessi Encoding-1 dup 8#41 /copyright put dup 8#42 /registered put dup 8#43 /trademark put dup 8#44 /logicalnot put dup 8#45 /Eth put dup 8#46 /eth put dup 8#47 /Thorn put dup 8#50 /thorn put dup 8#51 /brokenbar put dup 8#52 /degree put dup 8#53 /divide put dup 8#54 /multiply put dup 8#55 /minus put dup 8#56 /onehalf put dup 8#57 /onequarter put dup 8#60 /threequarters put dup 8#101 /Aacute put dup 8#102 /Acircumflex put dup 8#103 /Adieresis put dup 8#104 /Agrave put dup 8#105 /Aring put dup 8#106 /Atilde put dup 8#107 /Ccedilla put dup 8#110 /Eacute put dup 8#111 /Ecircumflex put dup 8#112 /Edieresis put dup 8#113 /Egrave put dup 8#114 /Iacute put dup 8#115 /Icircumflex put dup 8#116 /Idieresis put dup 8#117 /Igrave put dup 8#120 /Ntilde put dup 8#121 /Oacute put dup 8#122 /Ocircumflex put dup 8#123 /Odieresis put dup 8#124 /Ograve put dup 8#125 /Otilde put dup 8#126 /Scaron put dup 8#127 /Uacute put dup 8#130 /Ucircumflex put dup 8#131 /Udieresis put dup 8#132 /Ugrave put dup 8#133 /Ydieresis put dup 8#134 /Zcaron put dup 8#135 /aacute put dup 8#136 /acircumflex put dup 8#137 /adieresis put dup 8#140 /agrave put dup 8#141 /aring put dup 8#142 /atilde put dup 8#143 /ccedilla put dup 8#144 /eacute put dup 8#145 /ecircumflex put dup 8#146 /edieresis put dup 8#147 /egrave put dup 8#150 /iacute put dup 8#151 /icircumflex put dup 8#152 /idieresis put dup 8#153 /igrave put dup 8#154 /ntilde put dup 8#155 /oacute put dup 8#156 /ocircumflex put dup 8#157 /odieresis put dup 8#160 /ograve put dup 8#161 /otilde put dup 8#162 /scaron put dup 8#163 /uacute put dup 8#164 /ucircumflex put dup 8#165 /udieresis put dup 8#166 /ugrave put dup 8#167 /ydieresis put dup 8#170 /zcaron put pop /Enc-dict 30 dict def Enc-dict /tmpstr1 50 string put Enc-dict /tmpstr2 50 string put Enc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put /AEnc-def { % arguments: the original font's name, encoding nr Enc-dict begin tmpstr2 cvs /Enc-no exch def % Remember the number in a string dup /OrigName exch def % remember the name findfont dup maxlength dict /newdict exch def % get dictionary for new font { exch dup /FID ne { exch newdict 3 1 roll put } { pop pop } % Ignore FID ifelse } forall newdict begin /Encoding tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval cvn load def % Replace encoding currentdict /UniqueID known { /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueID end % newdict /FNlength OrigName tmpstr1 cvs length def % convert name, remember length FNlength 1 add Enc-no length add string dup 0 OrigName tmpstr1 cvs putinterval dup FNlength (-) putinterval dup FNlength 1 add Enc-no putinterval dup 0 tmpstr1 0 FNlength getinterval putinterval % Add old name cvn dup newdict /FontName 3 2 roll put newdict definefont end % Enc-dict } def /Times-Roman 1 AEnc-def pop /R-1{/Times-Roman-1 FF}def /R{/Times-Roman FF}def /B{/Times-Bold FF}def /I{/Times-Italic FF}def %%EndProlog %%Page: 1 1 BP /slant 0 def /height 0 def 480 V 10 R 720(GETPWENT)S 1273(\()S 1315(3)S 1373(\))S 2696(Eighth)S (Edition)296 2989 A 4574(GETPWENT)S 5127(\()S 5169(3)S 5227(\))S 960 V 9 R 720(N)S 722(NA)S 790(AM)S 858(ME)S 940(E)S 1080 V 10 R 1080(getpwent,)S 1499(getpwnam,)S 1968(getpwuid,)S 2392(setpwent,)S (endpwent,)416 2800 A 3241(setpw\256le)S 10 R-1 3630(-)S 10 R 3712(password)S 4117(\256le)S 4271(routines)S 1248 V 9 R 720(S)S 722(SY)S 774(YN)S 842(NO)S 910(OP)S 978(PS)S 1030(SI)S 1082(IS)S 1115(S)S 1368 V 10 B 1080(#include)S 1482()S 1608 V 1080(struct)S 1371(passwd)S 1722(*getpwent\(void\))S 1728 V 1080(struct)S 1371(passwd)S 1722(*getpwnam\(const)S 2516(char)S 2750(*)S 10 I 2800(name)S 10 B 3018(\))S 1848 V 1080(struct)S 1371(passwd)S 1722(*getpwuid\(uid_t)S 10 I 2466(uid)S 10 B 2594(\))S 1968 V 1080(int)S 1236(setpwent\(void\))S 2088 V 1080(void)S (endpwent\(void\))673 1302 A 2208 V 1080(void)S 1302(setpw\256le\(const)S 1974(char)S 2208(*)S 10 I 2258(\256le)S 10 B 2381(\))S 2376 V 9 R 720(D)S 722(DE)S 790(ES)S 848(SC)S 900(CR)S 962(RI)S 1024(IP)S 1057(PT)S 1109(TI)S 1167(IO)S 1200(ON)S 1268(N)S 2496 V 10 R 1080(These)S 1349(functions)S 1751(are)S 1903(used)S 2115(to)S 2221(obtain)S 2501(information)S 3005(from)S 3230(the)S 3382(password)S 3791(\256le.)S 3999(They)S 4235(return)S 4505(this)S 4679(information)S 5183(in)S 2616 V 1080(a)S 10 B 1150(struct)S 1428(passwd)S 10 R 1766(as)S 1875(de\256ned)S 2196(by)S 2321(:)S 2784 V 1080(struct)S 1329(passwd)S 1650({)S 2904 V 1280(char)S 1580(*pw_name;)S 2330(/*)S 2433(login)S 2664(name)S 2907(*/)S 3024 V 1280(char)S 1580(*pw_passwd;)S 2330(/*)S 2433(encrypted)S 2855(password)S 3260(*/)S 3144 V 1280(uid_t)S 1580(pw_uid;)S 2330(/*)S 2433(numeric)S 2788(user)S 2981(id)S 3084(*/)S 3264 V 1280(gid_t)S 1580(pw_gid;)S 2330(/*)S 2433(numeric)S (group)234 2788 A 3047(id)S 3150(*/)S 3384 V 1280(char)S 1580(*pw_gecos;)S 2330(/*)S 2433(user)S 2626(full)S 2791(name)S 3034(and)S 3204(other)S 3436(info)S 3623(*/)S 3504 V 1280(char)S 1580(*pw_dir;)S 2330(/*)S 2433(user's)S 2699(home)S 2947(directory)S 3336(*/)S 3624 V 1280(char)S (*pw_shell;)441 1580 A 2330(/*)S 2433(name)S 2676(of)S 2785(the)S 2933(user's)S 3199(shell)S 3414(*/)S 3744 V 1080(};)S 3912 V 10 B (Getpwent\(\))489 1080 A 10 R 1596(reads)S 1836(the)S 1987(password)S 2395(\256le)S 2552(entry)S 2787(by)S 2915(entry.)S 10 B 3200(Getpwnam\(\))S 10 R 3772(scans)S 4018(the)S 4169(entire)S 4427(password)S 4835(\256le)S 4992(for)S 5138(the)S 4032 V 1080(user)S 1276(with)S 1483(the)S 1634(given)S 10 I 1885(name)S 10 R 2111(.)S 10 B 2189(Getpwuid\(\))S 10 R (looks)217 2711 A 2956(for)S 3102(the)S 3253(\256rst)S 3438(user)S 3634(with)S 3841(the)S 3992(given)S 10 I 4242(uid)S 10 R 4378(.)S 4455(The)S 10 B (setpwent\(\))450 4639 A 10 R 5116(and)S 4152 V 10 B (endpwent\(\))489 1080 A 10 R 1608(functions)S 2021(are)S 2184(used)S 2407(to)S 2524(open)S 2758(and)S 2942(later)S 3162(close)S 3409(the)S 3572(password)S 3992(\256le.)S 4211(With)S 10 B 4452(setpw\256le\(\))S 10 R 4936(one)S 5121(can)S 4272 V 1080(specify)S 1423(the)S 1598(\256le)S 1778(to)S 1907(read)S 2132(other)S 2390(than)S 2614(the)S 2788(normal)S 3124(password)S 3555(\256le.)S 3785(This)S 4015(only)S 4244(sets)S 4446(the)S 4620(name,)S 4914(the)S 5088(next)S 4392 V 10 B (setpwent\(\))450 1080 A 10 R 1557(call)S (will)157 1730 A 1914(open)S 2136(the)S 2286(\256le.)S 2492(Do)S 2642(not)S 2797(touch)S 3048(the)S 3199(\256le)S 3356(name)S 3602(while)S 3854(it)S 3938(is)S 4033(active.)S 4352(Use)S 10 B 4537(setpw\256le\(NULL\))S 4512 V 10 R 1080(to)S 1183(revert)S 1444(back)S 1659(to)S 1762(the)S 1910(normal)S 2220(password)S 2625(\256le.)S 4680 V 1080(The)S 1262(usual)S 1499(way)S 1692(to)S 1795(scan)S 1999(the)S 2147(password)S 2552(\256le)S 2706(is)S 2798(\(error)S 3054(checking)S (omitted\):)369 3442 A 4848 V 1440(setpwent\(\);)S 4968 V 1440(while)S 1689(\(\(pw)S 1905(=)S (getpwent\(\)\))471 1987 A 2483(!=)S 2599(NULL\))S 5088 V 1800(if)S 1887(\(appropriate_test\(pw\)\))S 2820(break;)S 5208 V (endpwent\(\);)487 1440 A 5376 V 1080(The)S 10 B 1276(pw)S 10 R 1444(variable)S 1808(contains)S 2182(the)S 2344(entry)S 2590(that)S 2780(is)S 2886(wanted)S 3216(if)S (non-NULL.)479 3317 A 3860(The)S 10 B 4056(getpwnam\(\))S 10 R 4611(and)S 10 B 4795(getpwuid\(\))S 5496 V 10 R 1080(functions)S 1479(are)S 1628(implemented)S 2178(as)S 2287(in)S 2390(this)S 2560(example,)S 2951(with)S 3155(error)S 3377(checking)S 3765(of)S 3874(course.)S 5664 V 10 B (Getpwent\(\))489 1080 A 10 R 1605(calls)S 10 B (setpwent\(\))450 1826 A 10 R 2312(if)S 2410(this)S 2591(has)S 2761(not)S 2925(yet)S 3084(been)S (done.)220 3311 A 10 B (Setpwent\(\))467 3593 A 10 R 4097(\256rst)S 4291(calls)S 10 B (endpwent\(\))489 4513 A 10 R 5039(if)S 5138(the)S 5784 V 1080(password)S 1485(\256le)S 1639(is)S (still)151 1731 A 1907(open.)S 2177(\(Other)S 2466(implementations)S 3161(may)S 3359(simply)S 3657(rewind)S 3962(the)S 4110(\256le.\))S 5952 V 9 R 720(F)S 722(FI)S 774(IL)S 807(LE)S 865(ES)S 923(S)S 6072 V 10 B 1080(/etc/passwd)S 10 R 1830(The)S 2012(password)S 2417(\256le)S 2571(database.)S 6240 V 9 R 720(S)S 722(SE)S 774(EE)S 832(E)S 913(A)S 915(AL)S 983(LS)S 1041(SO)S 1093(O)S 6360 V 10 B 1080(cuserid)S 10 R 1394(\(3\),)S 10 B 1562(getlogin)S 10 R 1903(\(3\),)S 10 B 2071(getgrent)S 10 R 2430(\(3\),)S 10 B 2598(passwd)S 10 R 2911(\(5\).)S 6528 V 9 R 720(D)S 722(DI)S 790(IA)S 823(AG)S 891(GN)S 959(NO)S 1027(OS)S 1095(ST)S 1147(TI)S 1205(IC)S 1238(CS)S 1300(S)S 6648 V 10 B (Setpwent\(\))467 1080 A 10 R 1576(has)S 1739(the)S 1891(same)S 2128(return)S 2399(value)S 2647(and)S 2822(error)S 3049(codes)S 3308(as)S 3422(the)S 10 B 3575(open)S 10 R 3782(\(2\))S 3930(call)S 4106(it)S 4192(uses)S 4395(to)S 4503(open)S 4728(the)S 4881(password)S 6768 V 1080(\256le.)S 1290(The)S 10 B 1478(get)S 10 I (xxx)135 1607 A 10 B 1750(\(\))S 10 R 1849(functions)S 2254(return)S 2526(NULL)S 2827(on)S 2957(end)S 3132(of)S 3246(\256le,)S 3430(entry)S 3667(not)S (found,)259 3825 A 4114(or)S 4228(error.)S 4505(You)S 4708(can)S 4878(set)S 10 B (errno)241 5020 A 6888 V 10 R 1080(to)S 1183(zero)S 1382(before)S 1665(the)S 1813(call)S 1984(and)S 2154(check)S 2414(it)S 2495(after.)S 7056 V 9 R 720(N)S 722(NO)S 790(OT)S 858(TE)S 916(ES)S 974(S)S 7176 V 10 R 1080(All)S 10 B 1234(get)S 10 I (xxx)135 1363 A 10 B 1506(\(\))S 10 R 1599(routines)S 1948(return)S 2214(a)S 2284(pointer)S 2594(to)S 2697(static)S 2935(storage)S 3251(that)S 3427(is)S (overwritten)465 3519 A 4009(in)S (each)185 4112 A 4322(call.)S 7344 V 1080(Only)S 10 B 1324(getpwnam\(\))S 10 R 1883(and)S 10 B 2071(getpwuid\(\))S 10 R 2580(are)S 2747(de\256ned)S 3086(by)S 8 R 3224(POSIX)S 10 R 3457(.)S 3550(The)S 10 B (_MINIX_SOURCE)839 3750 A 10 R 4632(macro)S 4927(must)S 5166(be)S 7464 V 1080(de\256ned)S 1405(before)S 1692(including)S 2099()S 2489(to)S 2595(make)S 2841(the)S 2992(other)S 3227(functions)S 3629(visible.)S 3975(The)S 10 B 4160(pw_passwd)S 10 R 4680(and)S 10 B 4853(pw_gecos)S 7903 V 10 R 720(Page)S 941(1)S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Page: 2 2 BP /slant 0 def /height 0 def 480 V 10 R 720(GETPWENT)S 1273(\()S 1315(3)S 1373(\))S 2696(Eighth)S (Edition)296 2989 A 4574(GETPWENT)S 5127(\()S 5169(3)S 5227(\))S 960 V 1080(\256elds)S 1327(are)S 1480(also)S 1671(not)S 1828(de\256ned)S 2153(by)S 8 R 2277(POSIX)S 10 R 2510(,)S 2564(but)S 2721(are)S 2874(always)S 3184(visible.)S 3532(Portable)S 3898(code)S (cannot)268 4118 A 4416(reliably)S 4754(detect)S 5025(errors)S 1080 V 1080(by)S (setting)268 1215 A 10 B (errno)241 1517 A 10 R 1792(to)S 1904(zero.)S 2162(Under)S 2448(Minix)S 2727(it)S 2817(is)S 2918(better)S 3182(to)S 3294(make)S 3546(a)S 10 B (getpwent\(\))461 3625 A 10 R 4120(scan)S 4333(if)S (you)150 4429 A 4613(need)S 4837(to)S (look)178 4949 A 5161(up)S 1200 V 1080(several)S 1398(user-id's)S 1783(or)S 1899(names,)S 2213(but)S 2373(portable)S 2736(code)S 2959(had)S 3137(better)S 3400(use)S 3567(several)S 10 B 3886(getpwuid\(\))S 10 R 4385(or)S 10 B 4502(getpwnam\(\))S 10 R 5051(calls.)S 1320 V 1080(The)S 10 B (getpwent\(\))461 1262 A 10 R 1748(is)S 1840(usually)S 2155(available)S 2544(on)S 2669(other)S 2901(systems,)S 3269(but)S 3422(may)S 3620(be)S 3740(very)S 3944(expensive.)S 1488 V 9 R 720(A)S 722(AU)S 790(UT)S 858(TH)S 916(HO)S 984(OR)S 1052(R)S 1608 V 10 R 1080(Kees)S 1307(J.)S 1396(Bot)S 1566(\(kjb@cs.vu.nl\))S 7903 V 720(September)S 1176(13,)S (1996)200 1326 A 4990(Page)S 5211(2)S 8143 V EP %%Trailer %%DocumentFonts: Times-Roman Times-Bold Times-Italic %%Pages: 2