XAUTH(1) AIX XAUTH(1) NAME XauFileName, XauReadAuth, XauLockAuth, XauUnlockAuth, XauWriteAuth, XauGetAuthByAddr - X authority database rou- tines SYNOPSIS ####iiiinnnncccclllluuuuddddeeee <<<>>> typedef struct xauth { unsigned short family; unsigned short address_length; char *address; unsigned short number_length; char *number; unsigned short name_length; char *name; unsigned short data_length; char *data; } Xauth; cccchhhhaaaarrrr ****XXXXaaaauuuuFFFFiiiilllleeeeNNNNaaaammmmeeee (((()))) XXXXaaaauuuutttthhhh ****XXXXaaaauuuuRRRReeeeaaaaddddAAAAuuuutttthhhh ((((aaaauuuutttthhhh____ffffiiiilllleeee)))) _F_I_L_E *_a_u_t_h__f_i_l_e; iiiinnnntttt XXXXaaaauuuuWWWWrrrriiiitttteeeeAAAAuuuutttthhhh ((((aaaauuuutttthhhh____ffffiiiilllleeee,,,, aaaauuuutttthhhh)))) _F_I_L_E *_a_u_t_h__f_i_l_e; _X_a_u_t_h *_a_u_t_h; XXXXaaaauuuutttthhhh ****XXXXaaaauuuuGGGGeeeettttAAAAuuuutttthhhhBBBByyyyAAAAddddddddrrrr ((((ffffaaaammmmiiiillllyyyy,,,, aaaaddddddddrrrreeeessssssss____lllleeeennnnggggtttthhhh,,,, aaaaddddddddrrrreeeessssssss,,,, nnnnuuuummmmbbbbeeeerrrr____lllleeeennnnggggtttthhhh,,,, nnnnuuuummmmbbbbeeeerrrr)))) _u_n_s_i_g_n_e_d _s_h_o_r_t _f_a_m_i_l_y; _u_n_s_i_g_n_e_d _s_h_o_r_t _a_d_d_r_e_s_s__l_e_n_g_t_h; _c_h_a_r *_a_d_d_r_e_s_s; _u_n_s_i_g_n_e_d _s_h_o_r_t _n_u_m_b_e_r__l_e_n_g_t_h; _c_h_a_r *_n_u_m_b_e_r; iiiinnnntttt XXXXaaaauuuuLLLLoooocccckkkkAAAAuuuutttthhhh ((((ffffiiiilllleeee____nnnnaaaammmmeeee,,,, rrrreeeettttrrrriiiieeeessss,,,, ttttiiiimmmmeeeeoooouuuutttt,,,, ddddeeeeaaaadddd)))) _c_h_a_r *_f_i_l_e__n_a_m_e; _i_n_t _r_e_t_r_i_e_s; _i_n_t _t_i_m_e_o_u_t; _l_o_n_g _d_e_a_d; iiiinnnntttt XXXXaaaauuuuUUUUnnnnlllloooocccckkkkAAAAuuuutttthhhh ((((ffffiiiilllleeee____nnnnaaaammmmeeee)))) _c_h_a_r *_f_i_l_e__n_a_m_e; XXXXaaaauuuuDDDDiiiissssppppoooosssseeeeAAAAuuuutttthhhh ((((aaaauuuutttthhhh)))) _X_a_u_t_h *_a_u_t_h; DESCRIPTION XXXXaaaauuuuFFFFiiiilllleeeeNNNNaaaammmmeeee generates the default authorization file name by Rev. Release 5 Page 1 XAUTH(1) AIX XAUTH(1) first checking the XAUTHROTIY environment variable if set, else it returns $HOME/.Xauthority. This name is statically allocated and should not be freed. XXXXaaaauuuuRRRReeeeaaaaddddAAAAuuuutttthhhh reads the next entry from _a_u_t_h__f_i_l_e. The entry is nnnnooootttt statically allocated and should be freed by calling _X_a_u_D_i_s_p_o_s_e_A_u_t_h. XXXXuuuuWWWWrrrriiiitttteeeeAAAAuuuutttthhhh writes an authorization entry to _a_u_t_h__f_i_l_e. It returns 1 on success, 0 on failure. XXXXaaaauuuuGGGGeeeettttAAAAuuuutttthhhhBBBByyyyAAAAddddddddrrrr searches for an entry which matches the given network address/display number pair. The entry is nnnnooootttt statically allocated and should be freed by calling _X_a_u_- _D_i_s_p_o_s_e_A_u_t_h XXXXaaaauuuuLLLLoooocccckkkkAAAAuuuutttthhhh does the work necessary to synchronously update an authorization file. First it makes to file names, one with ``-c'' appended to _f_i_l_e__n_a_m_e, the other with ``-l'' appended. If the ``-c'' file already exists and is more than _d_e_a_d seconds old, _X_a_u_L_o_c_k_A_u_t_h removes it and the asso- ciated ``-l'' file. To prevent possible synchronization troubles with NFS, a _d_e_a_d value of zero forces the files to be removed. _X_a_u_L_o_c_k_A_u_t_h makes _r_e_t_r_i_e_s attempts to create and link the file names, pausing _t_i_m_e_o_u_t seconds between each attempt. _X_a_u_L_o_c_k_A_u_t_h returns a collection of values depending on the results: LOCK_ERROR A system error occurred, either a file_name which is too long, or an unexpected failure from a system call. errno may prove useful. LOCK_TIMEOUT _r_e_t_r_i_e_s attempts failed LOCK_SUCCESS The lock succeeded. XXXXaaaauuuuUUUUnnnnlllloooocccckkkkAAAAuuuutttthhhh undoes the work of _X_a_u_L_o_c_k_A_u_t_h by unlinking both the ``-c'' and ``-l'' file names. XXXXaaaauuuuDDDDiiiissssppppoooosssseeeeAAAAuuuutttthhhh frees storage allocated to hold an authoriza- tion entry. SEE ALSO xauth(1), xdm(1) COPYRIGHT Copyright 1988, Massachusetts Institute of Technology. See _X(_1) for a full statement of rights and permissions. AUTHOR Keith Packard, MIT X Consortium Rev. Release 5 Page 2