krbafs(3) -- Linux man page



k_hasafs k_pioctl k_unlog k_setpag k_afs_cell_of_file krb_afslog krb_afslog_uid - AFS library  


AFS cache manager access library (libkrbafs, -lkrbafs)  


Fd #include <krbafs.h> Ft int Fn k_afs_cell_of_file const char *path char *cell int len Ft int Fn k_hasafs Ft int Fn k_pioctl char *a_path int o_opcode struct ViceIoctl *a_paramsP int a_followSymlinks Ft int Fn k_setpag Ft int Fn k_unlog Ft int Fn krb_afslog char *cell char *realm Ft int Fn krb_afslog_uid char *cell char *realm uid_t uid  


Fn k_hasafs initializes some library internal structures, and tests for the presence of AFS in the kernel, none of the other functions should be called before Fn k_hasafs is called, or if it fails.

Fn krb_afslog , and Fn krb_afslog_uid obtains new tokens (and possibly tickets) for the specified Fa cell and Fa realm . If Fa cell is NULL the local cell is used. If Fa realm is NULL 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 NULL Fn krb_afslog will use the real user-id for the ViceId field in the token, Fn krb_afslog_uid will use Fa uid .

Fn k_afs_cell_of_file will in Fa cell return the cell of a specified file, no more than Fa len characters is put in Fa cell .

Fn k_pioctl does a Fn pioctl syscall with the specified arguments. This function is equivalent to Fn lpioctl .

Fn k_setpag initializes a new PAG.

Fn k_unlog removes destroys all tokens in the current PAG.  


Fn k_hasafs returns 1 if AFS is present in the kernel, 0 otherwise. Fn krb_afslog and Fn krb_afslog_uid returns 0 on success, or a kerberos error number on failure. Fn k_afs_cell_of_file , Fn k_pioctl , Fn k_setpag , and Fn k_unlog all return the value of the underlaying system call, 0 on success.  


The following environment variable affect the mode of operation of krbafs

Normally, krbafs will try to figure out the correct system call(s) that are used by AFS by itself. If it does not manage to do that, or does it incorrectly, you can set this variable to the system call number or list of system call numbers that should be used.



The following code from login will obtain a new PAG and tokens for the local cell and the cell of the users home directory.
if (k_hasafs()) {
        char cell[64];
        if(k_afs_cell_of_file(pwd->pw_dir, cell, sizeof(cell)) == 0)
                krb_afslog(cell, NULL);
        krb_afslog(NULL, NULL);


If any of these functions (apart from Fn k_hasafs ) is called without AFS beeing present in the kernel, the process will usually (depending on the operating system) receive a SIGSYS signal.  


Transarc Corporation AFS-3 Programmer's Reference File Server/Cache Manager Interface 1991


AFS_SYSCALL has no effect under AIX.