From owner-svn-src-stable@FreeBSD.ORG Sun Oct 7 05:11:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECFD2106566C; Sun, 7 Oct 2012 05:11:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52E08FC0A; Sun, 7 Oct 2012 05:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q975BT9c023809; Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q975BTMo023801; Sun, 7 Oct 2012 05:11:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201210070511.q975BTMo023801@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 7 Oct 2012 05:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241309 - in stable/9: include/rpc lib/libc/rpc sys/rpc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 05:11:30 -0000 Author: pfg Date: Sun Oct 7 05:11:29 2012 New Revision: 241309 URL: http://svn.freebsd.org/changeset/base/241309 Log: MFC r241141, r241165, r241165, r241181; rpc: convert all uid and gid variables to u_int. Follow a similar change in Solaris and linux where the uid and gid variables were made more similar to what the system expects. In our case we use u_int which is what XDR can manage, Reviewed by: bde Modified: stable/9/include/rpc/auth.h stable/9/include/rpc/auth_unix.h stable/9/lib/libc/rpc/auth_unix.c stable/9/lib/libc/rpc/authunix_prot.c stable/9/lib/libc/rpc/rpc_soc.3 stable/9/lib/libc/rpc/svc_auth_unix.c stable/9/sys/rpc/auth.h Modified: stable/9/include/rpc/auth.h ============================================================================== --- stable/9/include/rpc/auth.h Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/include/rpc/auth.h Sun Oct 7 05:11:29 2012 (r241309) @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * u_int uid; + * u_int gid; * int len; - * int *aup_gids; + * u_int *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS Modified: stable/9/include/rpc/auth_unix.h ============================================================================== --- stable/9/include/rpc/auth_unix.h Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/include/rpc/auth_unix.h Sun Oct 7 05:11:29 2012 (r241309) @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + u_int aup_uid; + u_int aup_gid; u_int aup_len; - int *aup_gids; + u_int *aup_gids; }; #define authsys_parms authunix_parms Modified: stable/9/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/9/lib/libc/rpc/auth_unix.c Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/lib/libc/rpc/auth_unix.c Sun Oct 7 05:11:29 2012 (r241309) @@ -94,10 +94,10 @@ struct audata { AUTH * authunix_create(machname, uid, gid, len, aup_gids) char *machname; - int uid; - int gid; + u_int uid; + u_int gid; int len; - int *aup_gids; + u_int *aup_gids; { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -189,9 +189,9 @@ authunix_create_default() int ngids; long ngids_max; char machname[MAXHOSTNAMELEN + 1]; - uid_t uid; - gid_t gid; - gid_t *gids; + u_int uid; + u_int gid; + u_int *gids; ngids_max = sysconf(_SC_NGROUPS_MAX) + 1; gids = malloc(sizeof(gid_t) * ngids_max); @@ -207,9 +207,8 @@ authunix_create_default() abort(); if (ngids > NGRPS) ngids = NGRPS; - /* XXX: interface problem; those should all have been unsigned */ - auth = authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids); + /* XXX: interface problem; we should translate from uid_t and gid_t */ + auth = authunix_create(machname, uid, gid, ngids, gids); free(gids); return (auth); } Modified: stable/9/lib/libc/rpc/authunix_prot.c ============================================================================== --- stable/9/lib/libc/rpc/authunix_prot.c Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/lib/libc/rpc/authunix_prot.c Sun Oct 7 05:11:29 2012 (r241309) @@ -60,19 +60,19 @@ xdr_authunix_parms(xdrs, p) XDR *xdrs; struct authunix_parms *p; { - int **paup_gids; + u_int **paup_gids; assert(xdrs != NULL); assert(p != NULL); paup_gids = &p->aup_gids; - if (xdr_u_long(xdrs, &(p->aup_time)) - && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) - && xdr_int(xdrs, &(p->aup_uid)) - && xdr_int(xdrs, &(p->aup_gid)) - && xdr_array(xdrs, (char **) paup_gids, - &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) { + 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, + &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) { return (TRUE); } return (FALSE); Modified: stable/9/lib/libc/rpc/rpc_soc.3 ============================================================================== --- stable/9/lib/libc/rpc/rpc_soc.3 Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/lib/libc/rpc/rpc_soc.3 Sun Oct 7 05:11:29 2012 (r241309) @@ -148,7 +148,7 @@ default authentication used by .Ft "AUTH *" .Xc .It Xo -.Fn authunix_create "char *host" "int uid" "int gid" "int len" "int *aup_gids" +.Fn authunix_create "char *host" "u_int uid" "u_int gid" "int len" "u_int *aup_gids" .Xc .Pp Create and return an Modified: stable/9/lib/libc/rpc/svc_auth_unix.c ============================================================================== --- stable/9/lib/libc/rpc/svc_auth_unix.c Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/lib/libc/rpc/svc_auth_unix.c Sun Oct 7 05:11:29 2012 (r241309) @@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg) struct area { struct authunix_parms area_aup; char area_machname[MAX_MACHINE_NAME+1]; - int area_gids[NGRPS]; + u_int area_gids[NGRPS]; } *area; u_int auth_len; size_t str_len, gid_len; Modified: stable/9/sys/rpc/auth.h ============================================================================== --- stable/9/sys/rpc/auth.h Sun Oct 7 02:08:19 2012 (r241308) +++ stable/9/sys/rpc/auth.h Sun Oct 7 05:11:29 2012 (r241309) @@ -234,18 +234,17 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * u_int uid; + * u_int gid; * int len; - * int *aup_gids; + * u_int *aup_gids; */ __BEGIN_DECLS #ifdef _KERNEL struct ucred; extern AUTH *authunix_create(struct ucred *); #else -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *); extern AUTH *authunix_create_default(void); /* takes no parameters */ #endif extern AUTH *authnone_create(void); /* takes no parameters */