aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-02-06 03:57:56 -0500
committerEric W. Biederman <ebiederm@xmission.com>2013-02-13 10:28:49 -0500
commit49418b2c28c901294f8b36ff14c766c9458c3623 (patch)
tree134dabb2d9f0b0662d64feebc0fd667e63a3762f /fs/cifs/cifssmb.c
parentdbfb98af18194cff87d4c1dea8d43faf14eae2e7 (diff)
cifs: Modify struct cifs_unix_set_info_args to hold a kuid_t and a kgid_t
Use INVALID_UID and INVALID_GID instead of NO_CHANGE_64 to indicate the value should not be changed. In cifs_fill_unix_set_info convert from kuids and kgids into uids and gids that will fit in FILE_UNIX_BASIC_INFO. Cc: Steve French <smfrench@gmail.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 76d0d2998850..00e12f2d626b 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -5819,8 +5819,14 @@ static void
5819cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset, 5819cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
5820 const struct cifs_unix_set_info_args *args) 5820 const struct cifs_unix_set_info_args *args)
5821{ 5821{
5822 u64 uid = NO_CHANGE_64, gid = NO_CHANGE_64;
5822 u64 mode = args->mode; 5823 u64 mode = args->mode;
5823 5824
5825 if (uid_valid(args->uid))
5826 uid = from_kuid(&init_user_ns, args->uid);
5827 if (gid_valid(args->gid))
5828 gid = from_kgid(&init_user_ns, args->gid);
5829
5824 /* 5830 /*
5825 * Samba server ignores set of file size to zero due to bugs in some 5831 * Samba server ignores set of file size to zero due to bugs in some
5826 * older clients, but we should be precise - we use SetFileSize to 5832 * older clients, but we should be precise - we use SetFileSize to
@@ -5833,8 +5839,8 @@ cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
5833 data_offset->LastStatusChange = cpu_to_le64(args->ctime); 5839 data_offset->LastStatusChange = cpu_to_le64(args->ctime);
5834 data_offset->LastAccessTime = cpu_to_le64(args->atime); 5840 data_offset->LastAccessTime = cpu_to_le64(args->atime);
5835 data_offset->LastModificationTime = cpu_to_le64(args->mtime); 5841 data_offset->LastModificationTime = cpu_to_le64(args->mtime);
5836 data_offset->Uid = cpu_to_le64(args->uid); 5842 data_offset->Uid = cpu_to_le64(uid);
5837 data_offset->Gid = cpu_to_le64(args->gid); 5843 data_offset->Gid = cpu_to_le64(gid);
5838 /* better to leave device as zero when it is */ 5844 /* better to leave device as zero when it is */
5839 data_offset->DevMajor = cpu_to_le64(MAJOR(args->device)); 5845 data_offset->DevMajor = cpu_to_le64(MAJOR(args->device));
5840 data_offset->DevMinor = cpu_to_le64(MINOR(args->device)); 5846 data_offset->DevMinor = cpu_to_le64(MINOR(args->device));