%!PS-Adobe-3.0 %%Creator: groff version 1.19.2 %%CreationDate: Wed Jun 30 11:55:52 2010 %%DocumentNeededResources: font Times-Roman %%DocumentSuppliedResources: procset grops 1.19 2 %%Pages: 63 %%PageOrder: Ascend %%DocumentMedia: Default 612 792 0 () () %%Orientation: Portrait %%EndComments %%BeginDefaults %%PageMedia: Default %%EndDefaults %%BeginProlog %%BeginResource: procset grops 1.19 2 %!PS-Adobe-3.0 Resource-ProcSet /setpacking where{ pop currentpacking true setpacking }if /grops 120 dict dup begin /SC 32 def /A/show load def /B{0 SC 3 -1 roll widthshow}bind def /C{0 exch ashow}bind def /D{0 exch 0 SC 5 2 roll awidthshow}bind def /E{0 rmoveto show}bind def /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def /G{0 rmoveto 0 exch ashow}bind def /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /I{0 exch rmoveto show}bind def /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def /K{0 exch rmoveto 0 exch ashow}bind def /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /M{rmoveto show}bind def /N{rmoveto 0 SC 3 -1 roll widthshow}bind def /O{rmoveto 0 exch ashow}bind def /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /Q{moveto show}bind def /R{moveto 0 SC 3 -1 roll widthshow}bind def /S{moveto 0 exch ashow}bind def /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def /SF{ findfont exch [exch dup 0 exch 0 exch neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /MF{ findfont [5 2 roll 0 3 1 roll neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /level0 0 def /RES 0 def /PL 0 def /LS 0 def /MANUAL{ statusdict begin/manualfeed true store end }bind def /PLG{ gsave newpath clippath pathbbox grestore exch pop add exch pop }bind def /BP{ /level0 save def 1 setlinecap 1 setlinejoin 72 RES div dup scale LS{ 90 rotate }{ 0 PL translate }ifelse 1 -1 scale }bind def /EP{ level0 restore showpage }def /DA{ newpath arcn stroke }bind def /SN{ transform .25 sub exch .25 sub exch round .25 add exch round .25 add exch itransform }bind def /DL{ SN moveto SN lineto stroke }bind def /DC{ newpath 0 360 arc closepath }bind def /TM matrix def /DE{ TM currentmatrix pop translate scale newpath 0 0 .5 0 360 arc closepath TM setmatrix }bind def /RC/rcurveto load def /RL/rlineto load def /ST/stroke load def /MT/moveto load def /CL/closepath load def /Fr{ setrgbcolor fill }bind def /setcmykcolor where{ pop /Fk{ setcmykcolor fill }bind def }if /Fg{ setgray fill }bind def /FL/fill load def /LW/setlinewidth load def /Cr/setrgbcolor load def /setcmykcolor where{ pop /Ck/setcmykcolor load def }if /Cg/setgray load def /RE{ findfont dup maxlength 1 index/FontName known not{1 add}if dict begin { 1 index/FID ne{def}{pop pop}ifelse }forall /Encoding exch def dup/FontName exch def currentdict end definefont pop }bind def /DEFS 0 def /EBEGIN{ moveto DEFS begin }bind def /EEND/end load def /CNT 0 def /level1 0 def /PBEGIN{ /level1 save def translate div 3 1 roll div exch scale neg exch neg exch translate 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit []0 setdash /setstrokeadjust where{ pop false setstrokeadjust }if /setoverprint where{ pop false setoverprint }if newpath /CNT countdictstack def userdict begin /showpage{}def /setpagedevice{}def }bind def /PEND{ countdictstack CNT sub{end}repeat level1 restore }bind def end def /setpacking where{ pop setpacking }if %%EndResource %%EndProlog %%BeginSetup %%BeginFeature: *PageSize Default << /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice %%EndFeature %%IncludeResource: font Times-Roman grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron /scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen /period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon /semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O /P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex /underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y /z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft /guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl /endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen /brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft /logicalnot/minus/registered/macron/degree/plusminus/twosuperior /threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior /ordmasculine/guilsinglright/onequarter/onehalf/threequarters /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn /germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash /ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def /Times-Roman@0 ENC0/Times-Roman RE %%EndSetup %%Page: 1 1 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF()0 12 Q(
)0 24 Q(
struct
archi)0 12 Q -.15(ve)
-.25 G(
*
).15 E(archi)0 24 Q -.15(ve)-.25 G
(_write_disk_ne).15 E(w\(
v)-.25 E(oid
\))
-.2 E(
int
)0 36 Q(archi)0 48 Q -.15
(ve)-.25 G(_write_disk_set_options\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
, int \215ags
\)).15 E
(
int
)0 60 Q(archi)0 72 Q -.15(ve)
-.25 G(_write_disk_set_skip_\214le\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
, de).15 E
(v_t
, ino_t
\))-.25 E 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
int
)0 12 Q
(archi)0 24 Q -.15(ve)-.25 G
(_write_disk_set_group_lookup\(
).15 E
(
struct archi)0 36 Q .3 -.15(ve *)-.25 H(
).15
E(
v)0 48 Q(oid *
)-.2 E
(
gid_t \(*\)\(v)0 60 Q
(oid *, const char *gname, gid_t gid\))-.2 E(
v)0 72 Q
(oid \(*cleanup\)\(v)-.2 E(oid *\)
)-.2 E 0 Cg EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(\))0 12 Q(
int
)
0 24 Q(archi)0 36 Q -.15(ve)-.25 G
(_write_disk_set_standard_lookup\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G(_write_disk_set_user_lookup\(
).15 E
(
struct archi)0 72 Q .3 -.15(ve *)-.25 H(
).15
E 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
v)0 12 Q(oid *
)-.2 E
(
uid_t \(*\)\(v)0 24 Q
(oid *, const char *uname, uid_t uid\))-.2 E(
v)0 36 Q
(oid \(*cleanup\)\(v)-.2 E(oid *\)
)-.2 E(\))0 48 Q
(
int
)0 60 Q(archi)0 72 Q -.15(ve)
-.25 G(_write_header\(
struct archi).15 E .3 -.15
(ve *)-.25 H(
, struct archi).15 E -.15(ve)-.25 G
(_entry *
\)).15 E 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
ssize_t
)0 12 Q
(archi)0 24 Q -.15(ve)-.25 G
(_write_data\(
struct archi).15 E .3 -.15(ve *)
-.25 H(
, const v).15 E(oid *
, size_t
\))
-.2 E(
int
)0 36 Q(archi)0 48 Q -.15
(ve)-.25 G(_write_\214nish_entry\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 60 Q(archi)0 72 Q -.15(ve)
-.25 G(_write_close\(
struct archi).15 E .3 -.15
(ve *)-.25 H(
\)).15 E 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
int
)0 12 Q
(archi)0 24 Q -.15(ve)-.25 G
(_write_\214nish\(
struct archi).15 E .3 -.15
(ve *)-.25 H(
\)).15 E(
\)).15 E 0 Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(interf)0 12 Q(ace.)-.1 E
(The general process is to read)0 24 Q(struct archi)0 36 Q -.15(ve)-.25 G
(_entry).15 E(objects from an archi)0 48 Q -.15(ve)-.25 G 2.5(,t)
.15 G(hen write those objects to a)-2.5 E(struct archi)0 60 Q -.15(ve)-.25 G
().15 E(object created using the)0 72 Q 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_disk\(
\)).15 E -.1(fa)0 24 S(mily functions.).1
E(This interf)0 36 Q(ace is deliberately v)-.1 E(ery similar to the)-.15
E(archi)0 48 Q -.15(ve)-.25 G(_write\(
\)).15 E
(interf)0 60 Q(ace used to write objects to a streaming archi)-.1 E -.15
(ve)-.25 G(.).15 E(
\)
\)
\)
..
)0 48
Q(element an)0 60 Q(ywhere within it.)-.15 E(The def)0 72 Q
(ault is to not refuse such paths.)-.1 E 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(Note that paths ending in)0 12 Q
(
..
)0 24 Q(al)0 36 Q -.1(wa)-.1 G
(ys cause an error).1 E 2.5(,r)-.4 G -2.25 -.15(eg a)-2.5 H
(rdless of this \215ag.).15 E(
\),).15 E(archi)0 60
Q -.15(ve)-.25 G(_write_disk_set_user_lookup\(
\)).15 E
(The)0 72 Q 0 Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(struct\
font> archi)0 12 Q -.15(ve)-.25 G(_entry).15 E
(objects contain both names and ids that can be used to identify users)0
24 Q(and groups.)0 36 Q(These names and ids describe the o)0 48 Q
(wnership of the \214le itself and)-.25 E(also appear in A)0 60 Q
(CL lists.)-.4 E(By def)0 72 Q
(ault, the library uses the ids and ignores the names, b)-.1 E(ut)-.2 E
0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(this can be o)0 12 Q -.15(ve)-.15 G
(rridden by re).15 E(gistering user and group lookup functions.)-.15 E
1.6 -.8(To r)0 24 T -.15(eg).8 G(ister).15 E 2.5(,y)-.4 G(ou must pro)
-2.5 E(vide a lookup function which)-.15 E
(accepts both a name and id and returns a suitable id.)0 36 Q -1.1(Yo)0
48 S 2.5(um)1.1 G(ay also pro)-2.5 E(vide a)-.15 E
(v)0 60 Q
(oid *)-.2 E(pointer to a pri)0 72 Q -.25
(va)-.25 G(te data structure and a cleanup function for).25 E 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(that data.)0 12 Q
(The cleanup function will be in)0 24 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw)
.1 G(hen the)-2.5 E(struct archi)0 36 Q -.15(ve)-.25 G().15 E
(object is destro)0 48 Q(yed.)-.1 E(
\)
\)
\)
\)
\))-.15 E(and)0 72 Q 0 Cg
EP
%%Page: 38 38
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_close\(
\)).15 E(as needed.)0 24 Q
(
\)
\)
\)).15 E(if it w)0 48 Q(as not in)-.1 E
-.2(vo)-.4 G -.1(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G
(hen releases all resources.)-2.5 E(
\)).15 E(and)0 60 Q(archi)0 72 Q
-.15(ve)-.25 G(_error_string\(
\)).15 E 0 Cg EP
%%Page: 45 45
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(functions can be used to retrie)0 12 Q .3 -.15
(ve a)-.25 H 2.5(na).15 G(ppropriate error code and a)-2.5 E(te)0 24 Q
(xtual error message.)-.15 E()36 36 Q(archi)0 48 Q -.15(ve)-.25 G
(_write_disk_ne).15 E(w\(\))-.25 E
(returns a pointer to a ne)0 60 Q(wly-allocated)-.25 E(\
struct archi)0 72 Q -.15
(ve)-.25 G().15 E 0 Cg EP
%%Page: 46 46
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(object.)0 12 Q(
)36 24 Q(archi)0 36 Q -.15
(ve)-.25 G(_write_data\(\)).15 E
(returns a count of the number of bytes actually written.)0 48 Q
(On error)0 60 Q 2.5(,-)-.4 G 2.5(1i)-2.5 G 2.5(sr)-2.5 G
(eturned and the)-2.5 E(archi)0 72 Q -.15(ve)-.25 G
(_errno\(
\)).15 E 0 Cg EP
%%Page: 47 47
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(and)0 12 Q(archi)0 24 Q -.15(ve)-.25 G
(_error_string\(
\)).15 E
(functions will return appropriate v)0 36 Q(alues.)-.25 E
(
)36 36 Q(The)0 48 Q(libarchi)0 60 Q -.15(ve)-.25 G().15 E(library w)0 72 Q(as written by)-.1 E 0 Cg EP %%Page: 52 52 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF -.35(Ti)0 12 S 2.5(mK).35 G (ientzle <kientzle@acm.or)-2.5 E(g>.)-.18 E(
\),).15 E -.2(bu)0 24 S 2.5<748c>.2 G
(nal permissions are not set until)-2.5 E(archi)0 36 Q -.15(ve)-.25 G
(_write_close\(
\).).15 E
(This separation is necessary to correctly handle borderline)0 48 Q
(cases such as a non-writable directory containing)0 60 Q(\214les, b)0
72 Q(ut can cause une)-.2 E(xpected results.)-.15 E 0 Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(In particular)0 12 Q 2.5(,d)-.4 G
(irectory permissions are not fully)-2.5 E(restored until the archi)0 24
Q .3 -.15(ve i)-.25 H 2.5(sc).15 G(losed.)-2.5 E(If you use)0 36 Q
(chdir\(2\))-.55 E
(to change the current directory between calls to)0 60 Q(archi)0 72 Q
-.15(ve)-.25 G(_read_e).15 E(xtract\(
\))-.15 E 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(or before calling)0 12 Q(archi)0 24 Q -.15
(ve)-.25 G(_read_close\(
\),).15 E
(you may confuse the permission-setting logic with)0 36 Q
(the result that directory permissions are restored)0 48 Q(incorrectly)0
60 Q(.)-.65 E()36 72 Q 0 Cg EP %%Page: 56 56 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF (The library attempts to create objects with \214lenames longer than)0 12 Q(P)0 24 Q -1.11(AT)-.92 G(H_MAX)1.11 E (by creating pre\214x)0 36 Q (es of the full path and changing the current directory)-.15 E(.)-.65 E (Currently)0 48 Q 2.5(,t)-.65 G (his logic is limited in scope; the \214xup pass does)-2.5 E(not w)0 60 Q(ork correctly for such objects and the symlink security check)-.1 E (option disables the support for v)0 72 Q(ery long pathnames.)-.15 E 0 Cg EP %%Page: 57 57 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(
)36 12 Q(Restoring the path)0 24 Q
(aa/../bb
)0 36 Q
(does create each intermediate directory)0 48 Q(.)-.65 E(In particular)0
60 Q 2.5(,t)-.4 G(he directory)-2.5 E(aa
)0 72
Q 0 Cg EP
%%Page: 58 58
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(is created as well as the \214nal object)0 12 Q
(bb
.)0 24 Q(In theory)0 36 Q 2.5(,t)-.65 G
(his can be e)-2.5 E(xploited to create an entire directory heirarch)
-.15 E(y)-.05 E(with a single request.)0 48 Q
(Of course, this does not w)0 60 Q(ork if the)-.1 E
(ARCHIVE_EXTRA)0 72 Q(CT_NODO)-.4 E(TDO)-.4 E(T)-.4 E 0 Cg
EP
%%Page: 59 59
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(option is speci\214ed.)0 12 Q(
)36 24 Q (Implicit directories are al)0 36 Q -.1(wa)-.1 G(ys created obe).1 E (ying the current umask.)-.15 E(Explicit objects are created obe)0 48 Q (ying the current umask unless)-.15 E(ARCHIVE_EXTRA)0 60 Q (CT_PERM)-.4 E(is speci\214ed, in which case the)0 72 Q 2.5(yc)-.15 G(urrent umask is ignored.)-2.5 E 0 Cg EP %%Page: 60 60 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(
)36 12 Q (SGID and SUID bits are restored only if the correct user and)0 24 Q (group could be set.)0 36 Q(If)0 48 Q(ARCHIVE_EXTRA)0 60 Q (CT_O)-.4 E(WNER)-.35 E (is not speci\214ed, then no attempt is made to set the o)0 72 Q (wnership.)-.25 E 0 Cg EP %%Page: 61 61 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF (In this case, SGID and SUID bits are restored only if the)0 12 Q (user and group of the \214nal object happen to match those speci\214ed) 0 24 Q(in the entry)0 36 Q(.)-.65 E(
)36 48 Q(The)0 60 Q -.74(``)0 72 S(standard').74 E(')-.74 E 0 Cg EP %%Page: 62 62 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(user)0 12 Q (-id and group-id lookup functions are not the def)-.2 E(aults because) -.1 E(getgrnam\(3\))0 24 Q(and)0 36 Q(getpwnam\(3\))0 48 Q (are sometimes too lar)0 60 Q(ge for particular applications.)-.18 E (The current design allo)0 72 Q(ws the application author to use a more) -.25 E 0 Cg EP %%Page: 63 63 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(compact implementation when appropriate.)0 12 Q (
)36 24 Q(There should be a corresponding)0 36 Q(archi)0 48 Q -.15 (ve)-.25 G(_read_disk).15 E(interf)0 60 Q(ace that w)-.1 E (alks a directory heirarch)-.1 E 2.5(ya)-.05 G(nd returns archi)-2.5 E -.15(ve)-.25 G(entry objects.)0 72 Q 0 Cg EP %%Trailer end %%EOF