1Auth(3)               User Contributed Perl Documentation              Auth(3)
2
3
4

NAME

6       X11::Auth - Perl module to read X11 authority files
7

SYNOPSIS

9         require X11::Auth;
10         $a = new X11::Auth;
11         ($auth_type, $auth_data) = $a->get_by_host($host, $disp_num);
12

DESCRIPTION

14       This module is an approximate perl replacement for the libXau C library
15       and the xauth(1) program. It reads and interprets the files (usually
16       '~/.Xauthority') that hold authorization data used in connecting to X
17       servers. Since it was written mainly for the use of X11::Protocol, its
18       functionality is currently restricted to reading, not writing, of these
19       files.
20

METHODS

22   new
23         $auth = X11::Auth->new;
24         $auth = X11::Auth->open($filename);
25
26       Open an authority file, and create an object to handle it. The filename
27       will be taken from the XAUTHORITY environment variable, if present, or
28       '.Xauthority' in the user's home directory, or it may be overridden by
29       an argument. 'open' may be used as a synonym.
30
31   get_one
32         ($family, $host_addr, $display_num, $auth_name, $auth_data)
33            = $auth->get_one;
34
35       Read one entry from the file. Returns a null list at end of file.
36       $family is usually 'Internet' or 'Local', and $display_num can be any
37       string.
38
39   get_all
40         @auth_data = $auth->get_all;
41
42       Read all of the entries in the file. Each member of the array returned
43       is an array ref similar to the list returned by get_one().
44
45   get_by_host
46         ($auth_name, $auth_data)
47            = $auth->get_by_host($host, $family, $display_num);
48
49       Get authentication data for a connection of type $family to display
50       $display_num on $host. If $family is 'Internet', the host will be
51       translated into an appropriate address by gethostbyname(). If no data
52       is found, returns an empty list.
53

COMPATIBILITY

55       The following table shows the (rough) correspondence between libXau
56       calls and X11::Auth methods:
57
58         libXau                     X11::Auth
59         ------                     ---------
60         XauFileName                $ENV{XAUTHORITY}
61                                    || "$ENV{HOME}/.Xauthority"
62         fopen(XauFileName(), "rb") $auth = new X11::Auth
63         XauReadAuth                $auth->get_one
64         XauWriteAuth
65         XauGetAuthByAddr           $auth->get_by_host
66         XauGetBestAuthByAddr
67         XauLockAuth
68         XauUnlockAuth
69         XauDisposeAuth
70

AUTHOR

72       Stephen McCamant <SMCCAM@cpan.org>
73

SEE ALSO

75       perl(1), X11::Protocol, Xau(3), xauth(1), lib/Xau/README in the X11
76       source distribution.
77
78
79
80perl v5.34.0                      2021-07-27                           Auth(3)
Impressum