Re: [PATCH 13/15] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 23 Sep 2010 01:19:23 -0500
Steve French <smfrench@xxxxxxxxx> wrote:

> Won't this overwrite the effect of the "uid" mount parameter?
> 
> linux_uid is set at mount time to either current uid or what is passed
> in on uid (if "uid" is specified on mount).   Your code seems to
> unconditionally change that to ignore the uid passed in or mount.
> 

Does it make sense to present ownership of all files the same as the
uid= option in a multiuser mount scenario? Note that when it's not a
multiuser mount, the current behavior is unchanged.

> On Mon, Sep 20, 2010 at 6:01 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> > ...when unix extensions aren't enabled. This makes everything on
> > the mount appear to be owned by the current user.
> >
> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> > ---
> >  fs/cifs/inode.c |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> > index dcd0886..2256124 100644
> > --- a/fs/cifs/inode.c
> > +++ b/fs/cifs/inode.c
> > @@ -1761,11 +1761,19 @@ 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) {
> > +                       stat->uid = current_fsuid();
> > +                       stat->gid = current_fsgid();
> > +               }
> >        }
> >        return err;
> >  }
> > --
> > 1.7.2.3
> >
> >
> 
> 
> 


-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux