summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2012-10-04 04:15:18 +0000
committerpfg <pfg@FreeBSD.org>2012-10-04 04:15:18 +0000
commit322c7845daaf5e5e0b96fabc9be3aef6573373db (patch)
tree2cf66142fc4c43a21adf47bce41c08fbc273ddce /lib/libc
parent78ead1fc05f7b05f6c80890e0f31ec772ad76487 (diff)
downloadFreeBSD-src-322c7845daaf5e5e0b96fabc9be3aef6573373db.zip
FreeBSD-src-322c7845daaf5e5e0b96fabc9be3aef6573373db.tar.gz
rpc: convert all uid and gid variables to u_int.
After further discussion, instead of pretending to use uid_t and gid_t as upstream Solaris and linux try to, we are better using u_int, which is in fact what the code can handle and best approaches the range of values used by uid and gid. Discussed with: bde Reviewed by: bde
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/rpc/auth_unix.c7
-rw-r--r--lib/libc/rpc/authunix_prot.c4
-rw-r--r--lib/libc/rpc/rpc_soc.32
-rw-r--r--lib/libc/rpc/svc_auth_unix.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c
index 4d7a89b..5c138d0 100644
--- a/lib/libc/rpc/auth_unix.c
+++ b/lib/libc/rpc/auth_unix.c
@@ -94,10 +94,10 @@ struct audata {
AUTH *
authunix_create(machname, uid, gid, len, aup_gids)
char *machname;
- uid_t uid;
- gid_t gid;
+ u_int uid;
+ u_int gid;
int len;
- gid_t *aup_gids;
+ u_int *aup_gids;
{
struct authunix_parms aup;
char mymem[MAX_AUTH_BYTES];
@@ -207,6 +207,7 @@ authunix_create_default()
abort();
if (ngids > NGRPS)
ngids = NGRPS;
+ /* XXX: interface problem; we should translate from uid_t and gid_t */
auth = authunix_create(machname, uid, gid, ngids, gids);
free(gids);
return (auth);
diff --git a/lib/libc/rpc/authunix_prot.c b/lib/libc/rpc/authunix_prot.c
index 36311e8..f80b176 100644
--- a/lib/libc/rpc/authunix_prot.c
+++ b/lib/libc/rpc/authunix_prot.c
@@ -60,7 +60,7 @@ xdr_authunix_parms(xdrs, p)
XDR *xdrs;
struct authunix_parms *p;
{
- gid_t **paup_gids;
+ u_int **paup_gids;
assert(xdrs != NULL);
assert(p != NULL);
@@ -72,7 +72,7 @@ xdr_authunix_parms(xdrs, p)
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(gid_t), (xdrproc_t)xdr_int) ) {
+ &(p->aup_len), NGRPS, sizeof(u_int), (xdrproc_t)xdr_u_int) ) {
return (TRUE);
}
return (FALSE);
diff --git a/lib/libc/rpc/rpc_soc.3 b/lib/libc/rpc/rpc_soc.3
index a049a83..1af5728 100644
--- a/lib/libc/rpc/rpc_soc.3
+++ b/lib/libc/rpc/rpc_soc.3
@@ -148,7 +148,7 @@ default authentication used by
.Ft "AUTH *"
.Xc
.It Xo
-.Fn authunix_create "char *host" "uid_t uid" "gid_t gid" "int len" "gid_t *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
diff --git a/lib/libc/rpc/svc_auth_unix.c b/lib/libc/rpc/svc_auth_unix.c
index f889d81..20d4ecc 100644
--- a/lib/libc/rpc/svc_auth_unix.c
+++ b/lib/libc/rpc/svc_auth_unix.c
@@ -68,7 +68,7 @@ _svcauth_unix(rqst, msg)
struct area {
struct authunix_parms area_aup;
char area_machname[MAX_MACHINE_NAME+1];
- gid_t area_gids[NGRPS];
+ u_int area_gids[NGRPS];
} *area;
u_int auth_len;
size_t str_len, gid_len;
OpenPOWER on IntegriCloud