HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
r
rpc_soc(3N) rpc_soc(3N)
xdr_authunix_parms(XDR *
xdrs, struct authunix_parms *
aupp
);
DESCRIPTION
RPC routines allow C programs to make procedure calls on other machines across the network. First, the
client calls a procedure to send a request to the server. Upon receipt of the request, the server calls a
dispatch routine to perform the requested service, and then sends back a reply. Finally, the procedure
call returns to the client.
The routines described in this manpage have been superseded by other routines. The preferred routine is
given after the description of the routine. New programs should use the preferred routines, as support for
the older interfaces may be dropped in future releases.
The HP-UX implementation of RPC only supports the X/Open Transport Interface (XTI). Applications
that are written using the Transport Layer Interface (TLI) and wish to use RPC, must convert their appli-
cation to XTI.
File Descriptors
Transport independent RPC uses XTI as its transport interface instead of sockets.
Some of the routines described in this section (such as
clnttcp_create()
) take a pointer to a file
descriptor as one of the parameters. If the user wants the file descriptor to be a socket, then the applica-
tion will have to be linked with the RPC Socket Library (
-lrpcsoc). If the user passed
RPC_ANYSOCK
as the file descriptor, and the application is linked with the TI-RPC Library (-lnsl
) only, then the rou-
tine will return a TLI file descriptor and not a socket.
NOTE: The RPC Socket library is available only for 32 bit applications and will be obsoleted in a future
release.
Routines
The following routines require that the header
<rpc/rpc.h> be included. The symbol PORTMAP
should be defined so that the appropriate function declarations for the old interfaces are included through
the header files.
AUTH * authdes_create()
authdes_create() is the first of two routines which interface to the RPC secure authenti-
cation system, known as DES authentication. The second is
authdes_getucred(), below.
Note: the keyserver daemon keyserv (1M) must be running for the DES authentication system
to work.
authdes_create(), used on the client side, returns an authentication handle that will
enable the use of the secure authentication system. The first parameter name is the network
name, or netname, of the owner of the server process. This field usually represents a host-
name derived from the utility routine
host2netname()
, but could also represent a user
name using
user2netname()
(see secure_rpc (3N)). The second field is window on the vali-
dity 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 parameter syncaddr is optional. If it is NULL, then the authentica-
tion 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 parameter is usually the address of the RPC server itself. The final parameter ckey is
also optional. If it is NULL, 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.
Warning: this routine exists for backward compatibility only, and is obsoleted by
authdes_seccreate( ) (see secure_rpc (3N)).
AUTH * authunix_create()
Create and return an RPC authentication handle that contains UX authentication information.
The parameter host is the name of the machine on which the information was created; uid is
the user’s user ID; gid is the user’s current group ID; grouplen and gidlistp refer to a counted
array of groups to which the user belongs.
Warning: it is not very difficult to impersonate a user.
Section 3−−912 Hewlett-Packard Company − 2 − HP-UX 11i Version 2: September 2004