Deleted Added
full compact
svc_auth_unix.c (184588) svc_auth_unix.c (194498)
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * Mountain View, California 94043
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char *sccsid2 = "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro";
32static char *sccsid = "@(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC";
33#endif
34#include <sys/cdefs.h>
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

--- 18 unchanged lines hidden (view full) ---

27 * Mountain View, California 94043
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char *sccsid2 = "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro";
32static char *sccsid = "@(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC";
33#endif
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/rpc/svc_auth_unix.c 184588 2008-11-03 10:38:00Z dfr $");
35__FBSDID("$FreeBSD: head/sys/rpc/svc_auth_unix.c 194498 2009-06-19 17:10:35Z brooks $");
36
37/*
38 * svc_auth_unix.c
39 * Handles UNIX flavor authentication parameters on the service side of rpc.
40 * There are two svc auth implementations here: AUTH_UNIX and AUTH_SHORT.
41 * _svcauth_unix does full blown unix style uid,gid+gids auth,
42 * _svcauth_short uses a shorthand auth to index into a cache of longhand auths.
43 * Note: the shorthand has been gutted for efficiency.

--- 46 unchanged lines hidden (view full) ---

90 xcr->cr_uid = IXDR_GET_UINT32(buf);
91 xcr->cr_groups[0] = IXDR_GET_UINT32(buf);
92 gid_len = (size_t)IXDR_GET_UINT32(buf);
93 if (gid_len > NGRPS) {
94 stat = AUTH_BADCRED;
95 goto done;
96 }
97 for (i = 0; i < gid_len; i++) {
36
37/*
38 * svc_auth_unix.c
39 * Handles UNIX flavor authentication parameters on the service side of rpc.
40 * There are two svc auth implementations here: AUTH_UNIX and AUTH_SHORT.
41 * _svcauth_unix does full blown unix style uid,gid+gids auth,
42 * _svcauth_short uses a shorthand auth to index into a cache of longhand auths.
43 * Note: the shorthand has been gutted for efficiency.

--- 46 unchanged lines hidden (view full) ---

90 xcr->cr_uid = IXDR_GET_UINT32(buf);
91 xcr->cr_groups[0] = IXDR_GET_UINT32(buf);
92 gid_len = (size_t)IXDR_GET_UINT32(buf);
93 if (gid_len > NGRPS) {
94 stat = AUTH_BADCRED;
95 goto done;
96 }
97 for (i = 0; i < gid_len; i++) {
98 if (i + 1 < NGROUPS)
98 if (i + 1 < XU_NGROUPS)
99 xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf);
100 else
101 buf++;
102 }
99 xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf);
100 else
101 buf++;
102 }
103 if (gid_len + 1 > NGROUPS)
104 xcr->cr_ngroups = NGROUPS;
103 if (gid_len + 1 > XU_NGROUPS)
104 xcr->cr_ngroups = XU_NGROUPS;
105 else
106 xcr->cr_ngroups = gid_len + 1;
107
108 /*
109 * five is the smallest unix credentials structure -
110 * timestamp, hostname len (0), uid, gid, and gids len (0).
111 */
112 if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) {

--- 31 unchanged lines hidden ---
105 else
106 xcr->cr_ngroups = gid_len + 1;
107
108 /*
109 * five is the smallest unix credentials structure -
110 * timestamp, hostname len (0), uid, gid, and gids len (0).
111 */
112 if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) {

--- 31 unchanged lines hidden ---