Implement file posix capabilities
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / attr.c
index f8dfc2269d85634aa61ebb19a761e986ea0bbc93..ae58bd3f875f9c92c9599bacebbab85ebdf2c800 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -116,6 +116,15 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
                attr->ia_atime = now;
        if (!(ia_valid & ATTR_MTIME_SET))
                attr->ia_mtime = now;
+       if (ia_valid & ATTR_KILL_PRIV) {
+               attr->ia_valid &= ~ATTR_KILL_PRIV;
+               ia_valid &= ~ATTR_KILL_PRIV;
+               error = security_inode_need_killpriv(dentry);
+               if (error > 0)
+                       error = security_inode_killpriv(dentry);
+               if (error)
+                       return error;
+       }
        if (ia_valid & ATTR_KILL_SUID) {
                attr->ia_valid &= ~ATTR_KILL_SUID;
                if (mode & S_ISUID) {