1 .\" Copyright (c) 1998 - 1999, 2001 - 2003 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
32 .\" $Id: kafs.3,v 1.16 2003/04/16 13:58:27 lha Exp $
42 .Nm k_afs_cell_of_file ,
43 .Nm kafs_set_verbose ,
44 .Nm kafs_settoken_rxkad ,
53 AFS cache manager access library (libkafs, -lkafs)
57 .Fn k_afs_cell_of_file "const char *path" "char *cell" "int len"
61 .Fn k_pioctl "char *a_path" "int o_opcode" "struct ViceIoctl *a_paramsP" "int a_followSymlinks"
67 .Fn kafs_set_verbose "void (*func)(void *, const char *, int)" "void *"
69 .Fn kafs_settoken_rxkad "const char *cell" "struct ClearToken *token" "void *ticket" "size_t ticket_len"
71 .Fn kafs_settoken "const char *cell" "uid_t uid" "CREDENTIALS *c"
72 .Fn krb_afslog "char *cell" "char *realm"
74 .Fn krb_afslog_uid "char *cell" "char *realm" "uid_t uid"
76 .Fn krb5_afslog_uid "krb5_context context" "krb5_ccache id" "const char *cell" "krb5_const_realm realm" "uid_t uid"
78 .Fn kafs_settoken5 "const char *cell" "uid_t uid" "krb5_creds *c"
80 .Fn krb5_afslog "krb5_context context" "krb5_ccache id" "const char *cell" "krb5_const_realm realm"
83 initializes some library internal structures, and tests for the
84 presence of AFS in the kernel, none of the other functions should be
87 is called, or if it fails.
90 set a log function that will be called each time the kafs library does
91 something important so that the application using libkafs can output
95 with the function argument set to
97 will stop libkafs from calling the logging function (if set).
99 .Fn kafs_settoken_rxkad
106 (that have the length
115 .Fn kafs_settoken_rxkad
116 but internally converts the Kerberos 4 or 5 credential to a afs
117 cleartoken and ticket.
122 obtains new tokens (and possibly tickets) for the specified
130 the local cell is used. If
134 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
137 will use the real user-id for the
147 are the Kerberos 5 equivalents of
154 can be configured to behave diffrently via a
163 .Bl -tag -width local
165 use the 524 server in the realm to convert the ticket
167 use the Kerberos 5 ticket directly, can be used with if the afs cell
170 convert the Kerberos 5 credential to a 2b token locally (the same work
171 as a 2b 524 server should have done).
178 SU.SE = { afs-use-524 = local }
179 PDC.KTH.SE = { afs-use-524 = yes }
185 as application name when running the
189 The (uppercased) cellname is used as the realm to the
190 .Nm krb5_appdefault function.
192 .\" The extra arguments are the ubiquitous context, and the cache id where
193 .\" to store any obtained tickets. Since AFS servers normally can't handle
194 .\" Kerberos 5 tickets directly, these functions will first obtain version
195 .\" 5 tickets for the requested cells, and then convert them to version 4
196 .\" tickets, that can be stashed in the kernel. To convert tickets the
197 .\" .Fn krb524_convert_creds_kdc
198 .\" function will be used.
200 .Fn k_afs_cell_of_file
203 return the cell of a specified file, no more than
211 syscall with the specified arguments. This function is equivalent to
215 initializes a new PAG.
218 removes destroys all tokens in the current PAG.
221 returns 1 if AFS is present in the kernel, 0 otherwise.
225 returns 0 on success, or a Kerberos error number on failure.
226 .Fn k_afs_cell_of_file ,
231 all return the value of the underlaying system call, 0 on success.
233 The following environment variable affect the mode of operation of
235 .Bl -tag -width AFS_SYSCALL
239 will try to figure out the correct system call(s) that are used by AFS
240 by itself. If it does not manage to do that, or does it incorrectly,
241 you can set this variable to the system call number or list of system
242 call numbers that should be used.
245 The following code from
247 will obtain a new PAG and tokens for the local cell and the cell of
248 the users home directory.
253 if(k_afs_cell_of_file(pwd->pw_dir, cell, sizeof(cell)) == 0)
254 krb_afslog(cell, NULL);
255 krb_afslog(NULL, NULL);
259 If any of these functions (apart from
261 is called without AFS being present in the kernel, the process will
262 usually (depending on the operating system) receive a SIGSYS signal.
265 .%A Transarc Corporation
266 .%J AFS-3 Programmer's Reference
267 .%T File Server/Cache Manager Interface
271 .Xr krb5_appdefaults 3 ,
275 has no effect under AIX.