^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * linux/net/sunrpc/auth_unix.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * UNIX-style authentication; no AUTH_SHORT support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/mempool.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/sunrpc/clnt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/sunrpc/auth.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/user_namespace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) # define RPCDBG_FACILITY RPCDBG_AUTH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) static struct rpc_auth unix_auth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) static const struct rpc_credops unix_credops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static mempool_t *unix_pool;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) static struct rpc_auth *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) unx_create(const struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) refcount_inc(&unix_auth.au_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) return &unix_auth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unx_destroy(struct rpc_auth *auth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * Lookup AUTH_UNIX creds for current process
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) static struct rpc_cred *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) unx_lookup_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct rpc_cred *ret = mempool_alloc(unix_pool, GFP_NOFS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) rpcauth_init_cred(ret, acred, auth, &unix_credops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ret->cr_flags = 1UL << RPCAUTH_CRED_UPTODATE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unx_free_cred_callback(struct rcu_head *head)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) struct rpc_cred *rpc_cred = container_of(head, struct rpc_cred, cr_rcu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) put_cred(rpc_cred->cr_cred);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) mempool_free(rpc_cred, unix_pool);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) unx_destroy_cred(struct rpc_cred *cred)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) call_rcu(&cred->cr_rcu, unx_free_cred_callback);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * Match credentials against current the auth_cred.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) unx_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) unsigned int groups = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) unsigned int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) if (cred->cr_cred == acred->cred)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) if (!uid_eq(cred->cr_cred->fsuid, acred->cred->fsuid) || !gid_eq(cred->cr_cred->fsgid, acred->cred->fsgid))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) if (acred->cred->group_info != NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) groups = acred->cred->group_info->ngroups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) if (groups > UNX_NGROUPS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) groups = UNX_NGROUPS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) if (cred->cr_cred->group_info == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) return groups == 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) if (groups != cred->cr_cred->group_info->ngroups)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) for (i = 0; i < groups ; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) if (!gid_eq(cred->cr_cred->group_info->gid[i], acred->cred->group_info->gid[i]))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * Marshal credentials.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * Maybe we should keep a cached credential for performance reasons.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) unx_marshal(struct rpc_task *task, struct xdr_stream *xdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct rpc_clnt *clnt = task->tk_client;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) struct rpc_cred *cred = task->tk_rqstp->rq_cred;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) __be32 *p, *cred_len, *gidarr_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct group_info *gi = cred->cr_cred->group_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) struct user_namespace *userns = clnt->cl_cred ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) clnt->cl_cred->user_ns : &init_user_ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /* Credential */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) p = xdr_reserve_space(xdr, 3 * sizeof(*p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) goto marshal_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) *p++ = rpc_auth_unix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) cred_len = p++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) *p++ = xdr_zero; /* stamp */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) if (xdr_stream_encode_opaque(xdr, clnt->cl_nodename,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) clnt->cl_nodelen) < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) goto marshal_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) p = xdr_reserve_space(xdr, 3 * sizeof(*p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) goto marshal_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) *p++ = cpu_to_be32(from_kuid_munged(userns, cred->cr_cred->fsuid));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) *p++ = cpu_to_be32(from_kgid_munged(userns, cred->cr_cred->fsgid));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) gidarr_len = p++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) if (gi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) for (i = 0; i < UNX_NGROUPS && i < gi->ngroups; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) *p++ = cpu_to_be32(from_kgid_munged(userns, gi->gid[i]));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) *gidarr_len = cpu_to_be32(p - gidarr_len - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) *cred_len = cpu_to_be32((p - cred_len - 1) << 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) p = xdr_reserve_space(xdr, (p - gidarr_len - 1) << 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) goto marshal_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) /* Verifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) p = xdr_reserve_space(xdr, 2 * sizeof(*p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) goto marshal_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) *p++ = rpc_auth_null;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) *p = xdr_zero;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) marshal_failed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) return -EMSGSIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * Refresh credentials. This is a no-op for AUTH_UNIX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) unx_refresh(struct rpc_task *task)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_rqstp->rq_cred->cr_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) static int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) unx_validate(struct rpc_task *task, struct xdr_stream *xdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) struct rpc_auth *auth = task->tk_rqstp->rq_cred->cr_auth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) __be32 *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) u32 size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) p = xdr_inline_decode(xdr, 2 * sizeof(*p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) switch (*p++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) case rpc_auth_null:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) case rpc_auth_unix:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) case rpc_auth_short:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) size = be32_to_cpup(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) if (size > RPC_MAX_AUTH_SIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) p = xdr_inline_decode(xdr, size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) if (!p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) auth->au_verfsize = XDR_QUADLEN(size) + 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) auth->au_rslack = XDR_QUADLEN(size) + 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) auth->au_ralign = XDR_QUADLEN(size) + 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) int __init rpc_init_authunix(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) unix_pool = mempool_create_kmalloc_pool(16, sizeof(struct rpc_cred));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) return unix_pool ? 0 : -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) void rpc_destroy_authunix(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) mempool_destroy(unix_pool);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) const struct rpc_authops authunix_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) .owner = THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) .au_flavor = RPC_AUTH_UNIX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) .au_name = "UNIX",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) .create = unx_create,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) .destroy = unx_destroy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) .lookup_cred = unx_lookup_cred,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) static
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) struct rpc_auth unix_auth = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) .au_cslack = UNX_CALLSLACK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) .au_rslack = NUL_REPLYSLACK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) .au_verfsize = NUL_REPLYSLACK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) .au_ops = &authunix_ops,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) .au_flavor = RPC_AUTH_UNIX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) .au_count = REFCOUNT_INIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) const struct rpc_credops unix_credops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) .cr_name = "AUTH_UNIX",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) .crdestroy = unx_destroy_cred,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) .crmatch = unx_match,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) .crmarshal = unx_marshal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) .crwrap_req = rpcauth_wrap_req_encode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) .crrefresh = unx_refresh,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) .crvalidate = unx_validate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) .crunwrap_resp = rpcauth_unwrap_resp_decode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) };