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

COMPATIBILITY

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

AUTHOR

76       Stephen McCamant <SMCCAM@cpan.org>
77

SEE ALSO

79       perl(1), X11::Protocol, Xau(3), xauth(1), lib/Xau/README in the X11
80       source distribution.
81
82
83
84perl v5.8.8                       2006-09-16                           Auth(3)
Impressum