Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b82dc0e64e93f430182f36b46b79fcee87d3532
Commit:     7b82dc0e64e93f430182f36b46b79fcee87d3532
Parent:     1efd48b3ae8f89a1d04f1e36be96764d7bf43ae9
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 20:10:00 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 20:10:00 2007 -0700

    Remove suid/sgid bits on [f]truncate()
    
    .. to match what we do on write().  This way, people who write to files
    by using [f]truncate + writable mmap have the same semantics as if they
    were using the write() family of system calls.
    
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/open.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index ca9981c..0d515d1 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -210,6 +210,9 @@ int do_truncate(struct dentry *dentry, loff_t length, 
unsigned int time_attrs,
                newattrs.ia_valid |= ATTR_FILE;
        }
 
+       /* Remove suid/sgid on truncate too */
+       newattrs.ia_valid |= should_remove_suid(dentry);
+
        mutex_lock(&dentry->d_inode->i_mutex);
        err = notify_change(dentry, &newattrs);
        mutex_unlock(&dentry->d_inode->i_mutex);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to