RPC_CLNT_AUTH(3)

πŸ’– RPC_CLNT_AUTH(3) πŸ’–

okay bestie, so this is a Library Functions Manual page, section 3 of the manual, and the whole vibe is client side RPC authentication. no cap. let's get into it πŸ¦‹


✨ NAME ✨

auth_destroy, authnone_create, authsys_create, authsys_create_default β€” library routines for client side remote procedure call authentication πŸ‘‘


🌸 SYNOPSIS 🌸

#include <rpc/rpc.h>

void
auth_destroy(AUTH *auth);

AUTH *
authnone_create(void);

AUTH *
authsys_create(const char *host, const uid_t uid, const gid_t gid,
    const int len, const gid_t *aup_gids);

AUTH *
authsys_create_default(void);

like. look at those signatures. they're serving πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so these routines are part of the RPC library, and what that library does is let C language programs make procedure calls on other machines across the network β€” with whatever authentication you want. desired authentication. your choice, your rules. ✨

the way these get called is normally after you've created the CLIENT handle. like, CLIENT first, auth second, that's the order, don't fight it.

then: the cl_auth field of the CLIENT structure should be initialized by the AUTH structure that some of the following routines hand back to you. πŸ’–

and the client's authentication information? it gets passed to the server when the RPC call is made. that's the whole point. that's the moment. 🌈

heads up bestie: only the NULL and the SYS style of authentication is discussed here. the others are simply not this page's business. iykyk.

🧚 Routines 🧚

  • auth_destroy() β€” okay so this one is a function macro (yes, a macro, not a regular function, stay woke) that destroys the authentication information associated with auth. destruction usually involves deallocation of private data structures. and here's the scary part: the use of auth is undefined after calling auth_destroy(). undefined!! so like, do NOT touch it afterwards. it's gone. it's in the past. move on. πŸ’€
  • authnone_create() β€” create and return an RPC authentication handle that passes nonusable authentication information with each remote procedure call. and fun fact: this is the default authentication used by RPC. the default. the moment. the icon. πŸŽ€
  • authsys_create() β€” create and return an RPC authentication handle that contains AUTH_SYS authentication information. now let's break down the arguments, bestie, because there's a lot:
    • host β€” the name of the machine on which the information was created πŸ–₯️
    • uid β€” the user's user ID
    • gid β€” the user's current group ID
    • len and aup_gids β€” these two refer to a counted array of groups to which the user belongs. len is the count, aup_gids is the array. they're a package deal, you can't split them up, that's the rules 🫢
  • authsys_create_default() β€” literally just calls authsys_create() with the appropriate arguments. that's it. that's the whole job. lowkey the easiest one here, and honestly? slay. ✨

🌟 AVAILABILITY 🌟

these functions are part of libtirpc. πŸ§šβ€β™€οΈ


πŸ’œ SEE ALSO πŸ’œ

rpc(3), rpc_clnt_calls(3), rpc_clnt_create(3)

go read those too, bestie, they're all connected, it's giving ✨lore✨


and that's the page!! πŸŽ‰ this one came from Debian and it's dated May 7, 1993 β€” yes, 1993, this manual page is older than basically everyone you know and it's still running things. iconic behavior honestly. periodt. πŸ’…πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from