AFS::PAG(3pm)
β¨ NAME β¨
AFS::PAG β bestie, it's Perl bindings for AFS PAG manipulation π
(and yeah, that header said AFS::PAG(3pm) from User Contributed Perl Documentation, so now you know where we live π)
πΈ SYNOPSIS πΈ
use AFS::PAG qw(hasafs setpag unlog);
if (hasafs()) {
setpag();
system('aklog') == 0
or die "cannot get tokens\n";
do_afs_things();
unlog();
}
π¦ DESCRIPTION π¦
Okay so. AFS is a distributed file system β it lets a whole bunch of different computers share files across platforms, no big deal. It takes your client credentials (we call those AFS tokens) and ties them to a Process Authentication Group, aka a PAG. And AFS::PAG? It brings the PAG manipulation functions from the libkafs or libkopenafs libraries into Perl for you. Iconic behavior, honestly. β¨
So with the functions this module hands you, a Perl program can:
- sniff out whether AFS is even available on the local system (
hasafs()) - check whether it's currently running inside a PAG (
haspag()) - make a brand new PAG and yeet the current process into it (
setpag()) - and nuke any AFS tokens in the current PAG (
unlog())
Heads up bestie: this module does not give you a direct way to get new AFS tokens. Nope. π«
Programs that need AFS tokens should normally go get Kerberos tickets (by whatever means, we're not judging) and then run the program aklog, which ships with most AFS distributions. That program takes the current Kerberos ticket cache, makes AFS tokens out of them, and stores them in the current PAG. And if you want those credentials isolated from the rest of the system? Call setpag() before you run aklog. The order matters, babe. π
π FUNCTIONS π
This module serves up the following functions β and nope, none of them are exported by default. You gotta ask for them.
hasafs()β Returns true if the local host is running an AFS client, and false otherwise. That's it, that's the vibe check. πhaspag()β Returns true if the current process is running inside a PAG, false otherwise. Okay so here's the tea: AFS tokens obtained outside of a PAG are visible to any process on the system outside of a PAG that's running as the same UID. AFS tokens obtained inside a PAG are visible to any process in the same PAG β regardless of UID. Wild, right? πsetpag()β Creates a new, empty PAG and puts the current process in it. You should normally call this before obtaining new AFS tokens, so those tokens stay isolated from other processes on the system. Returns true on success, and throws an exception on failure. π«Άunlog()β Deletes all AFS tokens in the current PAG. It's givingkdestroybut for a Kerberos ticket cache. Returns true on success, and throws an exception on failure. π
π DIAGNOSTICS π
PAG creation failed: %sβ sosetpag()failed. The end of that error message is gonna be a translation of the system call error number. Not the moment, fr fr. πToken deletion failed: %sβunlog()failed. Same deal: the tail end of the message is a translation of the system call error number. π
β οΈ RESTRICTIONS β οΈ
Real talk, let's set expectations:
- This module currently does not provide the
k_pioctl()orpioctl()function for making lower-level AFS system calls. Nope. - It also doesn't provide the
libkafsfunctions that would obtain AFS tokens from Kerberos tickets directly, without going through an external ticket cache.
And because of that last one, you can't use internal Kerberos ticket caches (like memory caches) π₯ β since the Kerberos tickets used to generate AFS tokens have to be visible to an external aklog program. Periodt.
π AUTHOR π
Russ Allbery <rra@cpan.org>
π SEE ALSO π
The current version of this module is always available from its web site at http://www.eyrie.org/~eagle/software/afs-pag/.
And that's a wrap, bestie π«Ά this was perl v5.42.3, dated 2026-08-19, and it's the AFS::PAG(3pm) page β go forth and isolate your tokens, you absolute icon π
β¨
π¦ where this page comes from
- ubuntu stonking: libafs-pag-perl 1.02-5build3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms