Blame man/Xau.man

Packit Service f89583
.\" Copyright (c) 1994  X Consortium
Packit Service f89583
.\"
Packit Service f89583
.\" Permission is hereby granted, free of charge, to any person obtaining a
Packit Service f89583
.\" copy of this software and associated documentation files (the "Software"),
Packit Service f89583
.\" to deal in the Software without restriction, including without limitation
Packit Service f89583
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit Service f89583
.\" and/or sell copies of the Software, and to permit persons to whom the
Packit Service f89583
.\" Software furnished to do so, subject to the following conditions:
Packit Service f89583
.\"
Packit Service f89583
.\" The above copyright notice and this permission notice shall be included in
Packit Service f89583
.\" all copies or substantial portions of the Software.
Packit Service f89583
.\"
Packit Service f89583
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service f89583
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service f89583
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit Service f89583
.\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
Packit Service f89583
.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
Packit Service f89583
.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit Service f89583
.\" SOFTWARE.
Packit Service f89583
.\"
Packit Service f89583
.\" Except as contained in this notice, the name of the X Consortium shall not
Packit Service f89583
.\" be used in advertising or otherwise to promote the sale, use or other
Packit Service f89583
.\" dealing in this Software without prior written authorization from the
Packit Service f89583
.\" X Consortium.
Packit Service f89583
.\"
Packit Service f89583
.TH Xau __libmansuffix__ __xorgversion__
Packit Service f89583
.SH NAME
Packit Service f89583
Xau library: XauFileName, XauReadAuth, XauLockAuth, XauUnlockAuth,
Packit Service f89583
XauWriteAuth, XauDisposeAuth,
Packit Service f89583
XauGetAuthByAddr, XauGetBestAuthByAddr \- X authority database routines
Packit Service f89583
.SH SYNOPSIS
Packit Service f89583
.ft CW
Packit Service f89583
.nf
Packit Service f89583
#include <X11/Xauth.h>
Packit Service f89583
Packit Service f89583
typedef struct xauth {
Packit Service f89583
        unsigned short  family;
Packit Service f89583
        unsigned short  address_length;
Packit Service f89583
        char    *address;
Packit Service f89583
        unsigned short  number_length;
Packit Service f89583
        char    *number;
Packit Service f89583
        unsigned short  name_length;
Packit Service f89583
        char    *name;
Packit Service f89583
        unsigned short  data_length;
Packit Service f89583
        char    *data;
Packit Service f89583
} Xauth;
Packit Service f89583
.HP
Packit Service f89583
char *XauFileName (void);
Packit Service f89583
.HP
Packit Service f89583
Xauth *XauReadAuth (FILE *\fIauth_file\fP\^);
Packit Service f89583
.HP
Packit Service f89583
int XauWriteAuth (FILE *\fIauth_file\fP, Xauth *\fIauth\fP\^);
Packit Service f89583
.HP
Packit Service f89583
Xauth *XauGetAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
Packit Service f89583
\fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short
Packit Service f89583
\fInumber_length\fP\^, const char *\fInumber\fP\^, unsigned short
Packit Service f89583
\fIname_length\fP\^, const char *\fIname\fP\^);
Packit Service f89583
.HP
Packit Service f89583
Xauth *XauGetBestAuthByAddr (unsigned short \fIfamily\fP\^, unsigned short
Packit Service f89583
\fIaddress_length\fP\^, const char *\fIaddress\fP\^, unsigned short
Packit Service f89583
\fInumber_length\fP\^, const char *\fInumber\fP\^, int \fItypes_length\fP\^,
Packit Service f89583
char **\fItypes\fR\^, const int *\fItype_lengths\fR\^);
Packit Service f89583
.HP
Packit Service f89583
int XauLockAuth (const char *\fIfile_name\fP\^, int \fIretries\fP\^, int
Packit Service f89583
\fItimeout\fP\^, long \fIdead\fP\^);
Packit Service f89583
.HP
Packit Service f89583
int XauUnlockAuth (const char *\fIfile_name\fP\^);
Packit Service f89583
.HP
Packit Service f89583
int XauDisposeAuth (Xauth *\fIauth\fP\^);
Packit Service f89583
.fi
Packit Service f89583
.ft
Packit Service f89583
.SH DESCRIPTION
Packit Service f89583
.PP
Packit Service f89583
\fBXauFileName\fP generates the default authorization file name by first
Packit Service f89583
checking the XAUTHORITY environment variable if set, else it returns
Packit Service f89583
$HOME/.Xauthority.  This name is statically allocated and should
Packit Service f89583
not be freed.
Packit Service f89583
.PP
Packit Service f89583
\fBXauReadAuth\fP reads the next entry from \fIauth_file\fP.  The entry is
Packit Service f89583
\fBnot\fP statically allocated and should be freed by calling
Packit Service f89583
\fIXauDisposeAuth\fP.
Packit Service f89583
.PP
Packit Service f89583
\fBXauWriteAuth\fP writes an authorization entry to \fIauth_file\fP.  It
Packit Service f89583
returns 1 on success, 0 on failure.
Packit Service f89583
.PP
Packit Service f89583
\fBXauGetAuthByAddr\fP searches for an entry which matches the given network
Packit Service f89583
address/display number pair.  The entry is \fBnot\fP statically allocated
Packit Service f89583
and should be freed by calling \fIXauDisposeAuth\fP.
Packit Service f89583
.PP
Packit Service f89583
\fBXauGetBestAuthByAddr\fP is similar to \fBXauGetAuthByAddr\fP, except
Packit Service f89583
that a list of acceptable authentication methods is specified.  Xau will
Packit Service f89583
choose the file entry which matches the earliest entry in this list (e.g., the
Packit Service f89583
most secure authentication method).  The \fItypes\fP argument is an array of
Packit Service f89583
strings, one string for each authentication method.  \fItypes_length\fP
Packit Service f89583
specifies how many elements are in the \fItypes\fP array.
Packit Service f89583
\fItypes_lengths\fP is an array of integers representing the length
Packit Service f89583
of each string.
Packit Service f89583
.PP
Packit Service f89583
\fBXauLockAuth\fP does the work necessary to synchronously update an
Packit Service f89583
authorization file.  First it makes two file names, one with ``-c'' appended
Packit Service f89583
to \fIfile_name\fP, the other with ``-l'' appended.  If the ``-c'' file
Packit Service f89583
already exists and is more than \fIdead\fP seconds old, \fIXauLockAuth\fP
Packit Service f89583
removes it and the associated ``-l'' file.  To prevent possible
Packit Service f89583
synchronization troubles with NFS, a \fIdead\fP value of zero forces the
Packit Service f89583
files to be removed.  \fIXauLockAuth\fP makes \fIretries\fP attempts to
Packit Service f89583
create and link the file names, pausing \fItimeout\fP seconds between each
Packit Service f89583
attempt.  \fIXauLockAuth\fP returns a collection of values depending on the
Packit Service f89583
results:
Packit Service f89583
.TP
Packit Service f89583
LOCK_ERROR
Packit Service f89583
A system error occurred, either a file_name which is too long, or an
Packit Service f89583
unexpected failure from a system call.  errno may prove useful.
Packit Service f89583
.TP
Packit Service f89583
LOCK_TIMEOUT
Packit Service f89583
\fIretries\fP attempts failed
Packit Service f89583
.TP
Packit Service f89583
LOCK_SUCCESS
Packit Service f89583
The lock succeeded.
Packit Service f89583
.PP
Packit Service f89583
\fBXauUnlockAuth\fP undoes the work of \fIXauLockAuth\fP by unlinking both
Packit Service f89583
the ``-c'' and ``-l'' file names.
Packit Service f89583
.PP
Packit Service f89583
\fBXauDisposeAuth\fP frees storage allocated to hold an authorization entry.
Packit Service f89583
.SH "SEE ALSO"
Packit Service f89583
xauth(1), xdm(1)
Packit Service f89583
.SH AUTHOR
Packit Service f89583
Keith Packard, MIT X Consortium