Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Oct 2012 03:44:24 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241152 - head/lib/libc/rpc
Message-ID:  <201210030344.q933iOdn054463@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Wed Oct  3 03:44:23 2012
New Revision: 241152
URL: http://svn.freebsd.org/changeset/base/241152

Log:
  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

Modified:
  head/lib/libc/rpc/authunix_prot.c

Modified: head/lib/libc/rpc/authunix_prot.c
==============================================================================
--- head/lib/libc/rpc/authunix_prot.c	Wed Oct  3 03:00:37 2012	(r241151)
+++ head/lib/libc/rpc/authunix_prot.c	Wed Oct  3 03:44:23 2012	(r241152)
@@ -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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210030344.q933iOdn054463>