aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-05-12 18:23:49 -0400
committerSteve French <sfrench@us.ibm.com>2008-05-12 18:23:49 -0400
commitd0a9c078db4769f7305ff9774558776d12bfb25b (patch)
tree689bfe5a751c9b584202e8647ac03724eda0a378 /fs
parentc714a534d85576af21b06be605ca55cb2fb887ee (diff)
[CIFS] CIFS currently allows for permissions to be changed on files, even
when unix extensions and cifsacl support are disabled. These permissions changes are "ephemeral" however. They are lost whenever a share is mounted and unmounted, or when memory pressure forces the inode out of the cache. Because of this, we'd like to introduce a behavior change to make CIFS behave more like local DOS/Windows filesystems. When unix extensions and cifsacl support aren't enabled, then don't silently ignore changes to permission bits that can't be reflected on the server. Still, there may be people relying on the current behavior for certain applications. This patch adds a new "dynperm" (and a corresponding "nodynperm") mount option that will be intended to make the client fall back to legacy behavior when setting these modes. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifs_fs_sb.h1
-rw-r--r--fs/cifs/connect.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 8ad2330ba061..877c85409f1f 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -30,6 +30,7 @@
30#define CIFS_MOUNT_CIFS_ACL 0x200 /* send ACL requests to non-POSIX srv */ 30#define CIFS_MOUNT_CIFS_ACL 0x200 /* send ACL requests to non-POSIX srv */
31#define CIFS_MOUNT_OVERR_UID 0x400 /* override uid returned from server */ 31#define CIFS_MOUNT_OVERR_UID 0x400 /* override uid returned from server */
32#define CIFS_MOUNT_OVERR_GID 0x800 /* override gid returned from server */ 32#define CIFS_MOUNT_OVERR_GID 0x800 /* override gid returned from server */
33#define CIFS_MOUNT_DYNPERM 0x1000 /* allow in-memory only mode setting */
33 34
34struct cifs_sb_info { 35struct cifs_sb_info {
35 struct cifsTconInfo *tcon; /* primary mount */ 36 struct cifsTconInfo *tcon; /* primary mount */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index f428bf3bf1a9..8e2fa6d46c72 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -75,6 +75,7 @@ struct smb_vol {
75 bool setuids:1; 75 bool setuids:1;
76 bool override_uid:1; 76 bool override_uid:1;
77 bool override_gid:1; 77 bool override_gid:1;
78 bool dynperm:1;
78 bool noperm:1; 79 bool noperm:1;
79 bool no_psx_acl:1; /* set if posix acl support should be disabled */ 80 bool no_psx_acl:1; /* set if posix acl support should be disabled */
80 bool cifs_acl:1; 81 bool cifs_acl:1;
@@ -1246,6 +1247,10 @@ cifs_parse_mount_options(char *options, const char *devname,
1246 vol->setuids = 1; 1247 vol->setuids = 1;
1247 } else if (strnicmp(data, "nosetuids", 9) == 0) { 1248 } else if (strnicmp(data, "nosetuids", 9) == 0) {
1248 vol->setuids = 0; 1249 vol->setuids = 0;
1250 } else if (strnicmp(data, "dynperm", 7) == 0) {
1251 vol->dynperm = true;
1252 } else if (strnicmp(data, "nodynperm", 9) == 0) {
1253 vol->dynperm = false;
1249 } else if (strnicmp(data, "nohard", 6) == 0) { 1254 } else if (strnicmp(data, "nohard", 6) == 0) {
1250 vol->retry = 0; 1255 vol->retry = 0;
1251 } else if (strnicmp(data, "nosoft", 6) == 0) { 1256 } else if (strnicmp(data, "nosoft", 6) == 0) {
@@ -2125,6 +2130,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2125 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_UID; 2130 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_UID;
2126 if (volume_info.override_gid) 2131 if (volume_info.override_gid)
2127 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; 2132 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID;
2133 if (volume_info.dynperm)
2134 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM;
2128 if (volume_info.direct_io) { 2135 if (volume_info.direct_io) {
2129 cFYI(1, ("mounting share using direct i/o")); 2136 cFYI(1, ("mounting share using direct i/o"));
2130 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; 2137 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;