1 .\" Copyright (c) 1998 - 2006 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .Nm k_hasafs_recheck ,
43 .Nm k_afs_cell_of_file ,
44 .Nm kafs_set_verbose ,
45 .Nm kafs_settoken_rxkad ,
54 AFS cache manager access library (libkafs, -lkafs)
58 .Fn k_afs_cell_of_file "const char *path" "char *cell" "int len"
62 .Fn k_hasafs_recheck "void"
64 .Fn k_pioctl "char *a_path" "int o_opcode" "struct ViceIoctl *a_paramsP" "int a_followSymlinks"
70 .Fn kafs_set_verbose "void (*func)(void *, const char *, int)" "void *"
72 .Fn kafs_settoken_rxkad "const char *cell" "struct ClearToken *token" "void *ticket" "size_t ticket_len"
74 .Fn kafs_settoken "const char *cell" "uid_t uid" "CREDENTIALS *c"
75 .Fn krb_afslog "char *cell" "char *realm"
77 .Fn krb_afslog_uid "char *cell" "char *realm" "uid_t uid"
79 .Fn krb5_afslog_uid "krb5_context context" "krb5_ccache id" "const char *cell" "krb5_const_realm realm" "uid_t uid"
81 .Fn kafs_settoken5 "const char *cell" "uid_t uid" "krb5_creds *c"
83 .Fn krb5_afslog "krb5_context context" "krb5_ccache id" "const char *cell" "krb5_const_realm realm"
86 initializes some library internal structures, and tests for the
87 presence of AFS in the kernel, none of the other functions should be
90 is called, or if it fails.
93 forces a recheck if a AFS client has started since last time
100 set a log function that will be called each time the kafs library does
101 something important so that the application using libkafs can output
105 with the function argument set to
107 will stop libkafs from calling the logging function (if set).
109 .Fn kafs_settoken_rxkad
116 (that have the length
125 .Fn kafs_settoken_rxkad
126 but internally converts the Kerberos 4 or 5 credential to a afs
127 cleartoken and ticket.
132 obtains new tokens (and possibly tickets) for the specified
140 the local cell is used. If
144 the function tries to guess what realm to use. Unless you have some good knowledge of what cell or realm to use, you should pass
147 will use the real user-id for the
157 are the Kerberos 5 equivalents of
164 can be configured to behave differently via a
173 .Bl -tag -width local
175 use the 524 server in the realm to convert the ticket
177 use the Kerberos 5 ticket directly, can be used with if the afs cell
180 convert the Kerberos 5 credential to a 2b token locally (the same work
181 as a 2b 524 server should have done).
188 SU.SE = { afs-use-524 = local }
189 PDC.KTH.SE = { afs-use-524 = yes }
195 as application name when running the
199 The (uppercased) cell name is used as the realm to the
200 .Nm krb5_appdefault function.
202 .\" The extra arguments are the ubiquitous context, and the cache id where
203 .\" to store any obtained tickets. Since AFS servers normally can't handle
204 .\" Kerberos 5 tickets directly, these functions will first obtain version
205 .\" 5 tickets for the requested cells, and then convert them to version 4
206 .\" tickets, that can be stashed in the kernel. To convert tickets the
207 .\" .Fn krb524_convert_creds_kdc
208 .\" function will be used.
210 .Fn k_afs_cell_of_file
213 return the cell of a specified file, no more than
221 system call with the specified arguments. This function is equivalent to
225 initializes a new PAG.
228 removes destroys all tokens in the current PAG.
231 returns 1 if AFS is present in the kernel, 0 otherwise.
235 returns 0 on success, or a Kerberos error number on failure.
236 .Fn k_afs_cell_of_file ,
241 all return the value of the underlaying system call, 0 on success.
243 The following environment variable affect the mode of operation of
245 .Bl -tag -width AFS_SYSCALL
249 will try to figure out the correct system call(s) that are used by AFS
250 by itself. If it does not manage to do that, or does it incorrectly,
251 you can set this variable to the system call number or list of system
252 call numbers that should be used.
255 The following code from
257 will obtain a new PAG and tokens for the local cell and the cell of
258 the users home directory.
263 if(k_afs_cell_of_file(pwd->pw_dir, cell, sizeof(cell)) == 0)
264 krb_afslog(cell, NULL);
265 krb_afslog(NULL, NULL);
269 If any of these functions (apart from
271 is called without AFS being present in the kernel, the process will
272 usually (depending on the operating system) receive a SIGSYS signal.
274 .Xr krb5_appdefault 3 ,
277 .%A Transarc Corporation
278 .%J AFS-3 Programmer's Reference
279 .%T File Server/Cache Manager Interface
283 libkafs will search for
286 in the following locations:
289 .Pa /var/db/openafs/etc ,
296 has no effect under AIX.