From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #5)
Date: Thu, 7 Oct 2010 14:46:28 -0400 [thread overview]
Message-ID: <1286477188-26681-1-git-send-email-jlayton@redhat.com> (raw)
...when unix extensions aren't enabled. This makes everything on the
mount appear to be owned by the current user.
This version of the patch differs from previous versions however in that
the admin can still force the ownership of all files to appear as a
single user via the uid=/gid= options.
Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
fs/cifs/inode.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index dcd0886..7cf3d93 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1761,11 +1761,21 @@ check_inval:
int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat)
{
+ struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb);
+ struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
int err = cifs_revalidate_dentry(dentry);
+
if (!err) {
generic_fillattr(dentry->d_inode, stat);
stat->blksize = CIFS_MAX_MSGSIZE;
stat->ino = CIFS_I(dentry->d_inode)->uniqueid;
+ if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) &&
+ !tcon->unix_ext) {
+ if (!cifs_sb->mnt_uid)
+ stat->uid = current_fsuid();
+ if (!cifs_sb->mnt_uid)
+ stat->gid = current_fsgid();
+ }
}
return err;
}
--
1.7.2.3
next reply other threads:[~2010-10-07 18:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 18:46 Jeff Layton [this message]
[not found] ` <1286477188-26681-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-10-07 18:48 ` [PATCH] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #5) Steve French
[not found] ` <AANLkTimTO_aBJFm==qLkRhXG-LVbMH7CqCdFhkxHAhCB@mail.gmail.com>
[not found] ` <AANLkTimTO_aBJFm==qLkRhXG-LVbMH7CqCdFhkxHAhCB-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-08 11:11 ` Jeff Layton
[not found] ` <20101008071137.45a4e27c-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-10-08 15:33 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1286477188-26681-1-git-send-email-jlayton@redhat.com \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.