diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_unix.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 8365a9cade98..9f3885745fb3 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
@@ -79,11 +79,8 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
79 | groups = NFS_NGROUPS; | 79 | groups = NFS_NGROUPS; |
80 | 80 | ||
81 | cred->uc_gid = acred->gid; | 81 | cred->uc_gid = acred->gid; |
82 | for (i = 0; i < groups; i++) { | 82 | for (i = 0; i < groups; i++) |
83 | gid_t gid; | 83 | cred->uc_gids[i] = GROUP_AT(acred->group_info, i); |
84 | gid = from_kgid(&init_user_ns, GROUP_AT(acred->group_info, i)); | ||
85 | cred->uc_gids[i] = gid; | ||
86 | } | ||
87 | if (i < NFS_NGROUPS) | 84 | if (i < NFS_NGROUPS) |
88 | cred->uc_gids[i] = INVALID_GID; | 85 | cred->uc_gids[i] = INVALID_GID; |
89 | 86 | ||
@@ -130,12 +127,9 @@ unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags) | |||
130 | groups = acred->group_info->ngroups; | 127 | groups = acred->group_info->ngroups; |
131 | if (groups > NFS_NGROUPS) | 128 | if (groups > NFS_NGROUPS) |
132 | groups = NFS_NGROUPS; | 129 | groups = NFS_NGROUPS; |
133 | for (i = 0; i < groups ; i++) { | 130 | for (i = 0; i < groups ; i++) |
134 | gid_t gid; | 131 | if (!gid_eq(cred->uc_gids[i], GROUP_AT(acred->group_info, i))) |
135 | gid = from_kgid(&init_user_ns, GROUP_AT(acred->group_info, i)); | ||
136 | if (cred->uc_gids[i] != gid) | ||
137 | return 0; | 132 | return 0; |
138 | } | ||
139 | if (groups < NFS_NGROUPS && | 133 | if (groups < NFS_NGROUPS && |
140 | cred->uc_gids[groups] != INVALID_GID) | 134 | cred->uc_gids[groups] != INVALID_GID) |
141 | return 0; | 135 | return 0; |