[PATCH] xfsqa: add testcase for ->setattr permission checking

Timothy Shimmin tes at sgi.com
Tue Dec 9 22:36:27 CST 2008


Timothy Shimmin wrote:
> For chown:
> 	"If the specified file is a regular file, one or more of the S_IXUSR,
> 	S_IXGRP, or S_IXOTH bits of the file mode are set, and the process
> 	does not have appropriate privileges, the set-user-ID (S_ISUID) and
> 	set-group-ID (S_ISGID) bits of the file mode shall be cleared upon
> 	successful return from chown(). If the specified file is a regular
> 	file, one or more of the S_IXUSR, S_IXGRP, or S_IXOTH bits of the
> 	file mode are set, and the process has appropriate privileges, it
> 	is implementation-defined whether the set-user-ID and set-group-ID
> 	bits are altered. If the chown() function is successfully invoked
> 	on a file that is not a regular file and one or more of the S_IXUSR,
> 	S_IXGRP, or S_IXOTH bits of the file mode are set, the set-user-ID
> 	and set-group-ID bits may be cleared."
> 
> reg file + mode-bits set + no appropriate privileges -> clear suid,sgid
> reg file + mode-bits set + appropriate privileges -> maybe clear suid,sgid
> non reg file + mode-bits set + chown success on file (??) -> maybe clear suid/sgid
> 
s/mode-bits/exec-mode-bits/

--Tim




More information about the xfs mailing list