* [PATCH 7/7] CIFS: ignore mode change if it's just for clearing setuid/setgid bits
@ 2007-09-10 14:52 Jeff Layton
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2007-09-10 14:52 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel
Cc: nfs, unionfs, linux-cifs-client, ecryptfs-devel, reiserfs-devel
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For CIFS, skip the mode change and
let the server handle it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/cifs/inode.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 66436f5..8fa3d63 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1547,6 +1547,11 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
}
time_buf.Attributes = 0;
+
+ /* skip mode change if it's just for clearing setuid/setgid */
+ if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID))
+ attrs->ia_valid &= ~ATTR_MODE;
+
if (attrs->ia_valid & ATTR_MODE) {
cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode));
mode = attrs->ia_mode;
--
1.5.2.1
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 7/7] CIFS: ignore mode change if it's just for clearing setuid/setgid bits
@ 2007-09-17 11:29 Jeff Layton
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2007-09-17 11:29 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, akpm
Cc: nfs, unionfs, linux-cifs-client, ecryptfs-devel, reiserfs-devel
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For CIFS, skip the mode change and
let the server handle it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/cifs/inode.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 66436f5..8fa3d63 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1547,6 +1547,11 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
}
time_buf.Attributes = 0;
+
+ /* skip mode change if it's just for clearing setuid/setgid */
+ if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID))
+ attrs->ia_valid &= ~ATTR_MODE;
+
if (attrs->ia_valid & ATTR_MODE) {
cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode));
mode = attrs->ia_mode;
--
1.5.2.1
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 7/7] CIFS: ignore mode change if it's just for clearing setuid/setgid bits
@ 2007-09-20 9:11 Jeff Layton
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2007-09-20 9:11 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, akpm
Cc: nfs, unionfs, linux-cifs-client, ecryptfs-devel, reiserfs-devel
If the ATTR_KILL_S*ID bits are set then any mode change is only for
clearing the setuid/setgid bits. For CIFS, skip the mode change and
let the server handle it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/cifs/inode.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 552d68b..515ccc1 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1555,6 +1555,11 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
}
time_buf.Attributes = 0;
+
+ /* skip mode change if it's just for clearing setuid/setgid */
+ if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID))
+ attrs->ia_valid &= ~ATTR_MODE;
+
if (attrs->ia_valid & ATTR_MODE) {
cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode));
mode = attrs->ia_mode;
--
1.5.2.1
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-09-20 9:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17 11:29 [PATCH 7/7] CIFS: ignore mode change if it's just for clearing setuid/setgid bits Jeff Layton
-- strict thread matches above, loose matches on Subject: below --
2007-09-20 9:11 Jeff Layton
2007-09-10 14:52 Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).