kill suid bit only for regular files
[deliverable/linux.git] / mm / filemap.c
index f3e5f8944d1763474b4c19e411af129ed03ab324..ed53ce876259b32d53f1b7e52ebe3153bf694fd6 100644 (file)
@@ -1766,7 +1766,7 @@ int should_remove_suid(struct dentry *dentry)
        if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
                kill |= ATTR_KILL_SGID;
 
-       if (unlikely(kill && !capable(CAP_FSETID)))
+       if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode)))
                return kill;
 
        return 0;
This page took 0.024521 seconds and 5 git commands to generate.