Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
XAuthority


NAME

XAuthority - retrieval of X authorization records

SYNOPSIS

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;

DESCRIPTION

XAuthority allows to access the X authorization database. Usually, the X11 or X11/NeWS window server require the correct authorization record to be passed after establishing a connection.

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.

DIAGNOSTICS

Errors lead to events which are related to the errors parameter:
authFileNotFound
No authorization file has been found. By default, the file is looked for in $HOME/.Xauthority, or, if XAUTHORITY is given, in $XAUTHORITY.
noMatchingEntryFound
No matching entry has been found in the authorization file.
undefinedHome
HOME is not defined in the environment.

ENVIRONMENT

HOME
location of the home directory
XAUTHORITY
location of the authority database

FILES

$HOME/.Xauthority
default location of the X authority database

SEE ALSO

xauth(1)
command line interface to the X authority database
NeWS
provides a NeWS connection to the X11/NeWS server
RelatedEvents
error handling

LIBRARY

XAuthority is part of the NeWS-library, i.e. +lNeWS must be specified for mmo.
Edited by: borchert, last change: 2003/07/10, revision: 1.3, converted to HTML: 2003/07/10

Oberon || Library || Module Index || Search Engine || Definition || Module