diff --git a/sys/fs/umapfs/umap_subr.c b/sys/fs/umapfs/umap_subr.c index fc4d5eb4575a..14ecefb90e88 100644 --- a/sys/fs/umapfs/umap_subr.c +++ b/sys/fs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * - * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $ + * $Id: umap_subr.c,v 1.14 1998/08/16 01:21:51 bde Exp $ */ #include @@ -352,22 +352,18 @@ umap_mapids(v_mount, credp) struct mount *v_mount; struct ucred *credp; { - int i, unentries, gnentries; - u_long *groupmap, *usermap; + int i; uid_t uid; gid_t gid; if (credp == NOCRED) return; - unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries; - usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]); - gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries; - groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]); - /* Find uid entry in map */ - uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries); + uid = (uid_t) umap_findid(credp->cr_uid, + MOUNTTOUMAPMOUNT(v_mount)->info_mapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_nentries); if (uid != -1) credp->cr_uid = uid; @@ -379,7 +375,9 @@ umap_mapids(v_mount, credp) /* Find gid entry in map */ - gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries); + gid = (gid_t) umap_findid(credp->cr_gid, + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_gid = gid; @@ -393,7 +391,8 @@ umap_mapids(v_mount, credp) i = 0; while (credp->cr_groups[i] != 0) { gid = (gid_t) umap_findid(credp->cr_groups[i], - groupmap, gnentries); + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_groups[i++] = gid; diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c index fc4d5eb4575a..14ecefb90e88 100644 --- a/sys/miscfs/umapfs/umap_subr.c +++ b/sys/miscfs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * - * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $ + * $Id: umap_subr.c,v 1.14 1998/08/16 01:21:51 bde Exp $ */ #include @@ -352,22 +352,18 @@ umap_mapids(v_mount, credp) struct mount *v_mount; struct ucred *credp; { - int i, unentries, gnentries; - u_long *groupmap, *usermap; + int i; uid_t uid; gid_t gid; if (credp == NOCRED) return; - unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries; - usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]); - gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries; - groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]); - /* Find uid entry in map */ - uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries); + uid = (uid_t) umap_findid(credp->cr_uid, + MOUNTTOUMAPMOUNT(v_mount)->info_mapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_nentries); if (uid != -1) credp->cr_uid = uid; @@ -379,7 +375,9 @@ umap_mapids(v_mount, credp) /* Find gid entry in map */ - gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries); + gid = (gid_t) umap_findid(credp->cr_gid, + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_gid = gid; @@ -393,7 +391,8 @@ umap_mapids(v_mount, credp) i = 0; while (credp->cr_groups[i] != 0) { gid = (gid_t) umap_findid(credp->cr_groups[i], - groupmap, gnentries); + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_groups[i++] = gid;