1.\" @(#)rpc_clnt_auth.3n 1.21 93/05/07 SMI; from SVr4 2.\" Copyright 1989 AT&T 3.\" @(#)rpc_clnt_auth 1.4 89/07/20 SMI; 4.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. 5.\" $NetBSD: rpc_clnt_auth.3,v 1.7 2020/10/03 18:31:29 christos Exp $ 6.Dd October 3, 2020 7.Dt RPC_CLNT_AUTH 3 8.Os 9.Sh NAME 10.Nm auth_destroy , 11.Nm authnone_create , 12.Nm authsys_create , 13.Nm authsys_create_default , 14.Nm set_rpc_maxgrouplist 15.Nd library routines for client side remote procedure call authentication 16.Sh LIBRARY 17.Lb libc 18.Sh SYNOPSIS 19.In rpc/rpc.h 20.Ft "void" 21.Fn auth_destroy "AUTH *auth" 22.Ft "AUTH *" 23.Fn authnone_create "void" 24.Ft "AUTH *" 25.Fn authsys_create "const char *host" "const uid_t uid" "const gid_t gid" "const int len" "const gid_t *aup_gids" 26.Ft "AUTH *" 27.Fn authsys_create_default "void" 28.Ft "void" 29.Fn set_rpc_maxgrouplist "int num" 30.Sh DESCRIPTION 31These routines are part of the 32RPC library that allows C language programs to make procedure 33calls on other machines across the network, 34with desired authentication. 35.Pp 36These routines are normally called after creating the 37.Dv CLIENT 38handle. 39The 40.Fa cl_auth 41field of the 42.Dv CLIENT 43structure should be initialized by the 44.Dv AUTH 45structure returned by some of the following routines. 46The client's authentication information 47is passed to the server when the 48RPC 49call is made. 50.Pp 51Only the 52.Dv NULL 53and the 54.Dv SYS 55style of authentication is discussed here. 56.Sh ROUTINES 57.Bl -tag -width authsys_create_default() 58.It Fn auth_destroy 59A function macro that destroys the authentication 60information associated with 61.Fa auth . 62Destruction usually involves deallocation 63of private data structures. 64The use of 65.Fn auth 66is undefined after calling 67.Fn auth_destroy . 68.Pp 69.It Fn authnone_create 70Create and return an RPC 71authentication handle that passes nonusable 72authentication information with each remote procedure call. 73This is the default authentication used by RPC. 74.Pp 75.It Fn authsys_create 76Create and return an RPC authentication handle that contains 77.Dv AUTH_SYS 78authentication information. 79The parameter 80.Fa host 81is the name of the machine on which the information was 82created; 83.Fa uid 84is the user's user ID; 85.Fa gid 86is the user's current group ID; 87.Fa len 88and 89.Fa aup_gids 90refer to a counted array of groups to which the user belongs. 91.Pp 92.It Fn authsys_create_default 93Call 94.Fn authsys_create 95with the appropriate parameters. 96.Pp 97.It Fn set_rpc_maxgrouplist 98Allow the application to set the maximum size of the group list 99that will be used in 100.Fn authunix_create_default to 101.Fa num . 102Some servers will refuse mounts if the group list is larger than it expects 103(like 8). 104.El 105.Sh SEE ALSO 106.Xr rpc 3 , 107.Xr rpc_clnt_calls 3 , 108.Xr rpc_clnt_create 3 109