1Xau(3)                     Library Functions Manual                     Xau(3)
2
3
4

NAME

6       Xau  library:  XauFileName,  XauReadAuth,  XauLockAuth,  XauUnlockAuth,
7       XauWriteAuth, XauDisposeAuth, XauGetAuthByAddr, XauGetBestAuthByAddr  -
8       X authority database routines
9

SYNOPSIS

11       #include <X11/Xauth.h>
12
13       typedef struct xauth {
14            unsigned short family;
15            unsigned short address_length;
16            char           *address;
17            unsigned short number_length;
18            char           *number;
19            unsigned short name_length;
20            char           *name;
21            unsigned short data_length;
22            char           *data;
23       } Xauth;
24
25
26       char *XauFileName (void);
27
28       Xauth *XauReadAuth (FILE *auth_file);
29
30       int XauWriteAuth (FILE *auth_file, Xauth *auth);
31
32       Xauth *XauGetAuthByAddr (unsigned short family, unsigned short
33              address_length, const char *address, unsigned short
34              number_length, const char *number, unsigned short
35              name_length, const char *name);
36
37       Xauth *XauGetBestAuthByAddr (unsigned short family, unsigned short
38              address_length, const char *address, unsigned short
39              number_length, const char *number, int types_length,
40              char **types, const int *type_lengths);
41
42       int XauLockAuth (const char *file_name, int retries, int
43              timeout, long dead);
44
45       int XauUnlockAuth (const char *file_name);
46
47       int XauDisposeAuth (Xauth *auth);
48

DESCRIPTION

50       XauFileName  generates  the  default  authorization  file name by first
51       checking the XAUTHORITY environment variable if set,  else  it  returns
52       $HOME/.Xauthority.  This name is statically allocated and should not be
53       freed.
54
55       XauReadAuth reads the next entry from  auth_file.   The  entry  is  not
56       statically allocated and should be freed by calling XauDisposeAuth.
57
58       XauWriteAuth  writes an authorization entry to auth_file.  It returns 1
59       on success, 0 on failure.
60
61       XauGetAuthByAddr searches for an entry which matches the given  network
62       address/display number pair.  The entry is not statically allocated and
63       should be freed by calling XauDisposeAuth.
64
65       XauGetBestAuthByAddr is similar to XauGetAuthByAddr, except that a list
66       of acceptable authentication methods is specified.  Xau will choose the
67       file entry which matches the earliest entry in  this  list  (e.g.,  the
68       most  secure authentication method).  The types argument is an array of
69       strings, one string for each authentication method.  types_length spec‐
70       ifies  how  many  elements are in the types array.  types_lengths is an
71       array of integers representing the length of each string.
72
73       XauLockAuth does the work necessary to synchronously update  an  autho‐
74       rization file.  First it makes two file names, one with ``-c'' appended
75       to file_name, the other with  ``-l''  appended.   If  the  ``-c''  file
76       already  exists  and is more than dead seconds old, XauLockAuth removes
77       it and the associated ``-l'' file.  To prevent possible synchronization
78       troubles with NFS, a dead value of zero forces the files to be removed.
79       XauLockAuth makes retries attempts to create and link the  file  names,
80       pausing  timeout  seconds  between each attempt.  XauLockAuth returns a
81       collection of values depending on the results:
82
83            LOCK_ERROR     A system error occurred, either a file_name
84                           which is too long, or an unexpected failure from
85                           a system call.  errno may prove useful.
86
87            LOCK_TIMEOUT   retries attempts failed
88
89            LOCK_SUCCESS   The lock succeeded.
90
91
92       XauUnlockAuth undoes the work of  XauLockAuth  by  unlinking  both  the
93       ``-c'' and ``-l'' file names.
94
95       XauDisposeAuth frees storage allocated to hold an authorization entry.
96

SEE ALSO

98       xauth(1), xdm(1)
99

AUTHOR

101       Keith Packard, MIT X Consortium
102
103
104
105X Version 11                     libXau 1.0.6                           Xau(3)
Impressum