remove-suid-2.6-suse.patch

来自「非常经典的一个分布式系统」· PATCH 代码 · 共 23 行

PATCH
23
字号
--- linux-2.6.5-7.141/mm/filemap.c.orig	2005-02-18 14:53:26.000000000 +0200+++ linux-2.6.5-7.141/mm/filemap.c	2005-02-18 22:37:28.727492096 +0200@@ -1816,6 +1816,19 @@ int remove_suid(struct dentry *dentry)  	if (unlikely(kill && !capable(CAP_FSETID))) { 		struct iattr newattrs;+		struct inode_operations *op = dentry->d_inode->i_op;++		if (op && op->setattr_raw) {+			newattrs.ia_mode = mode & ~S_ISUID;+			if (kill & ATTR_KILL_SGID)+				newattrs.ia_mode &= ~S_ISGID;++			newattrs.ia_valid = ATTR_FORCE | ATTR_MODE;+			result = op->setattr_raw(dentry->d_inode, &newattrs);+			/* the file system wants to use normal vfs path now */+			if (result != -EOPNOTSUPP)+				return result;+		}  		newattrs.ia_valid = ATTR_FORCE | kill; 		result = notify_change(dentry, &newattrs);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?