man-pages/man3/X11::Auth.3pm.html
2021-03-31 01:06:50 +01:00

192 lines
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Auth</TITLE>
</HEAD><BODY>
<H1>Auth</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2006-01-19<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
X11::Auth - Perl module to read X11 authority files
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
require X11::Auth;
$a = new X11::Auth;
($auth_type, $auth_data) = $a-&gt;get_by_host($host, $disp_num);
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This module is an approximate perl replacement for the libXau C library
and the <I><A HREF="/cgi-bin/man/man2html?1+xauth">xauth</A></I>(1) program. It reads and interprets the files (usually
'~/.Xauthority') that hold authorization data used in connecting to
X servers. Since it was written mainly for the use of X11::Protocol,
its functionality is currently restricted to reading, not writing, of
these files.
<A NAME="lbAE">&nbsp;</A>
<H2>METHODS</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>new</H3>
<PRE>
$auth = X11::Auth-&gt;new;
$auth = X11::Auth-&gt;open($filename);
</PRE>
<P>
Open an authority file, and create an object to handle it. The filename
will be taken from the <FONT SIZE="-1">XAUTHORITY</FONT> environment variable, if present, or
'.Xauthority' in the user's home directory, or it may be overridden by
an argument. 'open' may be used as a synonym.
<A NAME="lbAG">&nbsp;</A>
<H3>get_one</H3>
<PRE>
($family, $host_addr, $display_num, $auth_name, $auth_data)
= $auth-&gt;get_one;
</PRE>
<P>
Read one entry from the file. Returns a null list at end of file.
<TT>$family</TT> is usually 'Internet' or 'Local', and <TT>$display_num</TT> can
be any string.
<A NAME="lbAH">&nbsp;</A>
<H3>get_all</H3>
<PRE>
@auth_data = $auth-&gt;get_all;
</PRE>
<P>
Read all of the entries in the file. Each member of the array returned
is an array ref similar to the list returned by <I>get_one()</I>.
<A NAME="lbAI">&nbsp;</A>
<H3>get_by_host</H3>
<PRE>
($auth_name, $auth_data)
= $auth-&gt;get_by_host($host, $family, $display_num);
</PRE>
<P>
Get authentication data for a connection of type <TT>$family</TT> to display
<TT>$display_num</TT> on <TT>$host</TT>. If <TT>$family</TT> is 'Internet', the host will be
translated into an appropriate address by <I>gethostbyname()</I>. If no data
is found, returns an empty list.
<A NAME="lbAJ">&nbsp;</A>
<H2>COMPATIBILITY</H2>
The following table shows the (rough) correspondence between libXau
calls and X11::Auth methods:
<P>
<PRE>
libXau X11::Auth
------ ---------
XauFileName $ENV{XAUTHORITY}
|| &quot;$ENV{HOME}/.Xauthority&quot;
fopen(XauFileName(), &quot;rb&quot;) $auth = new X11::Auth
XauReadAuth $auth-&gt;get_one
XauWriteAuth
XauGetAuthByAddr $auth-&gt;get_by_host
XauGetBestAuthByAddr
XauLockAuth
XauUnlockAuth
XauDisposeAuth
</PRE>
<A NAME="lbAK">&nbsp;</A>
<H2>AUTHOR</H2>
Stephen McCamant &lt;<A HREF="mailto:SMCCAM@cpan.org">SMCCAM@cpan.org</A>&gt;
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<I><A HREF="/cgi-bin/man/man2html?1+perl">perl</A></I>(1), X11::Protocol, <I><A HREF="/cgi-bin/man/man2html?3+Xau">Xau</A></I>(3), <I><A HREF="/cgi-bin/man/man2html?1+xauth">xauth</A></I>(1),
lib/Xau/README in the X11 source distribution.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">METHODS</A><DD>
<DL>
<DT id="5"><A HREF="#lbAF">new</A><DD>
<DT id="6"><A HREF="#lbAG">get_one</A><DD>
<DT id="7"><A HREF="#lbAH">get_all</A><DD>
<DT id="8"><A HREF="#lbAI">get_by_host</A><DD>
</DL>
<DT id="9"><A HREF="#lbAJ">COMPATIBILITY</A><DD>
<DT id="10"><A HREF="#lbAK">AUTHOR</A><DD>
<DT id="11"><A HREF="#lbAL">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:00 GMT, March 31, 2021
</BODY>
</HTML>