Blame man/Xau.man

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