diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-06 04:20:20 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-13 10:28:54 -0500 |
commit | 1f68233c52e9f2bb53130a0063bc1e6864f6d204 (patch) | |
tree | af84a80e7ad103bf674cbc8c8a8f3ad38915bd31 | |
parent | 3da46565043a3d7b9fd5c924e7de2d3e65e9d2a9 (diff) |
cifs: Convert struct cifs_sb_info to use kuids and kgids
Cc: Steve French <smfrench@gmail.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r-- | fs/cifs/cifs_fs_sb.h | 8 | ||||
-rw-r--r-- | fs/cifs/cifsfs.c | 14 | ||||
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/misc.c | 2 |
4 files changed, 16 insertions, 10 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index c865bfdfe819..37e4a72a7d1c 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h | |||
@@ -55,10 +55,10 @@ struct cifs_sb_info { | |||
55 | unsigned int wsize; | 55 | unsigned int wsize; |
56 | unsigned long actimeo; /* attribute cache timeout (jiffies) */ | 56 | unsigned long actimeo; /* attribute cache timeout (jiffies) */ |
57 | atomic_t active; | 57 | atomic_t active; |
58 | uid_t mnt_uid; | 58 | kuid_t mnt_uid; |
59 | gid_t mnt_gid; | 59 | kgid_t mnt_gid; |
60 | uid_t mnt_backupuid; | 60 | kuid_t mnt_backupuid; |
61 | gid_t mnt_backupgid; | 61 | kgid_t mnt_backupgid; |
62 | umode_t mnt_file_mode; | 62 | umode_t mnt_file_mode; |
63 | umode_t mnt_dir_mode; | 63 | umode_t mnt_dir_mode; |
64 | unsigned int mnt_cifs_flags; | 64 | unsigned int mnt_cifs_flags; |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index f653835d067b..17590731786d 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -376,13 +376,15 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
376 | (int)(srcaddr->sa_family)); | 376 | (int)(srcaddr->sa_family)); |
377 | } | 377 | } |
378 | 378 | ||
379 | seq_printf(s, ",uid=%u", cifs_sb->mnt_uid); | 379 | seq_printf(s, ",uid=%u", |
380 | from_kuid_munged(&init_user_ns, cifs_sb->mnt_uid)); | ||
380 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) | 381 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) |
381 | seq_printf(s, ",forceuid"); | 382 | seq_printf(s, ",forceuid"); |
382 | else | 383 | else |
383 | seq_printf(s, ",noforceuid"); | 384 | seq_printf(s, ",noforceuid"); |
384 | 385 | ||
385 | seq_printf(s, ",gid=%u", cifs_sb->mnt_gid); | 386 | seq_printf(s, ",gid=%u", |
387 | from_kgid_munged(&init_user_ns, cifs_sb->mnt_gid)); | ||
386 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) | 388 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) |
387 | seq_printf(s, ",forcegid"); | 389 | seq_printf(s, ",forcegid"); |
388 | else | 390 | else |
@@ -437,9 +439,13 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
437 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) | 439 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) |
438 | seq_printf(s, ",noperm"); | 440 | seq_printf(s, ",noperm"); |
439 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) | 441 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) |
440 | seq_printf(s, ",backupuid=%u", cifs_sb->mnt_backupuid); | 442 | seq_printf(s, ",backupuid=%u", |
443 | from_kuid_munged(&init_user_ns, | ||
444 | cifs_sb->mnt_backupuid)); | ||
441 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) | 445 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) |
442 | seq_printf(s, ",backupgid=%u", cifs_sb->mnt_backupgid); | 446 | seq_printf(s, ",backupgid=%u", |
447 | from_kgid_munged(&init_user_ns, | ||
448 | cifs_sb->mnt_backupgid)); | ||
443 | 449 | ||
444 | seq_printf(s, ",rsize=%u", cifs_sb->rsize); | 450 | seq_printf(s, ",rsize=%u", cifs_sb->rsize); |
445 | seq_printf(s, ",wsize=%u", cifs_sb->wsize); | 451 | seq_printf(s, ",wsize=%u", cifs_sb->wsize); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9bd13a75602d..01279b8f5d1f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2743,7 +2743,7 @@ compare_mount_options(struct super_block *sb, struct cifs_mnt_data *mnt_data) | |||
2743 | if (new->rsize && new->rsize < old->rsize) | 2743 | if (new->rsize && new->rsize < old->rsize) |
2744 | return 0; | 2744 | return 0; |
2745 | 2745 | ||
2746 | if (old->mnt_uid != new->mnt_uid || old->mnt_gid != new->mnt_gid) | 2746 | if (!uid_eq(old->mnt_uid, new->mnt_uid) || !gid_eq(old->mnt_gid, new->mnt_gid)) |
2747 | return 0; | 2747 | return 0; |
2748 | 2748 | ||
2749 | if (old->mnt_file_mode != new->mnt_file_mode || | 2749 | if (old->mnt_file_mode != new->mnt_file_mode || |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 3a00c0d0cead..1b15bf839f37 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -569,7 +569,7 @@ bool | |||
569 | backup_cred(struct cifs_sb_info *cifs_sb) | 569 | backup_cred(struct cifs_sb_info *cifs_sb) |
570 | { | 570 | { |
571 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) { | 571 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) { |
572 | if (cifs_sb->mnt_backupuid == current_fsuid()) | 572 | if (uid_eq(cifs_sb->mnt_backupuid, current_fsuid())) |
573 | return true; | 573 | return true; |
574 | } | 574 | } |
575 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) { | 575 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) { |