DIRECTORY CHEntriesP0V0, GVNames, GvNsMap, Rope, UserCredentials, XNSCH, XNSCHACL, XNSCHName; MaintainHacks: CEDAR PROGRAM IMPORTS GVNames, GvNsMap, Rope, UserCredentials, XNSCH, XNSCHACL, XNSCHName EXPORTS = { ROPE: TYPE = Rope.ROPE; Expand: PROC [groups, groupsDone, members: LIST OF ROPE] RETURNS [LIST OF ROPE] = { EnumerateGroup: PROC [group: ROPE] RETURNS [LIST OF ROPE] = { TRUSTED { info: GVNames.MemberInfo = GVNames.GetMembers[group]; WITH i: info SELECT FROM group => RETURN[i.members]; notFound, noChange, individual, noChange, individual, allDown => RETURN[NIL]; ENDCASE => RETURN[NIL]; }; }; GetNextGroup: PROC RETURNS [ROPE] = { group: ROPE; IF groups = NIL OR groups.first = NIL THEN RETURN[NIL]; group ¬ groups.first; groups ¬ groups.rest; groupsDone ¬ CONS[group, groupsDone]; RETURN[group]; }; RememberGroup: PROC [group: ROPE] = { IF IsInList[group, groupsDone] OR IsInList[group, groups] THEN RETURN; groups ¬ CONS[group, groups]; }; RememberMember: PROC [member: ROPE] = { IF IsInList[member, members] THEN RETURN; members ¬ CONS[member, members]; }; Merge: PROC [a, b: LIST OF ROPE] RETURNS [LIST OF ROPE] = { temp: LIST OF ROPE; IF a = NIL OR a.first = NIL THEN RETURN[b]; IF b = NIL OR b.first = NIL THEN RETURN[a]; FOR temp ¬ a, temp.rest WHILE temp.rest # NIL DO ENDLOOP; temp.rest ¬ b; RETURN[a]; }; IsInList: PROC [name: ROPE, list: LIST OF ROPE] RETURNS [BOOL] = { FOR list ¬ list, list.rest WHILE list # NIL DO IF Rope.Equal[name, list.first]THEN RETURN[TRUE]; ENDLOOP; RETURN[FALSE]; }; IsGroup: PROC [name: ROPE] RETURNS [BOOL] = { RETURN[Rope.Find[name, "^."] # -1]; }; thisGroup: ROPE; thisGroupMembers: LIST OF ROPE; thisGroup ¬ GetNextGroup[]; IF thisGroup = NIL THEN RETURN[members]; thisGroupMembers ¬ EnumerateGroup[thisGroup]; FOR l: LIST OF ROPE ¬ thisGroupMembers, l.rest WHILE l # NIL DO thisMember: ROPE ¬ l.first; IF IsGroup[thisMember] THEN RememberGroup[thisMember] ELSE RememberMember[thisMember]; ENDLOOP; thisGroupMembers ¬ Merge[members, Expand[groups, groupsDone, members]]; RETURN[thisGroupMembers]; }; IsAdministrator: PROC [domain, member: Rope.ROPE] RETURNS [BOOL] = { isMember, problems: BOOL ¬ FALSE; domainName, memberName, distingMemberName: XNSCHName.Name; c: XNSCH.Conversation ¬ XNSCH.InitiateConversation[]; domainName ¬ XNSCHName.NameFromRope[Rope.Cat[":", domain]]; memberName ¬ XNSCHName.NameFromRope[member]; distingMemberName ¬ XNSCH.Lookup[c, memberName ! XNSCH.Error => {problems ¬ TRUE; CONTINUE}]; [isMember] ¬ XNSCHACL.IsMemberOfDomainACLClosure[c, domainName, administrators, distingMemberName ! XNSCH.Error => {problems ¬ TRUE; CONTINUE}]; XNSCH.TerminateConversation[c]; RETURN[isMember]; }; GvFormOfName: PROC [name: ROPE] RETURNS[ROPE] = { gvName: ROPE ¬ GvNsMap.GvFromNsName[name, nsToGv]; IF gvName # NIL THEN RETURN[gvName]; RETURN[name]; }; NsFormOfName: PROC [name: ROPE] RETURNS[ROPE] = { nsName: ROPE ¬ GvNsMap.NsFromGvName[name]; IF nsName # NIL THEN RETURN[nsName]; RETURN[name]; }; DoNothingEnumeratorProc: XNSCH.EnumeratorProc = {}; }. ή MaintainHacks.mesa -- For messing with maintain Copyright Σ 1987, 1992 by Xerox Corporation. All rights reserved. Wes Irish, June 3, 1987 6:28:09 pm PDT ExpandFast: PROC [groups, groupsDone, members: RedBlackTree.Table] RETURNS [RedBlackTree.Table] = { EnumerateGroup: PROC [group: ROPE] RETURNS [LIST OF ROPE] = { TRUSTED { info: GVNames.MemberInfo = GVNames.GetMembers[group]; WITH i: info SELECT FROM group => RETURN[i.members]; notFound, noChange, individual, noChange, individual, allDown => RETURN[NIL]; ENDCASE => RETURN[NIL]; }; }; GetNextGroup: PROC RETURNS [ROPE] = { group: ROPE _ RedBlackTree.LookupSmallest[groups]; IF group = NIL THEN RETURN[NIL]; RedBlackTree.Delete[groups, group]; RedBlackTree.Insert[groupsDone, group, ??]; RETURN[group]; }; RememberGroup: PROC [group: ROPE] = { IF IsInList[group, groupsDone] OR IsInList[group, groups] THEN RETURN; groups _ CONS[group, groups]; }; RememberMember: PROC [member: ROPE] = { IF IsInList[member, members] THEN RETURN; members _ CONS[member, members]; }; Merge: PROC [a, b: LIST OF ROPE] RETURNS [LIST OF ROPE] = { temp: LIST OF ROPE; IF a = NIL OR a.first = NIL THEN RETURN[b]; IF b = NIL OR b.first = NIL THEN RETURN[a]; FOR temp _ a, temp.rest WHILE temp.rest # NIL DO ENDLOOP; temp.rest _ b; RETURN[a]; }; IsInList: PROC [name: ROPE, list: LIST OF ROPE] RETURNS [BOOL] = { FOR list _ list, list.rest WHILE list # NIL DO IF Rope.Equal[name, list.first]THEN RETURN[TRUE]; ENDLOOP; RETURN[FALSE]; }; IsGroup: PROC [name: ROPE] RETURNS [BOOL] = { RETURN[Rope.Find[name, "^."] # -1]; }; thisGroup: ROPE; thisGroupMembers: LIST OF ROPE; thisGroup _ GetNextGroup[]; IF thisGroup = NIL THEN RETURN[members]; thisGroupMembers _ EnumerateGroup[thisGroup]; FOR l: LIST OF ROPE _ thisGroupMembers, l.rest WHILE l # NIL DO thisMember: ROPE _ l.first; IF IsGroup[thisMember] THEN RememberGroup[thisMember] ELSE RememberMember[thisMember]; ENDLOOP; thisGroupMembers _ Merge[members, Expand[groups, groupsDone, members]]; RETURN[thisGroupMembers]; }; Κg•NewlineDelimiter –(cedarcode) style™codešœΟc™/Kšœ Οeœ6™BKšœ&™&K™—K˜šΟk ˜ Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜KšŸœ˜KšŸœ˜ Kšœ ˜ —K˜šΟnΟbœŸœ˜KšŸœ(ŸœŸœ ˜KKšŸœ˜ —K˜Kšœ˜˜KšŸœŸœŸœ˜K˜šΠbnœŸœŸœŸœŸœŸœŸœŸœŸœ˜QK˜š’œŸœ ŸœŸœŸœŸœŸœ˜;K˜šŸœ˜ Kšœ5˜5šŸœ ŸœŸ˜Kšœ Ÿœ ˜KšœAŸœŸœ˜MKšŸœŸœŸœ˜—Kšœ˜—K˜—š’ œŸœŸœŸœ˜#K˜KšœŸœ˜ KšŸœ ŸœŸœŸœŸœŸœŸœ˜7K˜K˜Kšœ Ÿœ˜%KšŸœ˜K˜—š’ œŸœ Ÿœ˜#K˜KšŸœŸœŸœŸœ˜FKšœ Ÿœ˜K˜—š‘œŸœ Ÿœ˜%K˜KšŸœŸœŸœ˜)Kšœ Ÿœ˜ K˜—š’œŸœŸœŸœŸœŸœŸœŸœŸœ˜9K˜KšœŸœŸœŸœ˜Kšœ+˜+Kšœ+˜+šœŸœ ŸœŸ˜0K˜—K˜Kšœ ˜ K˜—š’œŸœŸœŸœŸœŸœŸœŸœ˜@K˜šŸœŸœŸœŸ˜.KšŸœŸœŸœŸœ˜1KšŸœ˜—KšŸœŸœ˜K˜—š ’œŸœŸœŸœŸœ˜+K˜KšŸœ˜#K˜—Kšœ Ÿœ˜KšœŸœŸœŸœ˜K˜KšŸœ ŸœŸœŸœ ˜(K˜-š ŸœŸœŸœŸœŸœŸœŸ˜?Kšœ Ÿœ ˜šŸœ˜KšŸœ˜KšŸœ˜ —KšŸœ˜—KšœFŸ˜GKšŸœ˜K˜K˜—š’‘œŸœ3Ÿœ™aK™š’œŸœ ŸœŸœŸœŸœŸœ™;K™šŸœ™ Jšœ5™5šŸœ ŸœŸ™Jšœ Ÿœ ™JšœAŸœŸœ™MJšŸœŸœŸœ™—Jšœ™—K™—š’ œŸœŸœŸœ™#K™KšœŸœ'™2KšŸœ ŸœŸœ™ Kšœ#™#Kšœ+™+KšŸœ™K™—š’ œŸœ Ÿœ™#K™KšŸœŸœŸœŸœ™FKšœ Ÿœ™K™—š‘œŸœ Ÿœ™%K™KšŸœŸœŸœ™)Kšœ Ÿœ™ K™—š’œŸœŸœŸœŸœŸœŸœŸœŸœ™9K™KšœŸœŸœŸœ™Kšœ+™+Kšœ+™+šœŸœ ŸœŸ™0K™—Kšœ™Kšœ ™ K™—š’œŸœŸœŸœŸœŸœŸœŸœ™@K™šŸœŸœŸœŸ™.KšŸœŸœŸœŸœ™1KšŸœ™—KšŸœŸœ™K™—š ’œŸœŸœŸœŸœ™+K™KšŸœ™#K™—Kšœ Ÿœ™KšœŸœŸœŸœ™Kšœ™KšŸœ ŸœŸœŸœ ™(Kšœ-™-š ŸœŸœŸœŸœŸœŸœŸ™?Kšœ Ÿœ ™šŸœ™KšŸœ™KšŸœ™ —KšŸœ™—KšœFŸ™GKšŸœ™K™——˜š ’œŸœŸœŸœŸœ˜BKšœ˜KšœŸœŸœ˜!Kšœ:˜:KšœŸœŸœ˜5K˜;K˜,šœŸœ˜.KšœŸœŸœŸœ˜.—šœ ŸœL˜aKšœŸœŸœŸœ˜.—KšŸœ˜KšŸœ ˜K˜K˜—š   œŸœŸœŸœŸœ˜1KšœŸœ&˜2KšŸœ ŸœŸœ ˜$KšŸœ˜ Kšœ˜K˜—š   œŸœŸœŸœŸœ˜1KšœŸœ˜*KšŸœ ŸœŸœ ˜$KšŸœ˜ Kšœ˜K˜—š‘œŸœ˜/K˜K˜——K˜—…— ή#