diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-01 19:31:17 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 09:15:16 -0500 |
commit | 7eaf040b720bc8c0ce5cd49151ca194ca2d56842 (patch) | |
tree | 85ea36dccdad8fed0da5e4e0277ecc3d47dc142b | |
parent | bf37f794372d5b8fda66702e1f3e70d4f07b6533 (diff) |
sunrpc: Use kuid_t and kgid_t where appropriate
Convert variables that store uids and gids to be of type
kuid_t and kgid_t instead of type uid_t and gid_t.
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r-- | include/linux/sunrpc/auth.h | 7 | ||||
-rw-r--r-- | include/linux/sunrpc/svcauth.h | 4 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 8 | ||||
-rw-r--r-- | net/sunrpc/auth_unix.c | 4 | ||||
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 8 |
5 files changed, 16 insertions, 15 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index f25ba922baaf..58fda1c3c783 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -17,14 +17,15 @@ | |||
17 | 17 | ||
18 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
19 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
20 | #include <linux/uidgid.h> | ||
20 | 21 | ||
21 | /* size of the nodename buffer */ | 22 | /* size of the nodename buffer */ |
22 | #define UNX_MAXNODENAME 32 | 23 | #define UNX_MAXNODENAME 32 |
23 | 24 | ||
24 | /* Work around the lack of a VFS credential */ | 25 | /* Work around the lack of a VFS credential */ |
25 | struct auth_cred { | 26 | struct auth_cred { |
26 | uid_t uid; | 27 | kuid_t uid; |
27 | gid_t gid; | 28 | kgid_t gid; |
28 | struct group_info *group_info; | 29 | struct group_info *group_info; |
29 | const char *principal; | 30 | const char *principal; |
30 | unsigned char machine_cred : 1; | 31 | unsigned char machine_cred : 1; |
@@ -48,7 +49,7 @@ struct rpc_cred { | |||
48 | unsigned long cr_flags; /* various flags */ | 49 | unsigned long cr_flags; /* various flags */ |
49 | atomic_t cr_count; /* ref count */ | 50 | atomic_t cr_count; /* ref count */ |
50 | 51 | ||
51 | uid_t cr_uid; | 52 | kuid_t cr_uid; |
52 | 53 | ||
53 | /* per-flavor data */ | 54 | /* per-flavor data */ |
54 | }; | 55 | }; |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index dd74084a9799..ff374ab30839 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/cred.h> | 18 | #include <linux/cred.h> |
19 | 19 | ||
20 | struct svc_cred { | 20 | struct svc_cred { |
21 | uid_t cr_uid; | 21 | kuid_t cr_uid; |
22 | gid_t cr_gid; | 22 | kgid_t cr_gid; |
23 | struct group_info *cr_group_info; | 23 | struct group_info *cr_group_info; |
24 | u32 cr_flavor; /* pseudoflavor */ | 24 | u32 cr_flavor; /* pseudoflavor */ |
25 | char *cr_principal; /* for gss */ | 25 | char *cr_principal; /* for gss */ |
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 6e5c824b040b..4daab81ca337 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -256,7 +256,7 @@ err: | |||
256 | 256 | ||
257 | struct gss_upcall_msg { | 257 | struct gss_upcall_msg { |
258 | atomic_t count; | 258 | atomic_t count; |
259 | uid_t uid; | 259 | kuid_t uid; |
260 | struct rpc_pipe_msg msg; | 260 | struct rpc_pipe_msg msg; |
261 | struct list_head list; | 261 | struct list_head list; |
262 | struct gss_auth *auth; | 262 | struct gss_auth *auth; |
@@ -303,7 +303,7 @@ gss_release_msg(struct gss_upcall_msg *gss_msg) | |||
303 | } | 303 | } |
304 | 304 | ||
305 | static struct gss_upcall_msg * | 305 | static struct gss_upcall_msg * |
306 | __gss_find_upcall(struct rpc_pipe *pipe, uid_t uid) | 306 | __gss_find_upcall(struct rpc_pipe *pipe, kuid_t uid) |
307 | { | 307 | { |
308 | struct gss_upcall_msg *pos; | 308 | struct gss_upcall_msg *pos; |
309 | list_for_each_entry(pos, &pipe->in_downcall, list) { | 309 | list_for_each_entry(pos, &pipe->in_downcall, list) { |
@@ -445,7 +445,7 @@ static void gss_encode_msg(struct gss_upcall_msg *gss_msg, | |||
445 | 445 | ||
446 | static struct gss_upcall_msg * | 446 | static struct gss_upcall_msg * |
447 | gss_alloc_msg(struct gss_auth *gss_auth, struct rpc_clnt *clnt, | 447 | gss_alloc_msg(struct gss_auth *gss_auth, struct rpc_clnt *clnt, |
448 | uid_t uid, const char *service_name) | 448 | kuid_t uid, const char *service_name) |
449 | { | 449 | { |
450 | struct gss_upcall_msg *gss_msg; | 450 | struct gss_upcall_msg *gss_msg; |
451 | int vers; | 451 | int vers; |
@@ -475,7 +475,7 @@ gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cr | |||
475 | struct gss_cred *gss_cred = container_of(cred, | 475 | struct gss_cred *gss_cred = container_of(cred, |
476 | struct gss_cred, gc_base); | 476 | struct gss_cred, gc_base); |
477 | struct gss_upcall_msg *gss_new, *gss_msg; | 477 | struct gss_upcall_msg *gss_new, *gss_msg; |
478 | uid_t uid = cred->cr_uid; | 478 | kuid_t uid = cred->cr_uid; |
479 | 479 | ||
480 | gss_new = gss_alloc_msg(gss_auth, clnt, uid, gss_cred->gc_principal); | 480 | gss_new = gss_alloc_msg(gss_auth, clnt, uid, gss_cred->gc_principal); |
481 | if (IS_ERR(gss_new)) | 481 | if (IS_ERR(gss_new)) |
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 2f8627082fa7..372d9156f6e3 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
@@ -18,8 +18,8 @@ | |||
18 | 18 | ||
19 | struct unx_cred { | 19 | struct unx_cred { |
20 | struct rpc_cred uc_base; | 20 | struct rpc_cred uc_base; |
21 | gid_t uc_gid; | 21 | kgid_t uc_gid; |
22 | gid_t uc_gids[NFS_NGROUPS]; | 22 | kgid_t uc_gids[NFS_NGROUPS]; |
23 | }; | 23 | }; |
24 | #define uc_uid uc_base.cr_uid | 24 | #define uc_uid uc_base.cr_uid |
25 | 25 | ||
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index c8cb5dc8d871..caae662f9fa3 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -415,7 +415,7 @@ svcauth_unix_info_release(struct svc_xprt *xpt) | |||
415 | 415 | ||
416 | struct unix_gid { | 416 | struct unix_gid { |
417 | struct cache_head h; | 417 | struct cache_head h; |
418 | uid_t uid; | 418 | kuid_t uid; |
419 | struct group_info *gi; | 419 | struct group_info *gi; |
420 | }; | 420 | }; |
421 | 421 | ||
@@ -475,7 +475,7 @@ static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h) | |||
475 | return sunrpc_cache_pipe_upcall(cd, h, unix_gid_request); | 475 | return sunrpc_cache_pipe_upcall(cd, h, unix_gid_request); |
476 | } | 476 | } |
477 | 477 | ||
478 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid); | 478 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, kuid_t uid); |
479 | 479 | ||
480 | static int unix_gid_parse(struct cache_detail *cd, | 480 | static int unix_gid_parse(struct cache_detail *cd, |
481 | char *mesg, int mlen) | 481 | char *mesg, int mlen) |
@@ -615,7 +615,7 @@ void unix_gid_cache_destroy(struct net *net) | |||
615 | cache_destroy_net(cd, net); | 615 | cache_destroy_net(cd, net); |
616 | } | 616 | } |
617 | 617 | ||
618 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid) | 618 | static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, kuid_t uid) |
619 | { | 619 | { |
620 | struct unix_gid ug; | 620 | struct unix_gid ug; |
621 | struct cache_head *ch; | 621 | struct cache_head *ch; |
@@ -628,7 +628,7 @@ static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid) | |||
628 | return NULL; | 628 | return NULL; |
629 | } | 629 | } |
630 | 630 | ||
631 | static struct group_info *unix_gid_find(uid_t uid, struct svc_rqst *rqstp) | 631 | static struct group_info *unix_gid_find(kuid_t uid, struct svc_rqst *rqstp) |
632 | { | 632 | { |
633 | struct unix_gid *ug; | 633 | struct unix_gid *ug; |
634 | struct group_info *gi; | 634 | struct group_info *gi; |