• Jeff Layton's avatar
    disable most mode changes on non-unix/non-cifsacl mounts · 5132861a
    Jeff Layton authored
    CIFS currently allows you to change the mode of an inode on a share that
    doesn't have unix extensions enabled, and isn't using cifsacl. The inode
    in this case *only* has its mode changed in memory on the client. This
    is problematic since it can change any time the inode is purged from the
    cache.
    
    This patch makes cifs_setattr silently ignore most mode changes when
    unix extensions and cifsacl support are not enabled, and when the share
    is not mounted with the "dynperm" option. The exceptions are:
    
    When a mode change would remove all write access to an inode we turn on
    the ATTR_READONLY bit on the server and remove all write bits from the
    inode's mode in memory.
    
    When a mode change would add a write bit to an inode that previously had
    them all turned off, it turns off the ATTR_READONLY bit on the server,
    and resets the mode back to what it would normally be (generally, the
    file_mode or dir_mode of the share).
    Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
    Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
    5132861a
inode.c 49.5 KB