RPC(3)
π NAME π
RPC(3) β from the Library Functions Manual. rpc_secure β library routines for secure remote procedure calls. Yes bestie, we're in secure RPC territory and it's lowkey iconic π
β¨ SYNOPSIS β¨
#include <rpc/rpc.h>
AUTH *
authdes_create(char *name, unsigned window, struct sockaddr *addr,
des_block *ckey);
int
authdes_getucred(struct authdes_cred *adc, uid_t *uid, gid_t *gid,
int *grouplen, gid_t *groups);
int
getnetname(char *name);
int
host2netname(char *name, const char *host, const char *domain);
int
key_decryptsession(const char *remotename, des_block *deskey);
int
key_encryptsession(const char *remotename, des_block *deskey);
int
key_gendes(des_block *deskey);
int
key_setsecret(const char *key);
int
netname2host(char *name, char *host, int hostlen);
int
netname2user(char *name, uid_t *uidp, gid_t *gidp, int *gidlenp,
gid_t *gidlist);
int
user2netname(char *name, const uid_t uid, const char *domain);
π§ DESCRIPTION π§
Okay so these routines are literally part of the RPC library. They implement DES Authentication. See rpc(3) for further details about RPC β that's your other bestie for the big picture π
authdes_create() is the first of two routines which interface to the RPC secure authentication system, known as DES authentication. The second is authdes_getucred(), below.
π Note: the keyserver daemon keyserv(8) must be running for the DES authentication system to work. No keyserv, no DES auth β simple as that, bestie.
authdes_create()β client-side queen. This function, used on the client side, returns an authentication handle that will enable the use of the secure authentication system. The first argumentnameis the network name, or netname, of the owner of the server process. This field usually represents a hostname derived from the utility routinehost2netname(), but could also represent a user name usinguser2netname(). The second field iswindowon the validity of the client credential, given in seconds. A small window is more secure than a large one, but choosing too small of a window will increase the frequency of resynchronizations because of clock drift. The third argumentaddris optional. If it isNULL, then the authentication system will assume that the local clock is always in sync with the server's clock, and will not attempt resynchronizations. If an address is supplied, however, then the system will use the address for consulting the remote time service whenever resynchronization is required. This argument is usually the address of the RPC server itself. The final argumentckeyis also optional. If it isNULL, then the authentication system will generate a random DES key to be used for the encryption of credentials. If it is supplied, however, then it will be used instead.authdes_getucred()β the second of the two DES authentication routines, used on the server side for converting a DES credential, which is operating system independent, into a Unix credential. This routine differs from utility routinenetname2user()in thatauthdes_getucred()pulls its information from a cache, and does not have to do a Yellow Pages lookup every time it is called to get its information. Cache queen behavior, honestly β¨getnetname()β installs the unique, operating-system independent netname of the caller in the fixed-length arrayname. ReturnsTRUEif it succeeds andFALSEif it fails.host2netname()β converts from a domain-specific hostname to an operating-system independent netname. ReturnsTRUEif it succeeds andFALSEif it fails. Inverse ofnetname2host().key_decryptsession()β interface to the keyserver daemon, which is associated with RPC's secure authentication system (DES authentication). User programs rarely need to call it, or its associated routineskey_encryptsession(),key_gendes()andkey_setsecret(). System commands such aslogin(1)and the RPC library are the main clients of these four routines. It takes a server netname and a DES key, and decrypts the key by using the public key of the server and the secret key associated with the effective uid of the calling process. It is the inverse ofkey_encryptsession().key_encryptsession()β keyserver interface routine. It takes a server netname and a des key, and encrypts it using the public key of the server and the secret key associated with the effective uid of the calling process. It is the inverse ofkey_decryptsession().key_gendes()β keyserver interface routine. It is used to ask the keyserver for a secure conversation key. Choosing one "random" is usually not good enough, because the common ways of choosing random numbers, such as using the current time, are very easy to guess. Do not just vibe-pick a key, bestie πkey_setsecret()β keyserver interface routine. It is used to set the key for the effective uid of the calling process.netname2host()β converts from an operating-system independent netname to a domain-specific hostname. ReturnsTRUEif it succeeds andFALSEif it fails. Inverse ofhost2netname().netname2user()β converts from an operating-system independent netname to a domain-specific user ID. ReturnsTRUEif it succeeds andFALSEif it fails. Inverse ofuser2netname().user2netname()β converts from a domain-specific username to an operating-system independent netname. ReturnsTRUEif it succeeds andFALSEif it fails. Inverse ofnetname2user().
π SEE ALSO π
The following manuals:
- Remote Procedure Calls: Protocol Specification.
- Remote Procedure Call Programming Guide.
- Rpcgen Programming Guide.
- RPC: Remote Procedure Call Protocol Specification, RFC1050, Sun Microsystems Inc., USC-ISI.
Okay bestie, that's the whole RPC(3) Library Functions Manual page β from Debian, dated February 16, 1988, and it's literally the RPC(3) manual page. Go secure those RPCs, mwah πβ¨π«Ά
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms