DIRECTORY CrRPC USING [Handle], IO USING [STREAM], PFS USING [FileType, Mutability, nullUniqueID, tUnspecified, UniqueID], PFSClass USING [AttachProc, CloseProc, CopyProc, DeleteProc, EnumerateClientPropertiesProc, EnumerateForInfoProc, EnumerateForNamesProc, FileInfoProc, FileManipulationProcs, FileManipulationProcsObject, FSHandle, FSObject, GetClientPropertyProc, GetHandleProc, GetInfoProc, LookupNameProc, MaintenanceProcs, MaintenanceProcsObject, OpenFile, OpenProc, ReadProc, Register, RenameProc, RetrieveProc, SetAttributesProc, SetByteCountAndUniqueIDProc, SetClientPropertyProc, StoreProc, SweepProc, ValidateProc, WriteProc], PFSNames USING [PATH], Rope USING [ROPE]; XNSViewImpl: CEDAR MONITOR LOCKS tr USING tr: Transport IMPORTS PFSClass ~ { ROPE: TYPE ~ Rope.ROPE; Transport: TYPE ~ REF TransportBody; TransportBody: TYPE ~ MONITORED RECORD [ crH: CrRPC.Handle, mnt: REF ]; TransportProc: TYPE ~ PROC [tr: Transport]; CallProtected: PROC [mnt: REF, inner: TransportProc] ~ { crH: CrRPC.Handle ~ NIL; link: Transport ~ NEW[TransportBody]; UnderLock: ENTRY TransportProc ~ { ENABLE UNWIND => { NULL }; inner[tr]; }; link.crH ¬ crH; link.mnt ¬ mnt; UnderLock[link]; }; xnsFlavor: ATOM ~ $XNS; VFS: TYPE ~ REF VFSInstance; VFSInstance: TYPE ~ RECORD [ fs: ROPE, flavorSpecified: BOOL ]; GetHandle: PFSClass.GetHandleProc ~ { instance: VFS ~ NEW[VFSInstance ¬ [fs: fs, flavorSpecified: flavorSpecified] ]; downMsg ¬ NIL; h ¬ NEW[PFSClass.FSObject ¬ vfs­]; h.data ¬ instance; }; vfs: PFSClass.FSHandle ~ NEW [PFSClass.FSObject ¬ [ flavor: xnsFlavor, name: NIL, -- filled in upon instantiation maintenanceProcs: mo, procs: fmo, data: NIL -- filled in upon instantiation ]]; mo: PFSClass.MaintenanceProcs ~ NEW [PFSClass.MaintenanceProcsObject ¬ [ sweep: Sweep, validate: Validate ]]; Sweep: PFSClass.SweepProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; NULL; }; Validate: PFSClass.ValidateProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; obsolete ¬ FALSE; downMsg ¬ NIL; IF ( FALSE ) THEN { obsolete ¬ TRUE; downMsg ¬ NIL }; IF ( FALSE ) THEN { obsolete ¬ FALSE; downMsg ¬ "downMsg" }; }; fmo: PFSClass.FileManipulationProcs ~ NEW[PFSClass.FileManipulationProcsObject ¬ [ delete: Delete, enumerateForInfo: EnumerateForInfo, enumerateForNames: EnumerateForNames, fileInfo: FileInfo, lookupName: Lookup, rename: Rename, copy: Copy, setAttributes: SetAttributes, setByteCountAndUniqueID: SetByteCountAndUniqueID, setClientProperty: SetClientProperty, getClientProperty: GetClientProperty, enumerateClientProperties: EnumerateClientProperties, read: Read, write: Write, open: Open, close: Close, store: Store, retrieve: Retrieve, attach: Attach, getInfo: GetInfo ]]; XNSDelete: PROC ~ { << fileH: FilingP10V5.Handle; withKids: BOOL; [fileH: fileH, withKids: withKids] ¬ FindFile[mnt, crH, file, wantedUniqueID, $delete]; IF ( withKids ) THEN { ENABLE UNWIND => { mnt.session.verifier ¬ XNSAuth.GetNextVerifier[mnt.conversation]; FilingP10V5.Close[h: crH, file: fileH, session: mnt.session­]; }; xx: ROPE ~ IO.PutFR["Directory %g has children", IO.rope[file] ]; PFSBackdoor.ProduceError[accessDenied, xx] }; { delete: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[fullName, uniqueID]; IF ( delete ) THEN { mnt.session.verifier ¬ XNSAuth.GetNextVerifier[mnt.conversation]; FilingP10V5.Delete[h: crH, file: fileH, session: mnt.session­]; }; }; mnt.active ¬ FALSE; ReturnConnection[crH]; >> }; Delete: PFSClass.DeleteProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; DeleteInner: TransportProc ~ { ENABLE UNWIND => { NULL }; fullName: PFSNames.PATH ¬ NIL; uniqueID: PFS.UniqueID ¬ PFS.nullUniqueID; continue: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[fullName, uniqueID]; }; CallProtected[mnt, DeleteInner]; }; XNSEnumerateForInfo: PROC ~ { << P: PROC [file: ROPE, bytes: INT, created: BasicTime.GMT, fileType: FileType, version: Version, fID: FileID, isDir: BOOL, withKids: BOOL, pathName: REF TEXT] RETURNS [continue: BOOL] = { continue ¬ proc[file, bytes, created, fileType]; }; InnerEnumerate[h, pattern, FALSE, P, $enumerate]; >> }; EnumerateForInfo: PFSClass.EnumerateForInfoProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; EnumerateForInfoInner: TransportProc ~ { ENABLE UNWIND => { NULL }; fullFName: PFSNames.PATH ¬ NIL; attachedTo: PFSNames.PATH ¬ NIL; uniqueID: PFS.UniqueID ¬ PFS.nullUniqueID; bytes: INT ¬ 0; mutability: PFS.Mutability ¬ immutable; fileType: PFS.FileType ¬ PFS.tUnspecified; continue: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[fullFName, attachedTo, uniqueID, bytes, mutability, fileType]; }; CallProtected[mnt, EnumerateForInfoInner]; }; EnumerateForNames: PFSClass.EnumerateForNamesProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; EnumerateForNamesInner: TransportProc ~ { ENABLE UNWIND => { NULL }; name: PFSNames.PATH; continue: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[name]; }; CallProtected[mnt, EnumerateForNamesInner]; }; FileInfo: PFSClass.FileInfoProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; FileInfoInner: TransportProc ~ { ENABLE UNWIND => { NULL }; version ¬ [none]; attachedTo ¬ NIL; bytes ¬ 0; uniqueID ¬ PFS.nullUniqueID; mutability ¬ immutable; fileType ¬ PFS.tUnspecified; }; CallProtected[mnt, FileInfoInner]; }; Lookup: PFSClass.LookupNameProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; path: PFSNames.PATH; LookupInner: TransportProc ~ { ENABLE UNWIND => { NULL }; path ¬ NIL; }; CallProtected[mnt, LookupInner]; RETURN[path]; }; Rename: PFSClass.RenameProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; RenameInner: TransportProc ~ { ENABLE UNWIND => { NULL }; done ¬ TRUE; }; CallProtected[mnt, RenameInner]; }; Copy: PFSClass.CopyProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; CopyInner: TransportProc ~ { ENABLE UNWIND => { NULL }; done ¬ TRUE; }; CallProtected[mnt, CopyInner]; }; SetAttributes: PFSClass.SetAttributesProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; SetAttributesInner: TransportProc ~ { ENABLE UNWIND => { NULL }; NULL; }; CallProtected[mnt, SetAttributesInner]; }; SetByteCountAndUniqueID: PFSClass.SetByteCountAndUniqueIDProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; SetByteCountAndUniqueIDInner: TransportProc ~ { ENABLE UNWIND => { NULL }; NULL; }; CallProtected[mnt, SetByteCountAndUniqueIDInner]; }; SetClientProperty: PFSClass.SetClientPropertyProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; SetClientPropertyInner: TransportProc ~ { ENABLE UNWIND => { NULL }; NULL; }; CallProtected[mnt, SetClientPropertyInner]; }; GetClientProperty: PFSClass.GetClientPropertyProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; GetClientPropertyInner: TransportProc ~ { ENABLE UNWIND => { NULL }; propertyValue ¬ NIL; }; CallProtected[mnt, GetClientPropertyInner]; }; EnumerateClientProperties: PFSClass.EnumerateClientPropertiesProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; EnumerateClientPropertiesInner: TransportProc ~ { ENABLE UNWIND => { NULL }; propertyName: ROPE; propertyValue: ROPE; continue: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[propertyName, propertyValue]; }; CallProtected[mnt, EnumerateClientPropertiesInner]; }; Open: PFSClass.OpenProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; of: PFSClass.OpenFile; OpenInner: TransportProc ~ { ENABLE UNWIND => { NULL }; of ¬ NIL; }; CallProtected[mnt, OpenInner]; RETURN[of]; }; Read: PFSClass.ReadProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; ReadInner: TransportProc ~ { ENABLE UNWIND => { NULL }; bytesRead ¬ 0; }; CallProtected[mnt, ReadInner]; }; Write: PFSClass.WriteProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; WriteInner: TransportProc ~ { ENABLE UNWIND => { NULL }; bytesWritten ¬ 0; }; CallProtected[mnt, WriteInner]; }; Close: PFSClass.CloseProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; CloseInner: TransportProc ~ { ENABLE UNWIND => { NULL }; NULL; }; CallProtected[mnt, CloseInner]; }; Store: PFSClass.StoreProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; StoreInner: TransportProc ~ { ENABLE UNWIND => { NULL }; fullName: PFSNames.PATH ¬ NIL; continue: BOOL ¬ IF ( proc = NIL ) THEN TRUE ELSE proc[fullName]; }; CallProtected[mnt, StoreInner]; }; Retrieve: PFSClass.RetrieveProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; RetrieveInner: TransportProc ~ { ENABLE UNWIND => { NULL }; fullFName: PFSNames.PATH ¬ NIL; bytes: INT ¬ 0; uniqueID: PFS.UniqueID ¬ PFS.nullUniqueID; s: IO.STREAM ¬ IF ( proc = NIL ) THEN NIL ELSE proc[fullFName, bytes, uniqueID]; IF ( s = NIL ) THEN ERROR; }; CallProtected[mnt, RetrieveInner]; }; Attach: PFSClass.AttachProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; AttachInner: TransportProc ~ { ENABLE UNWIND => { NULL }; toFName ¬ NIL; }; CallProtected[mnt, AttachInner]; }; GetInfo: PFSClass.GetInfoProc ~ { class: PFSClass.FSHandle ~ h; mnt: VFS ~ NARROW[class.data]; GetInfoInner: TransportProc ~ { ENABLE UNWIND => { NULL }; fullFName ¬ NIL; attachedTo ¬ NIL; uniqueID ¬ PFS.nullUniqueID; bytes ¬ 0; mutability ¬ immutable; fileType ¬ PFS.tUnspecified; }; CallProtected[mnt, GetInfoInner]; }; Init: PROC ~ { PFSClass.Register[xnsFlavor, GetHandle]; }; Init[]; }. Ψ XNSViewImpl.mesa Copyright Σ 1990, 1992 by Xerox Corporation. All rights reserved. Bill Jackson (bj), February 19, 1990 0:11 am PST PFSBackdoor USING [ProduceError], Transport Management XNS Virtual File System(s) Attempt to Attach new vfs[h] Maintenance Object Maintenance Operations File Manipulation Object File Manipulation Procs mnt.session.verifier _ XNSAuth.GetNextVerifier[mnt.conversation]; FilingP10V5.Close[h: crH, file: fileH, session: mnt.session^]; Κή–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ Οeœ7™BK™0K™—šΟk ˜ Kšœžœ ˜Kšžœžœžœ˜Kšžœžœ>˜GKšœ žœφ˜„Kšœ žœžœ˜Kšœ žœ™!Kšœžœžœ˜K˜—š Οn œžœžœžœžœ˜7Kšžœ ˜Kšžœžœžœ˜headšΟz™Kšœ žœžœ˜$šœžœž œžœ˜(Kšœ˜Kšœž˜Kšœ˜K˜—Kšœžœžœ˜+K˜šŸ œžœžœ˜8Kšœžœ˜Kšœžœ˜%šŸ œžœ˜"Kšžœžœžœ˜Kšœ ˜ Kšœ˜—K˜K˜Kšœ˜Kšœ˜——š ™KšΟb œžœ˜K˜Kšžœžœžœ ˜šœ žœžœ˜Kšœžœ˜ Kšœž˜Kšœ˜K˜—šŸ œ˜%Kšœ žœžœ<˜OKšœ žœ˜Kšœžœ‘œ˜"K™K˜Kšœ˜K˜—š‘œžœ˜3Kšœ‘ œ˜KšœžœΟc˜*Kšœ‘œ˜Kšœ‘œ˜ Kšœžœ’˜)Kšœ˜——š ™š‘œžœ%˜HKšœ ˜ Kšœ˜Kšœ˜——š ™šŸœ˜Kšœ˜Kšœžœžœ ˜Kšžœ˜Kšœ˜K˜—šŸœ˜#Kšœ˜Kšœžœžœ ˜Kšœ žœ žœ˜ Kš žœžœžœžœ žœ˜5Kšžœžœžœžœ˜Kšœ˜—Kšœžœžœ$žœ˜AKšœ*˜*K˜—šœ˜Icode2–O[h: CrRPC.Handle, file: FilingP10V5.Handle, session: FilingP10V5.Session]š œžœžœ žœžœžœžœ˜Išžœ žœ˜K˜AM˜?KšœA™AK–O[h: CrRPC.Handle, file: FilingP10V5.Handle, session: FilingP10V5.Session]™>M˜—M˜—Mšœ žœ˜*Mšœ˜K˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜M–O[h: CrRPC.Handle, file: FilingP10V5.Handle, session: FilingP10V5.Session]šœžœžœ˜Mšœ žœ žœ˜*Mš œ žœžœ žœžœžœžœ˜KM˜—Mšœ ˜ Kšœ˜K˜—šŸœžœ˜Kšœ˜šŸœžœžœ žœžœ<žœ žœ žœžœžœ žœ˜ΉK˜0Kšœ˜—Mšœžœ˜1Mšœ˜K˜K˜—šŸœ#˜3Kšœ˜Kšœžœžœ ˜šŸœ˜(Kšžœžœžœ˜Mšœžœžœ˜Mšœžœžœ˜ Mšœ žœ žœ˜*Mšœžœ˜Mšœ žœ˜'Mšœ žœ žœ˜*Mš œ žœžœ žœžœžœžœD˜uMšœ˜—Mšœ*˜*Kšœ˜K˜—šŸœ$˜5Kšœ˜Kšœžœžœ ˜šŸœ˜)Kšžœžœžœ˜Mšœžœ˜Mš œ žœžœ žœžœžœžœ ˜=Mšœ˜—Mšœ+˜+Kšœ˜K˜—šŸœ˜#Kšœ˜Kšœžœžœ ˜šŸ œ˜ Kšžœžœžœ˜K˜Kšœ žœ˜K˜ Kšœ žœ˜K˜Kšœ žœ˜Mšœ˜—Mšœ"˜"Kšœ˜K˜—šŸœ˜#Kšœ˜Kšœžœžœ ˜Mšœžœ˜šŸ œ˜Kšžœžœžœ˜Mšœžœ˜ Mšœ˜—Mšœ ˜ Kšžœ˜ Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Kšœžœ˜ Mšœ˜—Mšœ ˜ Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Kšœžœ˜ Mšœ˜—Mšœ˜Kšœ˜K˜—šŸ œ ˜-Kšœ˜Kšœžœžœ ˜šŸœ˜%Kšžœžœžœ˜Mšžœ˜Mšœ˜—Mšœ'˜'Kšœ˜K˜—šŸœ*˜AKšœ˜Kšœžœžœ ˜šŸœ˜/Kšžœžœžœ˜Mšžœ˜Mšœ˜—Mšœ1˜1Kšœ˜K˜—šŸœ$˜5Kšœ˜Kšœžœžœ ˜šŸœ˜)Kšžœžœžœ˜Mšžœ˜Mšœ˜—Mšœ+˜+Kšœ˜K˜—šŸœ$˜5Kšœ˜Kšœžœžœ ˜šŸœ˜)Kšžœžœžœ˜Mšœžœ˜Mšœ˜—Mšœ+˜+Kšœ˜K˜—šŸœ,˜EKšœ˜Kšœžœžœ ˜šŸœ˜1Kšžœžœžœ˜Mšœžœžœ˜(Mš œ žœžœ žœžœžœžœ#˜TMšœ˜—Mšœ3˜3Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜Kšœ˜šŸ œ˜Kšžœžœžœ˜Mšœžœ˜ Mšœ˜—Mšœ˜Kšžœ˜ Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜M˜Mšœ˜—Mšœ˜Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜M˜Mšœ˜—Mšœ˜Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Mšžœ˜Mšœ˜—Mšœ˜Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Mšœžœžœ˜Mš œ žœžœ žœžœžœžœ˜AMšœ˜—Mšœ˜Kšœ˜K˜—šŸœ˜#Kšœ˜Kšœžœžœ ˜šŸ œ˜ Kšžœžœžœ˜Mšœžœžœ˜Mšœžœ˜Mšœ žœ žœ˜*Mšœžœžœžœ žœžœžœžœ"˜PMšžœžœžœžœ˜Mšœ˜—Mšœ"˜"Kšœ˜K˜—šŸœ˜Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Mšœ žœ˜Mšœ˜—Mšœ ˜ Kšœ˜K˜—šŸœ˜!Kšœ˜Kšœžœžœ ˜šŸ œ˜Kšžœžœžœ˜Mšœ žœ˜Mšœ žœ˜Kšœ žœ˜K˜ K˜Kšœ žœ˜Mšœ˜—Mšœ!˜!Kšœ˜K˜——šŸœžœ˜Kšœ‘ œ ˜(K˜K˜—K˜Kšœ˜K˜——…—$θ6ž