Oberon || Library || Module Index || Search Engine || Definition || Module
CONST familyInternet = 0; CONST familyDECnet = 1; CONST familyChaos = 2; CONST familyLocal = 256; CONST familyWild = 65535; TYPE Family = INTEGER; (* one of familyXXX *) CONST maxfieldlen = 512; (* maximal field length *) TYPE String = ARRAY maxfieldlen OF CHAR; TYPE Field = POINTER TO FieldRec; TYPE FieldRec = RECORD len: INTEGER; string: String; END; TYPE AuthRec = RECORD family: Family; address: Field; number: Field; name: Field; data: Field; END;
CONST authFileNotFound = 0; CONST noMatchingEntryFound = 1; CONST undefinedHome = 2; CONST errorcodes = 3; TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: SHORTINT; END; VAR error: Events.EventType; VAR errormsg: ARRAY errorcodes OF Events.Message;
PROCEDURE GetAuthByAddr(VAR auth: AuthRec; errors: RelatedEvents.Object) : BOOLEAN;
Authorization records consist of an address which designates the window server (net address family, net address and display number) and the associated authorization fields which consist of a name and a data field. Authorization records are kept by individual users in an authorization file (usually $HOME/.Xauthority).
GetAuthByAddr scans the authorization file for an entry which matches the family, the address, the number and the name of auth. Wildcards (i.e. familyWild or empty fields) matches anything. On success, the record is copied back to auth and GetAuthByAddr returns TRUE.
Oberon || Library || Module Index || Search Engine || Definition || Module