rpc: convert all uid and gid variables of the type uid_t and gid_t.

As part of the previous commit, uses of xdr_int() were replaced
with xdr_u_int(). This has undesired effects as the second
argument doesn't match exactly uid_t or gid_t. It also breaks
assumptions in the size of the provided types.

To work around those issues we revert back to the use of xdr_int()
but provide proper casting so the behaviour doesn't change.

While here fix a style issue in the affected lines.

Reported by:	bde
This commit is contained in:
Pedro F. Giffuni 2012-10-03 03:44:23 +00:00
parent 2a357efa9c
commit e9f7ad1fa4

View File

@ -67,11 +67,11 @@ xdr_authunix_parms(xdrs, p)
paup_gids = &p->aup_gids;
if (xdr_u_long(xdrs, &(p->aup_time))
&& xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
&& xdr_u_int(xdrs, &(p->aup_uid))
&& xdr_u_int(xdrs, &(p->aup_gid))
&& xdr_array(xdrs, (char **) paup_gids,
if (xdr_u_long(xdrs, &(p->aup_time)) &&
xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
xdr_int(xdrs, (int *) &(p->aup_uid)) &&
xdr_int(xdrs, (int *) &(p->aup_gid)) &&
xdr_array(xdrs, (char **) paup_gids,
&(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) {
return (TRUE);
}